Skip to content

Commit 79805c1

Browse files
yiliu1765jgunthorpe
authored andcommitted
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/[email protected] Signed-off-by: Yi Liu <[email protected]> Reviewed-by: Lu Baolu <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent d9dfb5e commit 79805c1

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

drivers/iommu/iommu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3578,6 +3578,7 @@ int iommu_replace_group_handle(struct iommu_group *group,
35783578
ret = xa_reserve(&group->pasid_array, IOMMU_NO_PASID, GFP_KERNEL);
35793579
if (ret)
35803580
goto err_unlock;
3581+
handle->domain = new_domain;
35813582
}
35823583

35833584
ret = __iommu_group_set_domain(group, new_domain);

drivers/iommu/iommufd/fault.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ static int __fault_domain_replace_dev(struct iommufd_device *idev,
161161
if (!handle)
162162
return -ENOMEM;
163163

164-
handle->handle.domain = hwpt->domain;
165164
handle->idev = idev;
166165
ret = iommu_replace_group_handle(idev->igroup->group,
167166
hwpt->domain, &handle->handle);

0 commit comments

Comments
 (0)