Skip to content

Commit

Permalink
KVM: x86: Check LMA bit before set_efer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sheng Yang authored and Avi Kivity committed May 19, 2010
1 parent f78e917 commit a3d204e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,11 +709,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;
Expand Down

0 comments on commit a3d204e

Please sign in to comment.