summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Liu <yi.l.liu@intel.com>2024-09-08 04:42:56 -0700
committerJason Gunthorpe <jgg@nvidia.com>2024-09-11 20:14:07 -0300
commit79805c1bbbf9846fe91c16933d64614cbbff1dee (patch)
treeb7fac4d8c54e5eb2b2222bcc597252db8b5f5841
parentd9dfb5e6225a0a99e08dc2a538b0c30a5a9a460c (diff)
downloadlinux-79805c1bbbf9846fe91c16933d64614cbbff1dee.tar.gz
linux-79805c1bbbf9846fe91c16933d64614cbbff1dee.tar.bz2
linux-79805c1bbbf9846fe91c16933d64614cbbff1dee.zip
iommu: Set iommu_attach_handle->domain in core
The IOMMU core sets the iommu_attach_handle->domain for the iommu_attach_group_handle() path, while the iommu_replace_group_handle() sets it on the caller side. Make the two paths aligned on it. Link: https://patch.msgid.link/r/20240908114256.979518-3-yi.l.liu@intel.com Signed-off-by: Yi Liu <yi.l.liu@intel.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
-rw-r--r--drivers/iommu/iommu.c1
-rw-r--r--drivers/iommu/iommufd/fault.c1
2 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index ed6c5cb60c5a..83c8e617a2c5 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -3578,6 +3578,7 @@ int iommu_replace_group_handle(struct iommu_group *group,
ret = xa_reserve(&group->pasid_array, IOMMU_NO_PASID, GFP_KERNEL);
if (ret)
goto err_unlock;
+ handle->domain = new_domain;
}
ret = __iommu_group_set_domain(group, new_domain);
diff --git a/drivers/iommu/iommufd/fault.c b/drivers/iommu/iommufd/fault.c
index df03411c8728..8c8226f0dffd 100644
--- a/drivers/iommu/iommufd/fault.c
+++ b/drivers/iommu/iommufd/fault.c
@@ -161,7 +161,6 @@ static int __fault_domain_replace_dev(struct iommufd_device *idev,
if (!handle)
return -ENOMEM;
- handle->handle.domain = hwpt->domain;
handle->idev = idev;
ret = iommu_replace_group_handle(idev->igroup->group,
hwpt->domain, &handle->handle);