]> err.no Git - linux-2.6/commitdiff
[PATCH] KVM: Fix vmx hardware_enable() on macbooks
authorAvi Kivity <avi@qumranet.com>
Wed, 13 Dec 2006 08:34:16 +0000 (00:34 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Wed, 13 Dec 2006 17:05:48 +0000 (09:05 -0800)
It seems macbooks set bit 2 but not bit 0, which is an "enabled but vmxon will
fault" setting.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Tested-by: Alex Larsson (sometimes testing helps)
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/kvm/vmx.c

index ea3bdbb0da9c8f5d8b3dad075bcb5165f2de04f9..f0f0b1a781f8191304da44ed396ac8e89cd086ba 100644 (file)
@@ -534,7 +534,7 @@ static __init void hardware_enable(void *garbage)
        u64 old;
 
        rdmsrl(MSR_IA32_FEATURE_CONTROL, old);
-       if ((old & 5) == 0)
+       if ((old & 5) != 5)
                /* enable and lock */
                wrmsrl(MSR_IA32_FEATURE_CONTROL, old | 5);
        write_cr4(read_cr4() | CR4_VMXE); /* FIXME: not cpu hotplug safe */