1

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>
This commit is contained in:
Yi Liu 2024-09-08 04:42:56 -07:00 committed by Jason Gunthorpe
parent d9dfb5e622
commit 79805c1bbb
2 changed files with 1 additions and 1 deletions

View File

@ -3578,6 +3578,7 @@ int iommu_replace_group_handle(struct iommu_group *group,
ret = xa_reserve(&group->pasid_array, IOMMU_NO_PASID, GFP_KERNEL); ret = xa_reserve(&group->pasid_array, IOMMU_NO_PASID, GFP_KERNEL);
if (ret) if (ret)
goto err_unlock; goto err_unlock;
handle->domain = new_domain;
} }
ret = __iommu_group_set_domain(group, new_domain); ret = __iommu_group_set_domain(group, new_domain);

View File

@ -161,7 +161,6 @@ static int __fault_domain_replace_dev(struct iommufd_device *idev,
if (!handle) if (!handle)
return -ENOMEM; return -ENOMEM;
handle->handle.domain = hwpt->domain;
handle->idev = idev; handle->idev = idev;
ret = iommu_replace_group_handle(idev->igroup->group, ret = iommu_replace_group_handle(idev->igroup->group,
hwpt->domain, &handle->handle); hwpt->domain, &handle->handle);