kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm: fix detection of BIOS disabling VMX
@ 2011-02-08 19:45 Joseph Cihula
  2011-02-10 10:01 ` Avi Kivity
  0 siblings, 1 reply; 4+ messages in thread
From: Joseph Cihula @ 2011-02-08 19:45 UTC (permalink / raw)
  To: avi, mtosatti, kvm; +Cc: shane.wang, joseph.cihula

This patch fixes the logic used to detect whether BIOS has disabled VMX.

Signed-off-by:  Joseph Cihula <joseph.cihula@intel.com>


diff -uprN linux-2.6.38-rc3/arch/x86/kvm/vmx.c
linux-2.6.38-rc3-patched/arch/x86/kvm/vmx.c
--- linux-2.6.38-rc3/arch/x86/kvm/vmx.c	2011-01-31 19:05:49.000000000 -0800
+++ linux-2.6.38-rc3-patched/arch/x86/kvm/vmx.c	2011-02-08
09:21:22.639995662 -0800
@@ -1333,19 +1333,25 @@ static __init int vmx_disabled_by_bios(v

 	rdmsrl(MSR_IA32_FEATURE_CONTROL, msr);
 	if (msr & FEATURE_CONTROL_LOCKED) {
+		/* launched w/ TXT and VMX disabled */
 		if (!(msr & FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX)
 			&& tboot_enabled())
 			return 1;
+		/* launched w/o TXT and VMX only enabled w/ TXT */
 		if (!(msr & FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX)
+			&& (msr & FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX)
 			&& !tboot_enabled()) {
 			printk(KERN_WARNING "kvm: disable TXT in the BIOS or "
-				" activate TXT before enabling KVM\n");
+				"activate TXT before enabling KVM\n");
 			return 1;
 		}
+		/* launched w/o TXT and VMX disabled */
+		if (!(msr & FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX)
+			&& !tboot_enabled())
+			return 1;
 	}

 	return 0;
-	/* locked but not enabled */
 }

 static void kvm_cpu_vmxon(u64 addr)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] kvm: fix detection of BIOS disabling VMX
  2011-02-08 19:45 [PATCH] kvm: fix detection of BIOS disabling VMX Joseph Cihula
@ 2011-02-10 10:01 ` Avi Kivity
  2011-02-19  0:02   ` Cihula, Joseph
  0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2011-02-10 10:01 UTC (permalink / raw)
  To: Joseph Cihula; +Cc: mtosatti, kvm, shane.wang

On 02/08/2011 09:45 PM, Joseph Cihula wrote:
> This patch fixes the logic used to detect whether BIOS has disabled VMX.
>

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] kvm: fix detection of BIOS disabling VMX
  2011-02-10 10:01 ` Avi Kivity
@ 2011-02-19  0:02   ` Cihula, Joseph
  2011-02-20  9:00     ` Avi Kivity
  0 siblings, 1 reply; 4+ messages in thread
From: Cihula, Joseph @ 2011-02-19  0:02 UTC (permalink / raw)
  To: Avi Kivity; +Cc: mtosatti@redhat.com, kvm@vger.kernel.org, Wang, Shane

> From: Avi Kivity [mailto:avi@redhat.com]
> Sent: Thursday, February 10, 2011 2:02 AM
> 
> On 02/08/2011 09:45 PM, Joseph Cihula wrote:
> > This patch fixes the logic used to detect whether BIOS has disabled VMX.
> >
> 
> Applied, thanks.

Will you request this be taken by the -stable kernel?

Joe

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] kvm: fix detection of BIOS disabling VMX
  2011-02-19  0:02   ` Cihula, Joseph
@ 2011-02-20  9:00     ` Avi Kivity
  0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2011-02-20  9:00 UTC (permalink / raw)
  To: Cihula, Joseph; +Cc: mtosatti@redhat.com, kvm@vger.kernel.org, Wang, Shane

On 02/19/2011 02:02 AM, Cihula, Joseph wrote:
> >  From: Avi Kivity [mailto:avi@redhat.com]
> >  Sent: Thursday, February 10, 2011 2:02 AM
> >
> >  On 02/08/2011 09:45 PM, Joseph Cihula wrote:
> >  >  This patch fixes the logic used to detect whether BIOS has disabled VMX.
> >  >
> >
> >  Applied, thanks.
>
> Will you request this be taken by the -stable kernel?
>

Depends.  What circumstances are required for this to trigger?

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-20  9:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-08 19:45 [PATCH] kvm: fix detection of BIOS disabling VMX Joseph Cihula
2011-02-10 10:01 ` Avi Kivity
2011-02-19  0:02   ` Cihula, Joseph
2011-02-20  9:00     ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).