Update the emulation mode after RSM so that RIP will be correctly written back, because the RSM instruction can switch the CPU mode from 32 bit (or less) to 64 bit.
This fixes a guest crash in case the #SMI is received while the guest runs a code from an address > 32 bit.
Signed-off-by: Maxim Levitsky mlevitsk@redhat.com --- arch/x86/kvm/emulate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index c65f57b6da9bf1..2c56d08b426065 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2315,7 +2315,7 @@ static int em_rsm(struct x86_emulate_ctxt *ctxt) if (ctxt->ops->leave_smm(ctxt)) ctxt->ops->triple_fault(ctxt);
- return X86EMUL_CONTINUE; + return emulator_recalc_and_set_mode(ctxt); }
static void