From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [kvm-unit-tests] x86: access: Add test for 5 level paging mode Date: Tue, 12 Sep 2017 15:39:28 +0200 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-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Yu Zhang , kvm@vger.kernel.org To: Paolo Bonzini Return-path: 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 Content-Disposition: inline In-Reply-To: <04ab9a47-fad7-a656-de55-650d8630a8b8@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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