KVM: x86: Explicitly treat routing entry type changes as changes

Explicitly treat type differences as GSI routing changes, as comparing MSI
data between two entries could get a false negative, e.g. if userspace
changed the type but left the type-specific data as-is.

Fixes: 515a0c79e796 ("kvm: irqfd: avoid update unmodified entries of the routing")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20250404193923.1413163-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by Sean Christopherson and committed by Paolo Bonzini bcda70c5 9bcac97d

+2 -1
+2 -1
arch/x86/kvm/x86.c
··· 13607 13607 bool kvm_arch_irqfd_route_changed(struct kvm_kernel_irq_routing_entry *old, 13608 13608 struct kvm_kernel_irq_routing_entry *new) 13609 13609 { 13610 - if (new->type != KVM_IRQ_ROUTING_MSI) 13610 + if (old->type != KVM_IRQ_ROUTING_MSI || 13611 + new->type != KVM_IRQ_ROUTING_MSI) 13611 13612 return true; 13612 13613 13613 13614 return !!memcmp(&old->msi, &new->msi, sizeof(new->msi));