Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vfio/type1: Use iommu_paging_domain_alloc()

Replace iommu_domain_alloc() with iommu_paging_domain_alloc().

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20240610085555.88197-4-baolu.lu@linux.intel.com
Signed-off-by: Will Deacon <will@kernel.org>

authored by

Lu Baolu and committed by
Will Deacon
60ffc450 26a58160

+4 -3
+4 -3
drivers/vfio/vfio_iommu_type1.c
··· 2135 2135 { 2136 2136 struct iommu_domain **domain = data; 2137 2137 2138 - *domain = iommu_domain_alloc(dev->bus); 2138 + *domain = iommu_paging_domain_alloc(dev); 2139 2139 return 1; /* Don't iterate */ 2140 2140 } 2141 2141 ··· 2192 2192 * us a representative device for the IOMMU API call. We don't actually 2193 2193 * want to iterate beyond the first device (if any). 2194 2194 */ 2195 - ret = -EIO; 2196 2195 iommu_group_for_each_dev(iommu_group, &domain->domain, 2197 2196 vfio_iommu_domain_alloc); 2198 - if (!domain->domain) 2197 + if (IS_ERR(domain->domain)) { 2198 + ret = PTR_ERR(domain->domain); 2199 2199 goto out_free_domain; 2200 + } 2200 2201 2201 2202 if (iommu->nesting) { 2202 2203 ret = iommu_enable_nesting(domain->domain);