]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: nVMX: Suppress external interrupt VM-Exit injection if there's no IRQ
authorSean Christopherson <seanjc@google.com>
Fri, 6 Sep 2024 04:34:09 +0000 (21:34 -0700)
committerSean Christopherson <seanjc@google.com>
Tue, 10 Sep 2024 03:14:59 +0000 (20:14 -0700)
commit8c23670f2b0004edb8f7135e314114f0c3452085
tree79992a37eb7a5170c3f339279aa13a245ac555e3
parent363010e1dd0efd4778637c1a5a5aaffbcfcae919
KVM: nVMX: Suppress external interrupt VM-Exit injection if there's no IRQ

In the should-be-impossible scenario that kvm_cpu_get_interrupt() doesn't
return a valid vector after checking kvm_cpu_has_interrupt(), skip VM-Exit
injection to reduce the probability of crashing/confusing L1.  Now that
KVM gets the IRQ _before_ calling nested_vmx_vmexit(), squashing the
VM-Exit injection is trivial since there are no actions that need to be
undone.

Reviewed-by: Chao Gao <chao.gao@intel.com>
Link: https://lore.kernel.org/r/20240906043413.1049633-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/nested.c