]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: nVMX: Synthesize nested VM-Exit for supported emulation intercepts
authorSean Christopherson <seanjc@google.com>
Sat, 1 Feb 2025 01:55:17 +0000 (17:55 -0800)
committerSean Christopherson <seanjc@google.com>
Mon, 24 Feb 2025 17:01:07 +0000 (09:01 -0800)
commit79a14afc60904cdb2b4288fd00c65b8159e0049a
tree0a69987874c0c1bf1c072856a96c1365f58db17a
parentfbd1e0f195464a362c91e16b5c327db0e89612ca
KVM: nVMX: Synthesize nested VM-Exit for supported emulation intercepts

When emulating an instruction on behalf of L2 that L1 wants to intercept,
generate a nested VM-Exit instead of injecting a #UD into L2.  Now that
(most of) the necessary information is available, synthesizing a VM-Exit
isn't terribly difficult.

Punt on decoding the ModR/M for descriptor table exits for now.  There is
no evidence that any hypervisor intercepts descriptor table accesses *and*
uses the EXIT_QUALIFICATION to expedite emulation, i.e. it's not worth
delaying basic support for.

To avoid doing more harm than good, e.g. by putting L2 into an infinite
or effectively corrupting its code stream, inject #UD if the instruction
length is nonsensical.

Link: https://lore.kernel.org/r/20250201015518.689704-11-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/vmx.c