Skip to content

Commit 7a4c7d8

Browse files
jgunthorpegregkh
authored andcommitted
iommu: Remove ops.pgsize_bitmap from drivers that don't use it
[ Upstream commit 8901812 ] 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 <sven@svenpeter.dev> # for Apple DART Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reviewed-by: Tomasz Jeznach <tjeznach@rivosinc.com> # for RISC-V Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Tested-by: Nicolin Chen <nicolinc@nvidia.com> Link: https://lore.kernel.org/r/3-v2-68a2e1ba507c+1fb-iommu_rm_ops_pgsize_jgg@nvidia.com Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Stable-dep-of: 72b6f7c ("iommu/virtio: Make instance lookup robust") Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f9d5eac commit 7a4c7d8

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
@@ -4390,7 +4390,6 @@ const struct iommu_ops intel_iommu_ops = {
43904390
.device_group = intel_iommu_device_group,
43914391
.is_attach_deferred = intel_iommu_is_attach_deferred,
43924392
.def_domain_type = device_def_domain_type,
4393-
.pgsize_bitmap = SZ_4K,
43944393
.page_response = intel_iommu_page_response,
43954394
.default_domain_ops = &(const struct iommu_domain_ops) {
43964395
.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)