aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2010-05-12 16:40:40 +0800
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-05 11:23:01 -0700
commit6809d9686bf751235b9acc8869fa5793f9fe912d (patch)
treea1b208d43de61dc98f450fc2c2b0fc671088d1b6
parent52be6f3f5c4f964c154be2a97f9e22be6837c98d (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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> (Cherry-picked from commit a3d204e28579427609c3d15d2310127ebaa47d94)
-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 d9680b3c40e..b5c4393385a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -657,11 +657,11 @@ static void set_efer(struct kvm_vcpu *vcpu, u64 efer)
}
}
- kvm_x86_ops->set_efer(vcpu, efer);
-
efer &= ~EFER_LMA;
efer |= vcpu->arch.efer & EFER_LMA;
+ kvm_x86_ops->set_efer(vcpu, efer);
+
vcpu->arch.efer = efer;
vcpu->arch.mmu.base_role.nxe = (efer & EFER_NX) && !tdp_enabled;