Re: [PATCH] vfio/pci: Use RCU for error/request triggers to avoid circular locking
From: Alex Williamson
Date: Fri Nov 28 2025 - 14:44:57 EST
On Mon, 24 Nov 2025 15:36:22 -0700
Alex Williamson <alex@xxxxxxxxxxx> wrote:
> From: Alex Williamson <alex.williamson@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
> ---
> 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