[PATCH 2/2] iommupt: Encode IOMMU_MMIO/IOMMU_CACHE via RISC-V Svpbmt bits

Nutty.Liu nutty.liu at hotmail.com
Sun Apr 12 20:23:50 PDT 2026


On 4/11/2026 10:22 AM, fangyu.yu at linux.alibaba.com wrote:
> From: Fangyu Yu <fangyu.yu at linux.alibaba.com>
>
> When the RISC-V IOMMU page table format support Svpbmt, PBMT provides
> a way to tag mappings with page-based memory types. Encode memory type
> via PBMT in RISC-V IOMMU PTEs:
>
>    - IOMMU_MMIO   -> PBMT=IO
>    - !IOMMU_CACHE -> PBMT=NC
>    - otherwise    -> PBMT=Normal (PBMT=0)
>
> Clear the PBMT field before applying the selected encoding, and only
> touch PBMT when PT_FEAT_RISCV_SVPBMT is advertised.
>
> Signed-off-by: Fangyu Yu <fangyu.yu at linux.alibaba.com>
> ---
>   drivers/iommu/generic_pt/fmt/riscv.h | 9 +++++++++
>   1 file changed, 9 insertions(+)
Reviewed-by: Nutty Liu <nutty.liu at hotmail.com>

Thanks,
Nutty



More information about the linux-riscv mailing list