kernel_samsung_a53x/drivers/vfio
Alex Williamson 0bc626cda3 vfio/pci: Lock external INTx masking ops
[ Upstream commit 810cd4bb53456d0503cc4e7934e063835152c1b7 ]

Mask operations through config space changes to DisINTx may race INTx
configuration changes via ioctl.  Create wrappers that add locking for
paths outside of the core interrupt code.

In particular, irq_type is updated holding igate, therefore testing
is_intx() requires holding igate.  For example clearing DisINTx from
config space can otherwise race changes of the interrupt configuration.

This aligns interfaces which may trigger the INTx eventfd into two
camps, one side serialized by igate and the other only enabled while
INTx is configured.  A subsequent patch introduces synchronization for
the latter flows.

Cc:  <stable@vger.kernel.org>
Fixes: 89e1f7d4c66d ("vfio: Add PCI device driver")
Reported-by: Reinette Chatre <reinette.chatre@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/20240308230557.805580-3-alex.williamson@redhat.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-19 09:22:45 +01:00
..
fsl-mc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mdev Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pci vfio/pci: Lock external INTx masking ops 2024-11-19 09:22:45 +01:00
platform vfio/platform: Disable virqfds on cleanup 2024-11-19 09:22:35 +01:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vfio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vfio_iommu_spapr_tce.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vfio_iommu_type1.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vfio_spapr_eeh.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
virqfd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00