KVM: is_long_mode() should check for EFER.LMA
authorAmit Shah <amit.shah@qumranet.com>
Fri, 17 Apr 2009 22:40:13 +0000 (19:40 -0300)
committerChris Wright <chrisw@sous-sol.org>
Mon, 27 Apr 2009 17:37:04 +0000 (10:37 -0700)
upstream commit: 41d6af119206e98764b4ae6d264d63acefcf851e

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>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
arch/x86/kvm/mmu.h

index 258e5d56298ee953b645bef4f36f1a11594771e1..eaab2145f62b21d31558372d511b16d8f1bc57d4 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