summaryrefslogtreecommitdiff
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:11:18 -0700
commite4a13296e7e92ddd73fa078906744d73f7d470ff (patch)
treeaec2c81efca22d0324fefeece0930ce643315fa6
parent90a08dc75c91c0e50cabc11e79a761e1d63a0303 (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 fa536e8db69e..3f83a30d1802 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -516,11 +516,11 @@ static void set_efer(struct kvm_vcpu *vcpu, u64 efer)
}
}
- kvm_x86_ops->set_efer(vcpu, efer);
-
efer &= ~EFER_LMA;
efer |= vcpu->arch.shadow_efer & EFER_LMA;
+ kvm_x86_ops->set_efer(vcpu, efer);
+
vcpu->arch.shadow_efer = efer;
vcpu->arch.mmu.base_role.nxe = (efer & EFER_NX) && !tdp_enabled;