Skip to content

Commit 8901812

Browse files
jgunthorpejoergroedel
authored andcommitted
iommu: Remove ops.pgsize_bitmap from drivers that don't use it
These drivers all set the domain->pgsize_bitmap in their domain_alloc_paging() functions, so the ops value is never used. Delete it. Reviewed-by: Sven Peter <[email protected]> # for Apple DART Reviewed-by: Lu Baolu <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Reviewed-by: Tomasz Jeznach <[email protected]> # for RISC-V Signed-off-by: Jason Gunthorpe <[email protected]> Tested-by: Nicolin Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 35145e0 commit 8901812

File tree

5 files changed

+2
-8
lines changed

5 files changed

+2
-8
lines changed

drivers/iommu/apple-dart.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,6 @@ static const struct iommu_ops apple_dart_iommu_ops = {
991991
.of_xlate = apple_dart_of_xlate,
992992
.def_domain_type = apple_dart_def_domain_type,
993993
.get_resv_regions = apple_dart_get_resv_regions,
994-
.pgsize_bitmap = -1UL, /* Restricted during dart probe */
995994
.owner = THIS_MODULE,
996995
.default_domain_ops = &(const struct iommu_domain_ops) {
997996
.attach_dev = apple_dart_attach_dev_paging,

drivers/iommu/intel/iommu.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4365,7 +4365,6 @@ const struct iommu_ops intel_iommu_ops = {
43654365
.device_group = intel_iommu_device_group,
43664366
.is_attach_deferred = intel_iommu_is_attach_deferred,
43674367
.def_domain_type = device_def_domain_type,
4368-
.pgsize_bitmap = SZ_4K,
43694368
.page_response = intel_iommu_page_response,
43704369
.default_domain_ops = &(const struct iommu_domain_ops) {
43714370
.attach_dev = intel_iommu_attach_device,

drivers/iommu/iommufd/selftest.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,6 @@ static const struct iommu_ops mock_ops = {
801801
.default_domain = &mock_blocking_domain,
802802
.blocked_domain = &mock_blocking_domain,
803803
.owner = THIS_MODULE,
804-
.pgsize_bitmap = MOCK_IO_PAGE_SIZE,
805804
.hw_info = mock_domain_hw_info,
806805
.domain_alloc_paging_flags = mock_domain_alloc_paging_flags,
807806
.domain_alloc_nested = mock_domain_alloc_nested,

drivers/iommu/riscv/iommu.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,6 @@ static void riscv_iommu_release_device(struct device *dev)
15331533
}
15341534

15351535
static const struct iommu_ops riscv_iommu_ops = {
1536-
.pgsize_bitmap = SZ_4K,
15371536
.of_xlate = riscv_iommu_of_xlate,
15381537
.identity_domain = &riscv_iommu_identity_domain,
15391538
.blocked_domain = &riscv_iommu_blocking_domain,

drivers/iommu/virtio-iommu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ static void viommu_get_resv_regions(struct device *dev, struct list_head *head)
998998
iommu_dma_get_resv_regions(dev, head);
999999
}
10001000

1001-
static struct iommu_ops viommu_ops;
1001+
static const struct iommu_ops viommu_ops;
10021002
static struct virtio_driver virtio_iommu_drv;
10031003

10041004
static int viommu_match_node(struct device *dev, const void *data)
@@ -1086,7 +1086,7 @@ static bool viommu_capable(struct device *dev, enum iommu_cap cap)
10861086
}
10871087
}
10881088

1089-
static struct iommu_ops viommu_ops = {
1089+
static const struct iommu_ops viommu_ops = {
10901090
.capable = viommu_capable,
10911091
.domain_alloc_identity = viommu_domain_alloc_identity,
10921092
.domain_alloc_paging = viommu_domain_alloc_paging,
@@ -1217,8 +1217,6 @@ static int viommu_probe(struct virtio_device *vdev)
12171217
viommu->first_domain++;
12181218
}
12191219

1220-
viommu_ops.pgsize_bitmap = viommu->pgsize_bitmap;
1221-
12221220
virtio_device_ready(vdev);
12231221

12241222
/* Populate the event queue with buffers */

0 commit comments

Comments
 (0)