iommufd: Add iommufd_group
authorJason Gunthorpe <jgg@nvidia.com>
Mon, 17 Jul 2023 18:11:58 +0000 (15:11 -0300)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 26 Jul 2023 13:19:17 +0000 (10:19 -0300)
commit3a3329a7f14a7a0a8c30a12c7ed9f1f77f8efaa1
treebea1c4cadc8190195492d2635c8eac81590fabfc
parentd525a5b8cf39791b47a3d61b36dcb43e1d6fbde8
iommufd: Add iommufd_group

When the hwpt to device attachment is fairly static we could get away with
the simple approach of keeping track of the groups via a device list. But
with replace this is infeasible.

Add an automatically managed struct that is 1:1 with the iommu_group
per-ictx so we can store the necessary tracking information there.

Link: https://lore.kernel.org/r/2-v8-6659224517ea+532-iommufd_alloc_jgg@nvidia.com
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommufd/device.c
drivers/iommu/iommufd/iommufd_private.h
drivers/iommu/iommufd/main.c