From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KMV: VMX: consult IA32_VMX_EPT_VPID_CAP to determine EPT paging-structure memory type Date: Tue, 23 Mar 2010 12:19:15 +0200 Message-ID: <4BA895A3.4060807@redhat.com> References: <4BA73322.5020001@cn.fujitsu.com> <201003221713.26941.sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Gui Jianfeng , mtosatti@redhat.com, kvm@vger.kernel.org To: Sheng Yang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:5768 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751253Ab0CWKTV (ORCPT ); Tue, 23 Mar 2010 06:19:21 -0400 In-Reply-To: <201003221713.26941.sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/22/2010 11:13 AM, Sheng Yang wrote: > >> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >> index 06108f3..f971b9b 100644 >> --- a/arch/x86/kvm/vmx.c >> +++ b/arch/x86/kvm/vmx.c >> @@ -1804,9 +1804,15 @@ static u64 construct_eptp(unsigned long root_hpa) >> { >> u64 eptp; >> >> - /* TODO write the value reading from MSR */ >> - eptp = VMX_EPT_DEFAULT_MT | >> - VMX_EPT_DEFAULT_GAW<< VMX_EPT_GAW_EPTP_SHIFT; >> + if (cpu_has_vmx_eptp_writeback()) >> + eptp = VMX_EPT_MT_WRBACK | >> + VMX_EPT_DEFAULT_GAW<< VMX_EPT_GAW_EPTP_SHIFT; >> > I prefer to ensure WB is supported and used as default. Otherwise it would be > a big trouble for memory subsystem(to use UC for all memory). Both WB and UC > EPT memory types are ensured to be support in hardware. > > And you can remove VMX_EPT_DEFAULT_MT as well. > I agree, hopefully we never ever see a cpu that doesn't support EPT WB. -- error compiling committee.c: too many arguments to function