KVM: x86: emulator: introduce emulator_recalc_and_set_mode
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 25 Oct 2022 12:47:29 +0000 (15:47 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 28 Oct 2022 10:10:29 +0000 (06:10 -0400)
commitd087e0f79fa0dd336a9a6b2f79ec23120f5eff73
tree9fb274942e7a0fa59c56088ff72d809ce64d7499
parent5015bb89b58225f97df6ac44383e7e8c8662c8c9
KVM: x86: emulator: introduce emulator_recalc_and_set_mode

Some instructions update the cpu execution mode, which needs to update the
emulation mode.

Extract this code, and make assign_eip_far use it.

assign_eip_far now reads CS, instead of getting it via a parameter,
which is ok, because callers always assign CS to the same value
before calling this function.

No functional change is intended.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20221025124741.228045-12-mlevitsk@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c