From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Theurer Subject: Re: EPT support breakage on: KVM: VMX: Zero ept module parameter if ept is not present Date: Wed, 01 Apr 2009 15:26:44 -0500 Message-ID: <49D3CE04.8030101@linux.vnet.ibm.com> References: <49D23010.9010408@linux.vnet.ibm.com> <20090401020230.GA15680@syang10-desktop> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Avi Kivity To: Sheng Yang Return-path: Received: from e31.co.us.ibm.com ([32.97.110.149]:41540 "EHLO e31.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755764AbZDAU04 (ORCPT ); Wed, 1 Apr 2009 16:26:56 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e31.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id n31KNoZW009296 for ; Wed, 1 Apr 2009 14:23:50 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n31KQnkW102888 for ; Wed, 1 Apr 2009 14:26:50 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n31KQksA015644 for ; Wed, 1 Apr 2009 14:26:48 -0600 In-Reply-To: <20090401020230.GA15680@syang10-desktop> Sender: kvm-owner@vger.kernel.org List-ID: Sheng Yang wrote: > Oops... Thanks very much for reporting! I can't believe we haven't awared of > that... > > Could you please try the attached patch? Thanks! > Tested and works great. Thanks! -Andrew > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index aba41ae..8d6465b 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -1195,15 +1195,6 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf) > vmx_capability.ept, vmx_capability.vpid); > } > > - if (!cpu_has_vmx_vpid()) > - enable_vpid = 0; > - > - if (!cpu_has_vmx_ept()) > - enable_ept = 0; > - > - if (!(vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) > - flexpriority_enabled = 0; > - > min = 0; > #ifdef CONFIG_X86_64 > min |= VM_EXIT_HOST_ADDR_SPACE_SIZE; > @@ -1307,6 +1298,15 @@ static __init int hardware_setup(void) > if (boot_cpu_has(X86_FEATURE_NX)) > kvm_enable_efer_bits(EFER_NX); > > + if (!cpu_has_vmx_vpid()) > + enable_vpid = 0; > + > + if (!cpu_has_vmx_ept()) > + enable_ept = 0; > + > + if (!(vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) > + flexpriority_enabled = 0; > + > return alloc_kvm_area(); > } > >