From: Avi Kivity Date: Wed, 13 Dec 2006 08:34:16 +0000 (-0800) Subject: [PATCH] KVM: Fix vmx hardware_enable() on macbooks X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bfdc0c280a497575670e87efa89e78a88438483b;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [PATCH] KVM: Fix vmx hardware_enable() on macbooks It seems macbooks set bit 2 but not bit 0, which is an "enabled but vmxon will fault" setting. Signed-off-by: Avi Kivity Tested-by: Alex Larsson (sometimes testing helps) Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index ea3bdbb0da9c..f0f0b1a781f8 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -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 */