linux/drivers/iommu/generic_pt/Kconfig
Jason Gunthorpe e71e001271 iommupt: Add the RISC-V page table format
The RISC-V format is a fairly simple 5 level page table not unlike the x86
one. It has optional support for a single contiguous page size of 64k (16
x 4k).

The specification describes a 32-bit format, the general code can support
it via a #define but the iommu side implementation has been left off until
a user comes.

Tested-by: Vincent Chen <vincent.chen@sifive.com>
Acked-by: Paul Walmsley <pjw@kernel.org> # arch/riscv
Reviewed-by: Tomasz Jeznach <tjeznach@rivosinc.com>
Tested-by: Tomasz Jeznach <tjeznach@rivosinc.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2026-03-17 13:14:21 +01:00

91 lines
3.0 KiB
Plaintext

# SPDX-License-Identifier: GPL-2.0-only
menuconfig GENERIC_PT
bool "Generic Radix Page Table" if COMPILE_TEST
help
Generic library for building radix tree page tables.
Generic PT provides a set of HW page table formats and a common
set of APIs to work with them.
if GENERIC_PT
config DEBUG_GENERIC_PT
bool "Extra debugging checks for GENERIC_PT"
help
Enable extra run time debugging checks for GENERIC_PT code. This
incurs a runtime cost and should not be enabled for production
kernels.
The kunit tests require this to be enabled to get full coverage.
config IOMMU_PT
tristate "IOMMU Page Tables"
select IOMMU_API
depends on IOMMU_SUPPORT
depends on GENERIC_PT
help
Generic library for building IOMMU page tables
IOMMU_PT provides an implementation of the page table operations
related to struct iommu_domain using GENERIC_PT. It provides a single
implementation of the page table operations that can be shared by
multiple drivers.
if IOMMU_PT
config IOMMU_PT_AMDV1
tristate "IOMMU page table for 64-bit AMD IOMMU v1"
depends on !GENERIC_ATOMIC64 # for cmpxchg64
help
iommu_domain implementation for the AMD v1 page table. AMDv1 is the
"host" page table. It supports granular page sizes of almost every
power of 2 and decodes the full 64-bit IOVA space.
Selected automatically by an IOMMU driver that uses this format.
config IOMMU_PT_VTDSS
tristate "IOMMU page table for Intel VT-d Second Stage"
depends on !GENERIC_ATOMIC64 # for cmpxchg64
help
iommu_domain implementation for the Intel VT-d's 64 bit 3/4/5
level Second Stage page table. It is similar to the X86_64 format with
4K/2M/1G page sizes.
Selected automatically by an IOMMU driver that uses this format.
config IOMMU_PT_RISCV64
tristate "IOMMU page table for RISC-V 64 bit Sv57/Sv48/Sv39"
depends on !GENERIC_ATOMIC64 # for cmpxchg64
help
iommu_domain implementation for RISC-V 64 bit 3/4/5 level page table.
It supports 4K/2M/1G/512G/256T page sizes and can decode a sign
extended portion of the 64 bit IOVA space.
Selected automatically by an IOMMU driver that uses this format.
config IOMMU_PT_X86_64
tristate "IOMMU page table for x86 64-bit, 4/5 levels"
depends on !GENERIC_ATOMIC64 # for cmpxchg64
help
iommu_domain implementation for the x86 64-bit 4/5 level page table.
It supports 4K/2M/1G page sizes and can decode a sign-extended
portion of the 64-bit IOVA space.
Selected automatically by an IOMMU driver that uses this format.
config IOMMU_PT_KUNIT_TEST
tristate "IOMMU Page Table KUnit Test" if !KUNIT_ALL_TESTS
depends on KUNIT
depends on IOMMU_PT_AMDV1 || !IOMMU_PT_AMDV1
depends on IOMMU_PT_RISCV64 || !IOMMU_PT_RISCV64
depends on IOMMU_PT_X86_64 || !IOMMU_PT_X86_64
depends on IOMMU_PT_VTDSS || !IOMMU_PT_VTDSS
default KUNIT_ALL_TESTS
help
Enable kunit tests for GENERIC_PT and IOMMU_PT that covers all the
enabled page table formats. The test covers most of the GENERIC_PT
functions provided by the page table format, as well as covering the
iommu_domain related functions.
endif
endif