]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up queue-5.10/kvm-don-t-clobber-irqfd-routing-type-when-deassigning-irqfd.patch
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Feb 2026 12:09:56 +0000 (13:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Feb 2026 12:09:56 +0000 (13:09 +0100)
queue-5.10/kvm-don-t-clobber-irqfd-routing-type-when-deassigning-irqfd.patch

index a5126964e944023899448440dcee0a62e0f26232..8b87d0ec442a6908d4b445a49017af779fa3a29a 100644 (file)
@@ -122,12 +122,12 @@ Link: https://patch.msgid.link/20260113174606.104978-2-seanjc@google.com
 Signed-off-by: Sean Christopherson <seanjc@google.com>
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
- virt/kvm/eventfd.c |   44 ++++++++++++++++++++++++--------------------
- 1 file changed, 24 insertions(+), 20 deletions(-)
+ virt/kvm/eventfd.c |   34 ++++++++++++++--------------------
+ 1 file changed, 14 insertions(+), 20 deletions(-)
 
 --- a/virt/kvm/eventfd.c
 +++ b/virt/kvm/eventfd.c
-@@ -147,21 +147,28 @@ irqfd_shutdown(struct work_struct *work)
+@@ -147,21 +147,18 @@ irqfd_shutdown(struct work_struct *work)
  }
  
  
@@ -136,16 +136,6 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -irqfd_is_active(struct kvm_kernel_irqfd *irqfd)
 +static bool irqfd_is_active(struct kvm_kernel_irqfd *irqfd)
  {
-+      /*
-+       * Assert that either irqfds.lock or SRCU is held, as irqfds.lock must
-+       * be held to prevent false positives (on the irqfd being active), and
-+       * while false negatives are impossible as irqfds are never added back
-+       * to the list once they're deactivated, the caller must at least hold
-+       * SRCU to guard against routing changes if the irqfd is deactivated.
-+       */
-+      lockdep_assert_once(lockdep_is_held(&irqfd->kvm->irqfds.lock) ||
-+                          srcu_read_lock_held(&irqfd->kvm->irq_srcu));
-+
        return list_empty(&irqfd->list) ? false : true;
  }
  
@@ -163,7 +153,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        BUG_ON(!irqfd_is_active(irqfd));
  
        list_del_init(&irqfd->list);
-@@ -198,8 +205,15 @@ irqfd_wakeup(wait_queue_entry_t *wait, u
+@@ -198,8 +195,15 @@ irqfd_wakeup(wait_queue_entry_t *wait, u
                        seq = read_seqcount_begin(&irqfd->irq_entry_sc);
                        irq = irqfd->irq_entry;
                } while (read_seqcount_retry(&irqfd->irq_entry_sc, seq));
@@ -181,7 +171,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
                                              KVM_USERSPACE_IRQ_SOURCE_ID, 1,
                                              false) == -EWOULDBLOCK)
                        schedule_work(&irqfd->inject);
-@@ -536,18 +550,8 @@ kvm_irqfd_deassign(struct kvm *kvm, stru
+@@ -536,18 +540,8 @@ kvm_irqfd_deassign(struct kvm *kvm, stru
        spin_lock_irq(&kvm->irqfds.lock);
  
        list_for_each_entry_safe(irqfd, tmp, &kvm->irqfds.items, list) {