]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: Don't WARN if updating IRQ bypass route fails
authorSean Christopherson <seanjc@google.com>
Wed, 11 Jun 2025 22:45:35 +0000 (15:45 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 23 Jun 2025 16:50:32 +0000 (09:50 -0700)
Don't bother WARNing if updating an IRTE route fails now that vendor code
provides much more precise WARNs.  The generic WARN doesn't provide enough
information to actually debug the problem, and has obviously done nothing
to surface the myriad bugs in KVM x86's implementation.

Drop all of the associated return code plumbing that existed just so that
common KVM could WARN.

Link: https://lore.kernel.org/r/20250611224604.313496-34-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/arm64/kvm/arm.c
arch/arm64/kvm/vgic/vgic-v4.c
arch/x86/kvm/irq.c
include/kvm/arm_vgic.h
include/linux/kvm_host.h
virt/kvm/eventfd.c

index a9a39e0375f7a09c9257f1879898c2d2b24186d3..94fb2f096a2067b49cec56e0b518e4f83b2b6563 100644 (file)
@@ -2771,9 +2771,9 @@ bool kvm_arch_irqfd_route_changed(struct kvm_kernel_irq_routing_entry *old,
        return memcmp(&old->msi, &new->msi, sizeof(new->msi));
 }
 
-int kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
-                                 struct kvm_kernel_irq_routing_entry *old,
-                                 struct kvm_kernel_irq_routing_entry *new)
+void kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
+                                  struct kvm_kernel_irq_routing_entry *old,
+                                  struct kvm_kernel_irq_routing_entry *new)
 {
        /*
         * Remapping the vLPI requires taking the its_lock mutex to resolve
index 911170d4a9c85766a053d11cae78e79d8edb5536..ef3481963122535e1871ac3eef8c519b79573afd 100644 (file)
@@ -527,18 +527,17 @@ static struct vgic_irq *__vgic_host_irq_get_vlpi(struct kvm *kvm, int host_irq)
        return NULL;
 }
 
-int kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int host_irq)
+void kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int host_irq)
 {
        struct vgic_irq *irq;
        unsigned long flags;
-       int ret = 0;
 
        if (!vgic_supports_direct_msis(kvm))
-               return 0;
+               return;
 
        irq = __vgic_host_irq_get_vlpi(kvm, host_irq);
        if (!irq)
-               return 0;
+               return;
 
        raw_spin_lock_irqsave(&irq->irq_lock, flags);
        WARN_ON(irq->hw && irq->host_irq != host_irq);
@@ -550,5 +549,4 @@ int kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int host_irq)
 
        raw_spin_unlock_irqrestore(&irq->irq_lock, flags);
        vgic_put_irq(kvm, irq);
-       return 0;
 }
index cd9b56c6a5c3dc856bdb84fd3bbba4174541e9e1..b7b0fbc218b82f5b0267937653b37ac6d54a037b 100644 (file)
@@ -606,11 +606,11 @@ void kvm_arch_irq_bypass_del_producer(struct irq_bypass_consumer *cons,
        kvm_arch_end_assignment(irqfd->kvm);
 }
 
-int kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
-                                 struct kvm_kernel_irq_routing_entry *old,
-                                 struct kvm_kernel_irq_routing_entry *new)
+void kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
+                                  struct kvm_kernel_irq_routing_entry *old,
+                                  struct kvm_kernel_irq_routing_entry *new)
 {
-       return kvm_pi_update_irte(irqfd, new);
+       kvm_pi_update_irte(irqfd, new);
 }
 
 bool kvm_arch_irqfd_route_changed(struct kvm_kernel_irq_routing_entry *old,
index 4a34f7f0a86488a0bda7cc95916e1a4e47b69a07..b2a04481de1aac03cb5ac74c99137607a74eddc6 100644 (file)
@@ -434,7 +434,7 @@ struct kvm_kernel_irq_routing_entry;
 int kvm_vgic_v4_set_forwarding(struct kvm *kvm, int irq,
                               struct kvm_kernel_irq_routing_entry *irq_entry);
 
-int kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int host_irq);
+void kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int host_irq);
 
 int vgic_v4_load(struct kvm_vcpu *vcpu);
 void vgic_v4_commit(struct kvm_vcpu *vcpu);
index a4160c1c0c6bb99974e9f6e9e3b2421e05eaa3ed..8e74ac0f90b160d8060b1c7288acc0773724c11e 100644 (file)
@@ -2410,9 +2410,9 @@ void kvm_arch_irq_bypass_del_producer(struct irq_bypass_consumer *,
                           struct irq_bypass_producer *);
 void kvm_arch_irq_bypass_stop(struct irq_bypass_consumer *);
 void kvm_arch_irq_bypass_start(struct irq_bypass_consumer *);
-int kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
-                                 struct kvm_kernel_irq_routing_entry *old,
-                                 struct kvm_kernel_irq_routing_entry *new);
+void kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
+                                  struct kvm_kernel_irq_routing_entry *old,
+                                  struct kvm_kernel_irq_routing_entry *new);
 bool kvm_arch_irqfd_route_changed(struct kvm_kernel_irq_routing_entry *,
                                  struct kvm_kernel_irq_routing_entry *);
 #endif /* CONFIG_HAVE_KVM_IRQ_BYPASS */
index bd1766da689585ac6f6891f4392342818ecee3f2..719b242fc9358734842ddd1f98e8e142da884315 100644 (file)
@@ -285,11 +285,11 @@ void __attribute__((weak)) kvm_arch_irq_bypass_start(
 {
 }
 
-int __weak kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
-                                        struct kvm_kernel_irq_routing_entry *old,
-                                        struct kvm_kernel_irq_routing_entry *new)
+void __weak kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
+                                         struct kvm_kernel_irq_routing_entry *old,
+                                         struct kvm_kernel_irq_routing_entry *new)
 {
-       return 0;
+
 }
 
 bool __attribute__((weak)) kvm_arch_irqfd_route_changed(
@@ -617,11 +617,8 @@ void kvm_irq_routing_update(struct kvm *kvm)
 
 #if IS_ENABLED(CONFIG_HAVE_KVM_IRQ_BYPASS)
                if (irqfd->producer &&
-                   kvm_arch_irqfd_route_changed(&old, &irqfd->irq_entry)) {
-                       int ret = kvm_arch_update_irqfd_routing(irqfd, &old, &irqfd->irq_entry);
-
-                       WARN_ON(ret);
-               }
+                   kvm_arch_irqfd_route_changed(&old, &irqfd->irq_entry))
+                       kvm_arch_update_irqfd_routing(irqfd, &old, &irqfd->irq_entry);
 #endif
        }