[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251128124449.37a27d86.alex@shazbot.org>
Date: Fri, 28 Nov 2025 12:44:49 -0700
From: Alex Williamson <alex@...zbot.org>
To: alex@...zbot.org
Cc: kvm@...r.kernel.org, jgg@...pe.ca, kevin.tian@...el.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] vfio/pci: Use RCU for error/request triggers to avoid
circular locking
On Mon, 24 Nov 2025 15:36:22 -0700
Alex Williamson <alex@...zbot.org> wrote:
> From: Alex Williamson <alex.williamson@...dia.com>
>
> Thanks to a device generating an ACS violation during bus reset,
> lockdep reported the following circular locking issue:
>
> CPU0: SET_IRQS (MSI/X): holds igate, acquires memory_lock
> CPU1: HOT_RESET: holds memory_lock, acquires pci_bus_sem
> CPU2: AER: holds pci_bus_sem, acquires igate
>
> This results in a potential 3-way deadlock.
>
> Remove the pci_bus_sem->igate leg of the triangle by using RCU
> to peek at the eventfd rather than locking it with igate.
>
> Fixes: 3be3a074cf5b ("vfio-pci: Don't use device_lock around AER interrupt setup")
> Signed-off-by: Alex Williamson <alex.williamson@...dia.com>
> ---
> drivers/vfio/pci/vfio_pci_core.c | 68 ++++++++++++++++++++++---------
> drivers/vfio/pci/vfio_pci_intrs.c | 52 ++++++++++++++---------
> drivers/vfio/pci/vfio_pci_priv.h | 4 ++
> include/linux/vfio_pci_core.h | 10 ++++-
> 4 files changed, 93 insertions(+), 41 deletions(-)
Applied to vfio next branch for v6.19. Thanks,
Alex
Powered by blists - more mailing lists