[PATCH v3 00/13] Use the generic iommu page table for SMMUv3
Jason Gunthorpe
jgg at nvidia.com
Sun Nov 15 15:30:30 PST 2026
[ This is the last series to move SMMUv3 over to the generic page
table. The whole branch is here:
https://github.com/jgunthorpe/linux/commits/iommu_pt_arm64/
]
Introduce the generic page table for what the ARM spec calls VMSAv8-64
(ie the long 64 bit PTE page table, io-pgtable-arm.c) and use it for
SMMUv3. ARM is by far the most complex page table of all the ones
implemented, it has the most runtime behavior variations and a lot of
features.
Like the othe architectures, the page table itself is supported by a kunit
compare test that runs operations through both io-pgtable-arm.c and the
new code then checks for identical PTEs. This is on the github link above
but I don't intend to merge it.
The existing kunit tests for iommupt will automatically cover the new
format as well.
This is the final series migrating the SMMUv3 driver over to use the new
functions and remove io-pgtable-arm.c usage. In principle the other iommu
drivers that use io-pgtable-arm could be converted someday as well.
Included is a mitigation for the CONT under invalidation errata, extended
to work with paging domains.
v3:
- Rebase on v7.4-rc2
- Split the armv8 patch into three parts, generic, db, and iommu
- Clarify some comments, mark some more debug things as WARN_ON
- Use tgsz instead of granule for consistency
- Refactor checks into armv8pt_validate_features() and add more
- Drop PT_FEAT_ARMV8_AARCH32
- Fix make dirty logic
- Use arch/arm64 constants instead of copying for SVA
- Mitigate the CONT under invalidation errata
- Pull in the left over two patches from v9 of the precursor series:
https://patch.msgid.link/r/0-v9-e1637b95096d+d83ffe-smmu_tlbi_jgg@nvidia.com
v2: https://patch.msgid.link/r/0-v1-807e2d1a5efb+e1-iommupt_armv8_jgg@nvidia.com
- Rename granule_lg2sz to tgsz_lg2 to represent the ARM translation granule
v1: https://patch.msgid.link/r/0-v1-807e2d1a5efb+e1-iommupt_armv8_jgg@nvidia.com
Jason Gunthorpe (13):
iommu/arm-smmu-v3: Change how the tlbi describes the invalidation
iommu/arm-smmu-v3: Support the DS expansion of range invalidation
SCALE
iommupt: Remove the sanity check for pt_num_items_lg2() at the top
level
iommupt/kunit: Do not test INCOHERENT on anything but x86
iommupt/kunit: Skip test configs without supported features
iommupt/armv8: Add the 64 bit ARMv8 page table format
iommupt/armv8: Add DBM support
iommupt/armv8: Implement the iommu specific components
iommu/arm-smmu-v3: Remove io-pgtable-arm from sva.c
iommu/arm-smmu-v3: Move the DMA API comment to flush_iotlb_all
iommu/arm-smmu-v3: Support CONT in paging domains with errata
iommu/arm-smmu-v3: Use the generic iommu page table
iommu: Remove pgsize from iommu_iotlb_gather
drivers/iommu/arm/Kconfig | 4 +-
.../iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c | 44 +-
.../iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c | 49 +-
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 609 ++++++----
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 49 +-
drivers/iommu/generic_pt/.kunitconfig | 1 +
drivers/iommu/generic_pt/Kconfig | 12 +
drivers/iommu/generic_pt/fmt/Makefile | 2 +
drivers/iommu/generic_pt/fmt/armv8.h | 1076 +++++++++++++++++
drivers/iommu/generic_pt/fmt/defs_armv8.h | 23 +
drivers/iommu/generic_pt/fmt/iommu_armv8.c | 13 +
drivers/iommu/generic_pt/iommu_pt.h | 14 -
drivers/iommu/generic_pt/kunit_iommu.h | 27 +-
include/linux/generic_pt/common.h | 38 +
include/linux/generic_pt/iommu.h | 72 ++
include/linux/iommu.h | 62 +-
16 files changed, 1738 insertions(+), 357 deletions(-)
create mode 100644 drivers/iommu/generic_pt/fmt/armv8.h
create mode 100644 drivers/iommu/generic_pt/fmt/defs_armv8.h
create mode 100644 drivers/iommu/generic_pt/fmt/iommu_armv8.c
base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
--
2.43.0
More information about the linux-arm-kernel
mailing list