iommu: Pass domain to remove_dev_pasid() op
authorYi Liu <yi.l.liu@intel.com>
Thu, 28 Mar 2024 12:29:58 +0000 (05:29 -0700)
committerJoerg Roedel <jroedel@suse.de>
Fri, 12 Apr 2024 10:13:01 +0000 (12:13 +0200)
commitd2f85a263883b679f87ed8f911746105658e9c47
tree58d21b3942f962508b82184780babb7d6397f93c
parentb025dea63cded0d82bccd591fa105d39efc6435d
iommu: Pass domain to remove_dev_pasid() op

Existing remove_dev_pasid() callbacks of the underlying iommu drivers
get the attached domain from the group->pasid_array. However, the domain
stored in group->pasid_array is not always correct in all scenarios.
A wrong domain may result in failure in remove_dev_pasid() callback.
To avoid such problems, it is more reliable to pass the domain to the
remove_dev_pasid() op.

Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20240328122958.83332-3-yi.l.liu@intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
drivers/iommu/intel/iommu.c
drivers/iommu/iommu.c
include/linux/iommu.h