Skip to content

Commit bcda70c

Browse files
sean-jcbonzini
authored andcommitted
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: 515a0c7 ("kvm: irqfd: avoid update unmodified entries of the routing") Cc: [email protected] Signed-off-by: Sean Christopherson <[email protected]> Message-ID: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 9bcac97 commit bcda70c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/x86/kvm/x86.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13607,7 +13607,8 @@ int kvm_arch_update_irqfd_routing(struct kvm *kvm, unsigned int host_irq,
1360713607
bool kvm_arch_irqfd_route_changed(struct kvm_kernel_irq_routing_entry *old,
1360813608
struct kvm_kernel_irq_routing_entry *new)
1360913609
{
13610-
if (new->type != KVM_IRQ_ROUTING_MSI)
13610+
if (old->type != KVM_IRQ_ROUTING_MSI ||
13611+
new->type != KVM_IRQ_ROUTING_MSI)
1361113612
return true;
1361213613

1361313614
return !!memcmp(&old->msi, &new->msi, sizeof(new->msi));

0 commit comments

Comments
 (0)