KVM: x86: Add emulation status for unhandleable exception vectoring
authorIvan Orlov <iorlov@amazon.com>
Tue, 17 Dec 2024 18:14:53 +0000 (18:14 +0000)
committerSean Christopherson <seanjc@google.com>
Wed, 18 Dec 2024 23:14:42 +0000 (15:14 -0800)
commit5c9cfc48663606f26455e4113fd5a1f29b19ddc9
tree1e813d257289dfbb5ab1396dd1b096a4790e73e5
parent11c98fa07a792c7667c9c0d4f3c7f2d620bfb7f0
KVM: x86: Add emulation status for unhandleable exception vectoring

Add emulation status for unhandleable vectoring, i.e. when KVM can't
emulate an instruction because emulation was triggered on an exit that
occurred while the CPU was vectoring an event.  Such a situation can
occur if guest sets the IDT descriptor base to point to MMIO region,
and triggers an exception after that.

Exit to userspace with event delivery error when KVM can't emulate
an instruction when vectoring an event.

Signed-off-by: Ivan Orlov <iorlov@amazon.com>
Link: https://lore.kernel.org/r/20241217181458.68690-3-iorlov@amazon.com
[sean: massage changelog and X86EMUL_UNHANDLEABLE_VECTORING comment]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/kvm_emulate.h
arch/x86/kvm/x86.c