From: Paolo Bonzini Subject: Re: [kvm-unit-tests] x86: access: Add test for 5 level paging mode Date: Tue, 12 Sep 2017 15:42:54 +0200 Message-ID: References: <1503662251-13895-1-git-send-email-yu.c.zhang@linux.intel.com> <04ab9a47-fad7-a656-de55-650d8630a8b8@redhat.com> <20170912133927.GB24326@flask> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Yu Zhang , kvm@vger.kernel.org To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:35822 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751581AbdILNnC (ORCPT ); Tue, 12 Sep 2017 09:43:02 -0400 In-Reply-To: <20170912133927.GB24326@flask> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 12/09/2017 15:39, Radim Krčmář wrote: > 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 > > Ugh. Sorry, pushed the fix now. Paolo