KVM: is_long_mode() should check for EFER.LMA
authorAmit Shah <amit.shah@qumranet.com>
Thu, 28 Feb 2008 10:36:15 +0000 (16:06 +0530)
committerAvi Kivity <avi@redhat.com>
Tue, 24 Mar 2009 09:03:13 +0000 (11:03 +0200)
is_long_mode currently checks the LongModeEnable bit in
EFER instead of the LongModeActive bit. This is wrong, but
we survived this till now since it wasn't triggered. This
breaks guests that go from long mode to compatibility mode.

This is noticed on a solaris guest and fixes bug #1842160

Signed-off-by: Amit Shah <amit.shah@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/mmu.h

index 258e5d5..eaab214 100644 (file)
@@ -54,7 +54,7 @@ static inline int kvm_mmu_reload(struct kvm_vcpu *vcpu)
 static inline int is_long_mode(struct kvm_vcpu *vcpu)
 {
 #ifdef CONFIG_X86_64
-       return vcpu->arch.shadow_efer & EFER_LME;
+       return vcpu->arch.shadow_efer & EFER_LMA;
 #else
        return 0;
 #endif