Skip to content

Commit 13fbceb

Browse files
jgunthorpejoergroedel
authored andcommitted
iommufd: Convert to alloc_domain_paging()
Move the global static blocked domain to the ops and convert the unmanaged domain to domain_alloc_paging. Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Acked-by: Sven Peter <sven@svenpeter.dev> Link: https://lore.kernel.org/r/4-v2-bff223cf6409+282-dart_paging_jgg@nvidia.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 7d12eb2 commit 13fbceb

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/iommu/iommufd/selftest.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,10 @@ static void *mock_domain_hw_info(struct device *dev, u32 *length, u32 *type)
141141
return info;
142142
}
143143

144-
static struct iommu_domain *mock_domain_alloc(unsigned int iommu_domain_type)
144+
static struct iommu_domain *mock_domain_alloc_paging(struct device *dev)
145145
{
146146
struct mock_iommu_domain *mock;
147147

148-
if (iommu_domain_type == IOMMU_DOMAIN_BLOCKED)
149-
return &mock_blocking_domain;
150-
151-
if (iommu_domain_type != IOMMU_DOMAIN_UNMANAGED)
152-
return NULL;
153-
154148
mock = kzalloc(sizeof(*mock), GFP_KERNEL);
155149
if (!mock)
156150
return NULL;
@@ -295,10 +289,11 @@ static const struct iommu_ops mock_ops = {
295289
* because it is zero.
296290
*/
297291
.default_domain = &mock_blocking_domain,
292+
.blocked_domain = &mock_blocking_domain,
298293
.owner = THIS_MODULE,
299294
.pgsize_bitmap = MOCK_IO_PAGE_SIZE,
300295
.hw_info = mock_domain_hw_info,
301-
.domain_alloc = mock_domain_alloc,
296+
.domain_alloc_paging = mock_domain_alloc_paging,
302297
.capable = mock_domain_capable,
303298
.device_group = generic_device_group,
304299
.probe_device = mock_probe_device,

0 commit comments

Comments
 (0)