Skip to content

Commit

Permalink
KVM: is_long_mode() should check for EFER.LMA
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Amit Shah authored and Avi Kivity committed Mar 24, 2009
1 parent 401d10d commit 41d6af1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41d6af1

Please sign in to comment.