[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251126195412.GB738503@ziepe.ca>
Date: Wed, 26 Nov 2025 15:54:12 -0400
From: Jason Gunthorpe <jgg@...pe.ca>
To: Alex Williamson <alex@...zbot.org>
Cc: kvm@...r.kernel.org, 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, Nov 24, 2025 at 03:36:22PM -0700, Alex Williamson 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(-)
Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
Jason
Powered by blists - more mailing lists