]> git.baikalelectronics.ru Git - kernel.git/commit
vfio: Hold a reference to the iommu_group in kvm for SPAPR
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 7 Oct 2022 14:04:40 +0000 (11:04 -0300)
committerAlex Williamson <alex.williamson@redhat.com>
Fri, 7 Oct 2022 14:10:52 +0000 (08:10 -0600)
commit512f298cadb64f2dde761f9c86f3dff215a2f22f
treefc3283e491af7b4d68a6fdc4e9fb0e32fa14b3f6
parent5f24c267a1213f3d88434425cb9116dc1455ba0e
vfio: Hold a reference to the iommu_group in kvm for SPAPR

SPAPR exists completely outside the normal iommu driver framework, the
groups it creates are fake and are only created to enable VFIO's uAPI.

Thus, it does not need to follow the iommu core rule that the iommu_group
will only be touched while a driver is attached.

Carry a group reference into KVM and have KVM directly manage the lifetime
of this object independently of VFIO. This means KVM no longer relies on
the vfio group file being valid to maintain the group reference.

Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/2-v2-15417f29324e+1c-vfio_group_disassociate_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio_main.c
virt/kvm/vfio.c