aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2010-05-12 04:40:40 -0400
committerAvi Kivity <avi@redhat.com>2010-05-19 04:41:09 -0400
commita3d204e28579427609c3d15d2310127ebaa47d94 (patch)
treed4da68fd9437dab5b1444766c7367f81496ea4e1
parentf78e917688edbf1f14c318d2e50dc8e7dad20445 (diff)
KVM: x86: Check LMA bit before set_efer
kvm_x86_ops->set_efer() would execute vcpu->arch.efer = efer, so the checking of LMA bit didn't work. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--arch/x86/kvm/x86.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index fa1c51925597..f0846d2aa956 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -709,11 +709,11 @@ static int set_efer(struct kvm_vcpu *vcpu, u64 efer)
709 return 1; 709 return 1;
710 } 710 }
711 711
712 kvm_x86_ops->set_efer(vcpu, efer);
713
714 efer &= ~EFER_LMA; 712 efer &= ~EFER_LMA;
715 efer |= vcpu->arch.efer & EFER_LMA; 713 efer |= vcpu->arch.efer & EFER_LMA;
716 714
715 kvm_x86_ops->set_efer(vcpu, efer);
716
717 vcpu->arch.efer = efer; 717 vcpu->arch.efer = efer;
718 718
719 vcpu->arch.mmu.base_role.nxe = (efer & EFER_NX) && !tdp_enabled; 719 vcpu->arch.mmu.base_role.nxe = (efer & EFER_NX) && !tdp_enabled;