]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: emulator: update the emulation mode after rsm
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 25 Oct 2022 12:47:30 +0000 (15:47 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 28 Oct 2022 10:10:29 +0000 (06:10 -0400)
commit6c1186a214b9c2b96d8dc837a7a6bc6e09b79ee8
treec57290148e006a4dad37d1277ed3e1f24dea5c6c
parent29a975beff7eaa90c493f5876ca5b8457f982b43
KVM: x86: emulator: update the emulation mode after rsm

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>
Message-Id: <20221025124741.228045-13-mlevitsk@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c