Skip to content

Commit cc8b131

Browse files
committed
KVM: x86: Don't update IRTE entries when old and new routes were !MSI
Skip the entirety of IRTE updates on a GSI routing change if neither the old nor the new routing is for an MSI, i.e. if the neither routing setup allows for posting to a vCPU. If the IRTE isn't already host controlled, KVM has bigger problems. Link: https://lore.kernel.org/r/20250611224604.313496-38-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent dc6adb1 commit cc8b131

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/kvm/irq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,10 @@ void kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
618618
struct kvm_kernel_irq_routing_entry *old,
619619
struct kvm_kernel_irq_routing_entry *new)
620620
{
621+
if (new->type != KVM_IRQ_ROUTING_MSI &&
622+
old->type != KVM_IRQ_ROUTING_MSI)
623+
return;
624+
621625
if (old->type == KVM_IRQ_ROUTING_MSI &&
622626
new->type == KVM_IRQ_ROUTING_MSI &&
623627
!memcmp(&old->msi, &new->msi, sizeof(new->msi)))

0 commit comments

Comments
 (0)