]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iommu: Remove ops.pgsize_bitmap from drivers that don't use it
authorJason Gunthorpe <jgg@nvidia.com>
Mon, 9 Jun 2025 20:41:27 +0000 (17:41 -0300)
committerJoerg Roedel <joerg.roedel@amd.com>
Fri, 27 Jun 2025 06:55:56 +0000 (08:55 +0200)
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>
drivers/iommu/apple-dart.c
drivers/iommu/intel/iommu.c
drivers/iommu/iommufd/selftest.c
drivers/iommu/riscv/iommu.c
drivers/iommu/virtio-iommu.c

index 757d24f67ad45af0080bde79fdb17eccacc7fe6e..190f28d76615159527649cd288df395a50d950ef 100644 (file)
@@ -991,7 +991,6 @@ static const struct iommu_ops apple_dart_iommu_ops = {
        .of_xlate = apple_dart_of_xlate,
        .def_domain_type = apple_dart_def_domain_type,
        .get_resv_regions = apple_dart_get_resv_regions,
-       .pgsize_bitmap = -1UL, /* Restricted during dart probe */
        .owner = THIS_MODULE,
        .default_domain_ops = &(const struct iommu_domain_ops) {
                .attach_dev     = apple_dart_attach_dev_paging,
index 7aa3932251b2fd6d632f5040cac4ba21d474a3f5..68b695953c57ec4936baf31f283446eb8913cf38 100644 (file)
@@ -4365,7 +4365,6 @@ const struct iommu_ops intel_iommu_ops = {
        .device_group           = intel_iommu_device_group,
        .is_attach_deferred     = intel_iommu_is_attach_deferred,
        .def_domain_type        = device_def_domain_type,
-       .pgsize_bitmap          = SZ_4K,
        .page_response          = intel_iommu_page_response,
        .default_domain_ops = &(const struct iommu_domain_ops) {
                .attach_dev             = intel_iommu_attach_device,
index 6bd0abf9a641e29819f49b049b937025aae06589..c52bf037a2f01e0d16d6976ad0f7ca1f93852753 100644 (file)
@@ -801,7 +801,6 @@ static const struct iommu_ops mock_ops = {
        .default_domain = &mock_blocking_domain,
        .blocked_domain = &mock_blocking_domain,
        .owner = THIS_MODULE,
-       .pgsize_bitmap = MOCK_IO_PAGE_SIZE,
        .hw_info = mock_domain_hw_info,
        .domain_alloc_paging_flags = mock_domain_alloc_paging_flags,
        .domain_alloc_nested = mock_domain_alloc_nested,
index bb57092ca901101936008d5ba651635969a08512..2d0d31ba28860ac3f7c03484dbd0af87e8a95371 100644 (file)
@@ -1533,7 +1533,6 @@ static void riscv_iommu_release_device(struct device *dev)
 }
 
 static const struct iommu_ops riscv_iommu_ops = {
-       .pgsize_bitmap = SZ_4K,
        .of_xlate = riscv_iommu_of_xlate,
        .identity_domain = &riscv_iommu_identity_domain,
        .blocked_domain = &riscv_iommu_blocking_domain,
index ecd41fb03e5a515f810a4778481f766cd1bb0935..532db1de201baeccdfd15d72ed8e6717c5b0b9d3 100644 (file)
@@ -998,7 +998,7 @@ static void viommu_get_resv_regions(struct device *dev, struct list_head *head)
        iommu_dma_get_resv_regions(dev, head);
 }
 
-static struct iommu_ops viommu_ops;
+static const struct iommu_ops viommu_ops;
 static struct virtio_driver virtio_iommu_drv;
 
 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)
        }
 }
 
-static struct iommu_ops viommu_ops = {
+static const struct iommu_ops viommu_ops = {
        .capable                = viommu_capable,
        .domain_alloc_identity  = viommu_domain_alloc_identity,
        .domain_alloc_paging    = viommu_domain_alloc_paging,
@@ -1217,8 +1217,6 @@ static int viommu_probe(struct virtio_device *vdev)
                viommu->first_domain++;
        }
 
-       viommu_ops.pgsize_bitmap = viommu->pgsize_bitmap;
-
        virtio_device_ready(vdev);
 
        /* Populate the event queue with buffers */