]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: VMX: WARN if VT-d Posted IRQs aren't possible when starting IRQ bypass
authorSean Christopherson <seanjc@google.com>
Wed, 11 Jun 2025 22:45:57 +0000 (15:45 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 23 Jun 2025 16:50:47 +0000 (09:50 -0700)
WARN if KVM attempts to "start" IRQ bypass when VT-d Posted IRQs are
disabled, to make it obvious that the logic is a sanity check, and so that
a bug related to nr_possible_bypass_irqs is more like to cause noisy
failures, e.g. so that KVM doesn't silently fail to wake blocking vCPUs.

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

index 5671d59a6b6d5f98e506b5805cd65bcc67be68f4..4a6d9a17da238ccca9d408d5c1750f987a4d92f6 100644 (file)
@@ -296,7 +296,7 @@ bool pi_has_pending_interrupt(struct kvm_vcpu *vcpu)
  */
 void vmx_pi_start_bypass(struct kvm *kvm)
 {
-       if (!kvm_arch_has_irq_bypass())
+       if (WARN_ON_ONCE(!vmx_can_use_vtd_pi(kvm)))
                return;
 
        kvm_make_all_cpus_request(kvm, KVM_REQ_UNBLOCK);