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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx>
---
 arch/x86/kvm/x86.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

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;
 
-- 
2.21.0




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux