diff options
author | Jason Gunthorpe <jgg@nvidia.com> | 2022-10-07 16:04:41 +0200 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2022-10-07 16:10:52 +0200 |
commit | 3dd59a7dcb97e6e40d6385a1a3faa9392b6d184a (patch) | |
tree | 1e03b6764480252a87cf4264fe3b2541d82684e9 /drivers/vfio/vfio.h | |
parent | vfio: Hold a reference to the iommu_group in kvm for SPAPR (diff) | |
download | linux-3dd59a7dcb97e6e40d6385a1a3faa9392b6d184a.tar.xz linux-3dd59a7dcb97e6e40d6385a1a3faa9392b6d184a.zip |
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: ca5f21b25749 ("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>
Diffstat (limited to 'drivers/vfio/vfio.h')
-rw-r--r-- | drivers/vfio/vfio.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/vfio/vfio.h b/drivers/vfio/vfio.h index 4a1bac1359a9..bcad54bbab08 100644 --- a/drivers/vfio/vfio.h +++ b/drivers/vfio/vfio.h @@ -59,7 +59,6 @@ struct vfio_group { struct mutex group_lock; struct kvm *kvm; struct file *opened_file; - struct swait_queue_head opened_file_wait; struct blocking_notifier_head notifier; }; |