From patchwork Wed Apr 1 02:02:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 15581 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3122fP6010332 for ; Wed, 1 Apr 2009 02:02:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754480AbZDACCe (ORCPT ); Tue, 31 Mar 2009 22:02:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754651AbZDACCe (ORCPT ); Tue, 31 Mar 2009 22:02:34 -0400 Received: from mga01.intel.com ([192.55.52.88]:39507 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754254AbZDACCd (ORCPT ); Tue, 31 Mar 2009 22:02:33 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 31 Mar 2009 18:53:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.39,305,1235980800"; d="scan'208";a="443825819" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.13.189]) by fmsmga002.fm.intel.com with ESMTP; 31 Mar 2009 18:57:47 -0700 Received: from yasker by syang10-desktop with local (Exim 4.69) (envelope-from ) id 1Lopmg-00045I-F6; Wed, 01 Apr 2009 10:02:30 +0800 Date: Wed, 1 Apr 2009 10:02:30 +0800 From: Sheng Yang To: Andrew Theurer Cc: kvm@vger.kernel.org, Avi Kivity Subject: Re: EPT support breakage on: KVM: VMX: Zero ept module parameter if ept is not present Message-ID: <20090401020230.GA15680@syang10-desktop> References: <49D23010.9010408@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <49D23010.9010408@linux.vnet.ibm.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Oops... Thanks very much for reporting! I can't believe we haven't awared of that... Could you please try the attached patch? Thanks! 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(); }