Commit 60ffc450 authored by Lu Baolu's avatar Lu Baolu Committed by Will Deacon

vfio/type1: Use iommu_paging_domain_alloc()

Replace iommu_domain_alloc() with iommu_paging_domain_alloc().
Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20240610085555.88197-4-baolu.lu@linux.intel.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
parent 26a58160
...@@ -2135,7 +2135,7 @@ static int vfio_iommu_domain_alloc(struct device *dev, void *data) ...@@ -2135,7 +2135,7 @@ static int vfio_iommu_domain_alloc(struct device *dev, void *data)
{ {
struct iommu_domain **domain = data; struct iommu_domain **domain = data;
*domain = iommu_domain_alloc(dev->bus); *domain = iommu_paging_domain_alloc(dev);
return 1; /* Don't iterate */ return 1; /* Don't iterate */
} }
...@@ -2192,11 +2192,12 @@ static int vfio_iommu_type1_attach_group(void *iommu_data, ...@@ -2192,11 +2192,12 @@ static int vfio_iommu_type1_attach_group(void *iommu_data,
* us a representative device for the IOMMU API call. We don't actually * us a representative device for the IOMMU API call. We don't actually
* want to iterate beyond the first device (if any). * want to iterate beyond the first device (if any).
*/ */
ret = -EIO;
iommu_group_for_each_dev(iommu_group, &domain->domain, iommu_group_for_each_dev(iommu_group, &domain->domain,
vfio_iommu_domain_alloc); vfio_iommu_domain_alloc);
if (!domain->domain) if (IS_ERR(domain->domain)) {
ret = PTR_ERR(domain->domain);
goto out_free_domain; goto out_free_domain;
}
if (iommu->nesting) { if (iommu->nesting) {
ret = iommu_enable_nesting(domain->domain); ret = iommu_enable_nesting(domain->domain);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment