]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: SVM: Stop walking list of routing table entries when updating IRTE
authorSean Christopherson <seanjc@google.com>
Wed, 11 Jun 2025 22:45:26 +0000 (15:45 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 23 Jun 2025 16:50:26 +0000 (09:50 -0700)
commit1e663ed239923447a0217d78a96bcdc8729022e0
tree1d1157753dad972250031fe05794725ca6316f08
parent95d50ebe6df80b791d599b1f7434f3a8cac8a84f
KVM: SVM: Stop walking list of routing table entries when updating IRTE

Now that KVM explicitly passes the new/current GSI routing to
pi_update_irte(), simply use the provided routing entry and stop walking
the routing table to find that entry.  KVM, via setup_routing_entry() and
sanity checked by kvm_get_msi_route(), disallows having a GSI configured
to trigger multiple MSIs.

I.e. this is subtly a glorified nop, as KVM allows at most one MSI per
GSI, the for-loop can only ever process one entry, and that entry is the
new/current entry (see the WARN_ON_ONCE() added by "KVM: x86: Pass new
routing entries and irqfd when updating IRTEs" to ensure @new matches the
entry found in the routing table).

Tested-by: Sairaj Kodilkar <sarunkod@amd.com>
Link: https://lore.kernel.org/r/20250611224604.313496-25-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/avic.c