From patchwork Tue Sep 12 13:39:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= X-Patchwork-Id: 9949205 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 93F5C6024A for ; Tue, 12 Sep 2017 13:39:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8514228FDC for ; Tue, 12 Sep 2017 13:39:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79CB428FDE; Tue, 12 Sep 2017 13:39:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,HK_RANDOM_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EAEA28FDC for ; Tue, 12 Sep 2017 13:39:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751370AbdILNjb (ORCPT ); Tue, 12 Sep 2017 09:39:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5482 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751313AbdILNjb (ORCPT ); Tue, 12 Sep 2017 09:39:31 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 13CCBC0587CB; Tue, 12 Sep 2017 13:39:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 13CCBC0587CB Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=rkrcmar@redhat.com Received: from flask (unknown [10.43.2.80]) by smtp.corp.redhat.com (Postfix) with SMTP id 0C41777DE5; Tue, 12 Sep 2017 13:39:28 +0000 (UTC) Received: by flask (sSMTP sendmail emulation); Tue, 12 Sep 2017 15:39:28 +0200 Date: Tue, 12 Sep 2017 15:39:28 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini Cc: Yu Zhang , kvm@vger.kernel.org Subject: Re: [kvm-unit-tests] x86: access: Add test for 5 level paging mode Message-ID: <20170912133927.GB24326@flask> References: <1503662251-13895-1-git-send-email-yu.c.zhang@linux.intel.com> <04ab9a47-fad7-a656-de55-650d8630a8b8@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <04ab9a47-fad7-a656-de55-650d8630a8b8@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 12 Sep 2017 13:39:31 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 2017-09-12 14:16+0200, Paolo Bonzini: > On 25/08/2017 13:57, Yu Zhang wrote: > > Provide paging mode switching logic to run access test in 5 > > level paging mode if LA57 is detected. Qemu parameter +la57 > > should be used to expose this feature, for example: > > ./x86-run ./x86/access.flat -cpu qemu64,+la57 > > > > Signed-off-by: Yu Zhang > > --- > > x86/access.c | 17 +++++++++++++++-- > > x86/cstart64.S | 43 ++++++++++++++++++++++++++++++++++++++++++- > > 2 files changed, 57 insertions(+), 3 deletions(-) > > I need this for the test to pass in QEMU. Probably the TLB is helping > you on real hardware! Pushed with this change. ... > > diff --git a/x86/access.c b/x86/access.c > > @@ -107,6 +108,8 @@ enum { > > #define AC_CPU_CR4_SMEP_MASK (1 << AC_CPU_CR4_SMEP_BIT) > > #define AC_CPU_CR4_PKE_MASK (1 << AC_CPU_CR4_PKE_BIT) > > > > +extern void setup_5level_page_table(); GCC doesn't like that this declaration got dropped: x86/access.c: In function ‘main’: x86/access.c:1009:9: error: implicit declaration of function ‘setup_5level_page_table’ [-Werror=implicit-function-declaration] setup_5level_page_table(); ^~~~~~~~~~~~~~~~~~~~~~~ We can also include instead: diff --git a/x86/access.c b/x86/access.c index 8268b0065467..a0c19dc701b7 100644 --- a/x86/access.c +++ b/x86/access.c @@ -3,6 +3,7 @@ #include "desc.h" #include "processor.h" #include "asm/page.h" +#include "x86/vm.h" #define smp_id() 0