Commit 1fbe6861 authored by Sean Christopherson's avatar Sean Christopherson Committed by Marc Zyngier
Browse files

KVM: arm64: 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-

Note, the same bug was fixed in x86 by commit bcda70c5 ("KVM: x86:
Explicitly treat routing entry type changes as changes").

Fixes: 4bf3693d ("KVM: arm64: Unmap vLPIs affected by changes to GSI routing information")
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Reviewed-by: default avatarOliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20250611224604.313496-3-seanjc@google.com


Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
parent 8a8ff069
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2764,7 +2764,8 @@ void kvm_arch_irq_bypass_del_producer(struct irq_bypass_consumer *cons,
bool kvm_arch_irqfd_route_changed(struct kvm_kernel_irq_routing_entry *old,
				  struct kvm_kernel_irq_routing_entry *new)
{
	if (new->type != KVM_IRQ_ROUTING_MSI)
	if (old->type != KVM_IRQ_ROUTING_MSI ||
	    new->type != KVM_IRQ_ROUTING_MSI)
		return true;

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