linux/drivers/vfio/pci
Alex Williamson addbb8ddb4 vfio/pci: Use RCU for error/request triggers to avoid circular locking
[ Upstream commit 98693e0897 ]

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: 3be3a074cf ("vfio-pci: Don't use device_lock around AER interrupt setup")
Signed-off-by: Alex Williamson <alex.williamson@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20251124223623.2770706-1-alex@shazbot.org
Signed-off-by: Alex Williamson <alex@shazbot.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-12-18 14:03:27 +01:00
..
hisilicon hisi_acc_vfio_pci: Fix reference leak in hisi_acc_vfio_debug_init 2025-09-19 14:39:52 -06:00
mlx5 vfio/pci: Do vf_token checks for VFIO_DEVICE_BIND_IOMMUFD 2025-08-05 15:41:14 -06:00
nvgrace-gpu vfio/nvgrace-gpu: Add GB300 SKU to the devid table 2025-09-26 08:38:05 -06:00
pds VFIO updates for v6.18-rc1 2025-10-04 08:24:54 -07:00
qat vfio/qat: add support for intel QAT 6xxx virtual functions 2025-08-05 15:41:18 -06:00
virtio vfio/pci: drop nth_page() usage within SG entry 2025-09-21 14:22:08 -07:00
Kconfig PCI: Add CONFIG_MMU dependency 2025-04-23 15:40:30 -05:00
Makefile vfio/qat: Add vfio_pci driver for Intel QAT SR-IOV VF devices 2024-04-29 13:25:41 -06:00
trace.h vfio/pci: Cleanup license mess 2019-01-22 11:06:05 -07:00
vfio_pci.c vfio/pci: Do vf_token checks for VFIO_DEVICE_BIND_IOMMUFD 2025-08-05 15:41:14 -06:00
vfio_pci_config.c vfio/pci: Virtualize zero INTx PIN if no pdev->irq 2025-04-14 08:31:45 -06:00
vfio_pci_core.c vfio/pci: Use RCU for error/request triggers to avoid circular locking 2025-12-18 14:03:27 +01:00
vfio_pci_igd.c vfio/pci: Use pci_is_display() 2025-07-17 15:30:13 -05:00
vfio_pci_intrs.c vfio/pci: Use RCU for error/request triggers to avoid circular locking 2025-12-18 14:03:27 +01:00
vfio_pci_priv.h vfio/pci: Use RCU for error/request triggers to avoid circular locking 2025-12-18 14:03:27 +01:00
vfio_pci_rdwr.c vfio/pci: Expose setup ROM at ROM bar when needed 2025-01-06 08:09:54 -07:00
vfio_pci_zdev.c Merge remote-tracking branch 'mlx5/mlx5-vfio' into v6.1/vfio/next 2022-09-08 10:44:34 -06:00