[PATCH v3 0/5] Convert riscv to use the generic iommu page table
Tomasz Jeznach
tjeznach at rivosinc.com
Sun Feb 1 22:01:55 PST 2026
On Fri, Jan 30, 2026 at 4:00 PM Jason Gunthorpe <jgg at nvidia.com> wrote:
>
> [ Joerg, I think we are good now, please pick it up this cycle ]
>
> This is a fairly straightforward conversion of the RISC-V iommu driver to
> use the now merged generic iommu page table code.
>
> It brings support for SVNAPOT which is a 64K contiguous page. Otherwise it
> should not change the behavior.
>
> The series disables SADE as the dirty tracking support is not implemented
> in the driver and should be done somewhat differently. The generic code
> gets further along though this does not include the format implementation
> of read and clear dirty.
>
> The format implementation should be able to support the 32 bit option, but
> this does not enable the iommu implementation as there seems to be no user
> today.
>
> It looks like RISCV could support the DYNAMIC_TOP option. It would require
> some additional work on the core side to interact safely with SIGN_EXTEND.
>
> This is on github: https://github.com/jgunthorpe/linux/commits/iommu_pt_riscv
>
> v3:
> - Rebase to v6.19-rc7
> - Add missed line in Kconfig
> v2: https://patch.msgid.link/r/0-v2-b11ebca8abb6+c096-iommu_pt_riscv_jgg@nvidia.com
> - Rebase to v6.19-rc1
> - Fix typo in PT_FEAT_RISCV_SVNAPOT_64K
> v1: https://patch.msgid.link/r/0-v1-d3317b0ee398+50-iommu_pt_riscv_jgg@nvidia.com
>
> Jason Gunthorpe (5):
> iommupt: Add the RISC-V page table format
> iommu/riscv: Disable SADE
> iommu/riscv: Use the generic iommu page table
> iommu/riscv: Enable SVNAPOT support for contiguous ptes
> iommu/riscv: Allow RISC_VIOMMU to COMPILE_TEST
>
> drivers/iommu/generic_pt/.kunitconfig | 1 +
> drivers/iommu/generic_pt/Kconfig | 11 +
> drivers/iommu/generic_pt/fmt/Makefile | 2 +
> drivers/iommu/generic_pt/fmt/defs_riscv.h | 29 ++
> drivers/iommu/generic_pt/fmt/iommu_riscv64.c | 11 +
> drivers/iommu/generic_pt/fmt/riscv.h | 313 +++++++++++++++++++
> drivers/iommu/riscv/Kconfig | 8 +-
> drivers/iommu/riscv/iommu-bits.h | 4 +-
> drivers/iommu/riscv/iommu.c | 302 +++---------------
> include/linux/generic_pt/common.h | 16 +
> include/linux/generic_pt/iommu.h | 11 +
> 11 files changed, 447 insertions(+), 261 deletions(-)
> create mode 100644 drivers/iommu/generic_pt/fmt/defs_riscv.h
> create mode 100644 drivers/iommu/generic_pt/fmt/iommu_riscv64.c
> create mode 100644 drivers/iommu/generic_pt/fmt/riscv.h
>
>
> base-commit: 63804fed149a6750ffd28610c5c1c98cce6bd377
> --
> 2.43.0
>
Thanks Jason for this change.
All tested, run with NVMe / NICs. No issues. Some minor performance
changes (positive or negative depending on the workload). No issues.
Open issue on QEMU RISC-V IOMMU model - SVNAPOT support is missing.
I've made a local change to fix it, and will post it soon.
Reviewed-by: Tomasz Jeznach <tjeznach at rivosinc.com>
Tested-by: Tomasz Jeznach <tjeznach at rivosinc.com>
Best,
- Tomasz
More information about the linux-riscv
mailing list