From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: Enable VMX-related bits in MSR_IA32_FEATURE_CONTROL. Date: Tue, 06 Mar 2012 17:13:36 +0200 Message-ID: <4F5629A0.8060209@redhat.com> References: <1331046141-11101-1-git-send-email-js@alien8.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Julian Stecklina Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44211 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030775Ab2CFPNv (ORCPT ); Tue, 6 Mar 2012 10:13:51 -0500 In-Reply-To: <1331046141-11101-1-git-send-email-js@alien8.de> Sender: kvm-owner@vger.kernel.org List-ID: On 03/06/2012 05:02 PM, Julian Stecklina wrote: > The spec (Vol 3C, Chapter 34.1) regarding the IA32_FEATURE_CONTROL MSR says "Therefore the lock bit must be set after configuring support for Intel Virtualization Technology and prior to transferring control to an option ROM or the OS." and regarding bit 2: "This bit enables VMX for system executive that do not require SMX." > > Signed-off-by: Julian Stecklina > --- > arch/x86/kvm/vmx.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 4ea7678..aef1e5b 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -2007,7 +2007,12 @@ static int vmx_get_vmx_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata) > > switch (msr_index) { > case MSR_IA32_FEATURE_CONTROL: > - *pdata = 0; > + /* > + * If nested VMX is enabled, set the lock bit (bit 0) > + * and the "Enable VMX outside SMX" bit (bit 2) in the > + * FEATURE_CONTROL MSR. > + */ > + *pdata = nested_vmx_allowed(vcpu) ? 0x5 : 0; > break; > case MSR_IA32_VMX_BASIC: > /* The way I read it, it should be done by the guest, not the host. -- error compiling committee.c: too many arguments to function