On 3/8/23 8:35 AM, Jason Gunthorpe wrote:
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.
Signed-off-by: Jason Gunthorpejgg@nvidia.com
The iommufd_get_group() helper looks long. I went through it carefully and didn't find any problems. However, is it possible to add a mutex in ictx to protect the group array? Can it be simpler?
either way,
Reviewed-by: Lu Baolu baolu.lu@linux.intel.com
Best regards, baolu