From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 3/3] KVM: VMX: Enable EPT 1GB page support Date: Tue, 05 Jan 2010 12:43:21 +0200 Message-ID: <4B4317C9.9040900@redhat.com> References: <1262686361-11630-1-git-send-email-sheng@linux.intel.com> <1262686361-11630-4-git-send-email-sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Sheng Yang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:39109 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752288Ab0AEKnX (ORCPT ); Tue, 5 Jan 2010 05:43:23 -0500 In-Reply-To: <1262686361-11630-4-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On 01/05/2010 12:12 PM, Sheng Yang wrote: > Signed-off-by: Sheng Yang > --- > arch/x86/include/asm/vmx.h | 1 + > arch/x86/kvm/mmu.c | 8 +++++--- > arch/x86/kvm/vmx.c | 11 ++++++++++- > 3 files changed, 16 insertions(+), 4 deletions(-) > > diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h > index 713ed9a..43f1e9b 100644 > --- a/arch/x86/include/asm/vmx.h > +++ b/arch/x86/include/asm/vmx.h > @@ -364,6 +364,7 @@ enum vmcs_field { > #define VMX_EPTP_UC_BIT (1ull<< 8) > #define VMX_EPTP_WB_BIT (1ull<< 14) > #define VMX_EPT_2MB_PAGE_BIT (1ull<< 16) > +#define VMX_EPT_1GB_PAGE_BIT (1ull<< 17) > Can you share when this feature will be available in hardware? > static int vmx_get_lpage_level(void) > { > - return 2; /* PT_DIRECTORY_LEVEL */ > + if (enable_ept&& !cpu_has_vmx_ept_1g_page()) > + return 2; /* PT_DIRECTORY_LEVEL */ > + else > + /* For shadow and EPT supported 1GB page */ > + return 3; /* PT_PDPE_LEVEL */ > } > > Why not use the defines instead of numbers? It will reduce change when we change PT_*_LEVEL to be zero based instead of one based. Patchset looks good; second patch should go into .33 and stable, no? -- error compiling committee.c: too many arguments to function