KVM: x86: Add an emulation type to handle completion of user exits
authorHou Wenlong <houwenlong93@linux.alibaba.com>
Tue, 2 Nov 2021 09:15:30 +0000 (17:15 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Dec 2021 09:25:15 +0000 (04:25 -0500)
commit906fa90416fdb703467926ca4f6f55438cd7ea82
treecd9523efb3d6892e80a72d2642c02a41fa6052dc
parent5e854864ee4384736f27a986633bae21731a4e4e
KVM: x86: Add an emulation type to handle completion of user exits

The next patch would use kvm_emulate_instruction() with
EMULTYPE_SKIP in complete_userspace_io callback to fix a
problem in msr access emulation. However, EMULTYPE_SKIP
only updates RIP, more things like updating interruptibility
state and injecting single-step #DBs would be done in the
callback. Since the emulator also does those things after
x86_emulate_insn(), add a new emulation type to pair with
EMULTYPE_SKIP to do those things for completion of user exits
within the emulator.

Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Hou Wenlong <houwenlong93@linux.alibaba.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <8f8c8e268b65f31d55c2881a4b30670946ecfa0d.1635842679.git.houwenlong93@linux.alibaba.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/x86.c