Skip to content

Commit

Permalink
KVM: SVM: Fix EFER.LME being stripped
Browse files Browse the repository at this point in the history
Must set VCPU register to be the guest notion of EFER even if that
setting is not valid on hardware.  This was masked by the set in
set_efer until 7657fd5ace88e8092f5f3a84117e093d7b893f26 broke that.
Fix is simply to set the VCPU register before stripping bits.

Signed-off-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
Zachary Amsden authored and Avi Kivity committed Aug 1, 2010
1 parent 01c168a commit 6dc696d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,11 @@ static inline void flush_guest_tlb(struct kvm_vcpu *vcpu)

static void svm_set_efer(struct kvm_vcpu *vcpu, u64 efer)
{
vcpu->arch.efer = efer;
if (!npt_enabled && !(efer & EFER_LMA))
efer &= ~EFER_LME;

to_svm(vcpu)->vmcb->save.efer = efer | EFER_SVME;
vcpu->arch.efer = efer;
}

static int is_external_interrupt(u32 info)
Expand Down

0 comments on commit 6dc696d

Please sign in to comment.