linux-stable/drivers/vfio
Jason Gunthorpe 3dd59a7dcb vfio: Make the group FD disassociate from the iommu_group
Allow the vfio_group struct to exist with a NULL iommu_group pointer. When
the pointer is NULL the vfio_group users promise not to touch the
iommu_group. This allows a driver to be hot unplugged while userspace is
keeping the group FD open.

Remove all the code waiting for the group FD to close.

This fixes a userspace regression where we learned that virtnodedevd
leaves a group FD open even though the /dev/ node for it has been deleted
and all the drivers for it unplugged.

Fixes: ca5f21b257 ("vfio: Follow a strict lifetime for struct iommu_group")
Reported-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Tested-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/3-v2-15417f29324e+1c-vfio_group_disassociate_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2022-10-07 08:10:52 -06:00
..
fsl-mc vfio/fsl-mc: Use the new device life cycle helpers 2022-09-21 14:15:11 -06:00
mdev vfio/mdev: add mdev available instance checking to the core 2022-10-04 12:06:58 -06:00
pci vfio: Add vfio_file_is_group() 2022-10-07 08:10:52 -06:00
platform vfio/amba: Use the new device life cycle helpers 2022-09-21 14:15:11 -06:00
container.c vfio: Change vfio_group->group_rwsem to a mutex 2022-10-04 12:06:58 -06:00
iova_bitmap.c vfio: Add an IOVA bitmap support 2022-09-08 12:59:00 -06:00
Kconfig vfio: Introduce the DMA logging feature support 2022-09-08 12:59:00 -06:00
Makefile vfio: Move container code into drivers/vfio/container.c 2022-09-22 15:46:06 -06:00
vfio.h vfio: Make the group FD disassociate from the iommu_group 2022-10-07 08:10:52 -06:00
vfio_iommu_spapr_tce.c vfio/spapr_tce: Fix the comment 2022-07-22 16:24:47 -06:00
vfio_iommu_type1.c vfio: Replace phys_pfn with pages for vfio_pin_pages() 2022-07-25 13:41:22 -06:00
vfio_main.c vfio: Make the group FD disassociate from the iommu_group 2022-10-07 08:10:52 -06:00
vfio_spapr_eeh.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
virqfd.c vfio/virqfd: Drain events from eventfd in virqfd_wakeup() 2020-11-15 09:49:10 -05:00