diff mbox series

[RFC,12/18] KVM: x86: call emulator_set_msr() directly when leaving SMM

Message ID 20190328175557.14408-13-sean.j.christopherson@intel.com (mailing list archive)
State New, archived
Headers show
Series KVM: x86: clear HF_SMM_MASK before loading state | expand

Commit Message

Sean Christopherson March 28, 2019, 5:55 p.m. UTC
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kvm/x86.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 45a1a98e4a81..b03debd98750 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -7760,7 +7760,7 @@  static int rsm_load_state_64(struct x86_emulate_ctxt *ctxt, u64 smbase)
 	cr4 =                       GET_SMSTATE(u64, smbase, 0x7f48);
 	vcpu->arch.smbase =         GET_SMSTATE(u32, smbase, 0x7f00);
 	val =                       GET_SMSTATE(u64, smbase, 0x7ed0);
-	ctxt->ops->set_msr(ctxt, MSR_EFER, val & ~EFER_LMA);
+	emulator_set_msr(ctxt, MSR_EFER, val & ~EFER_LMA);
 
 	selector =                  GET_SMSTATE(u32, smbase, 0x7e90);
 	rsm_set_desc_flags(&desc,   GET_SMSTATE(u32, smbase, 0x7e92) << 8);
@@ -7800,7 +7800,7 @@  static int rsm_load_state_64(struct x86_emulate_ctxt *ctxt, u64 smbase)
 static int leave_smm(struct kvm_vcpu *vcpu)
 {
 	struct x86_emulate_ctxt *ctxt = &vcpu->arch.emulate_ctxt;
-	unsigned long cr0, cr4, efer;
+	unsigned long cr0, cr4;
 	u64 smbase;
 	int ret;
 
@@ -7836,8 +7836,7 @@  static int leave_smm(struct kvm_vcpu *vcpu)
 		kvm_set_cr4(vcpu, cr4 & ~X86_CR4_PAE);
 
 	/* And finally go back to 32-bit mode.  */
-	efer = 0;
-	ctxt->ops->set_msr(ctxt, MSR_EFER, efer);
+	emulator_set_msr(ctxt, MSR_EFER, 0);
 
 	smbase = vcpu->arch.smbase;