From: Sheng Yang <sh...@linux.intel.com>

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 <sh...@linux.intel.com>
Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com>

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 37164e7..95dc5f3 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -716,11 +716,11 @@ static int set_efer(struct kvm_vcpu *vcpu, u64 efer)
                        return 1;
        }
 
-       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;
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to