This series adds support for automatic updates of page-table accessed (A) and dirty (D) bits in the RISC-V IOMMU, as specified by the RISC-V IOMMU architecture. The feature is advertised through the AMO_HWAD capability and controlled by the SADE and GADE bits in device contexts.
The first two patches fix implicit G-stage page-table access handling and IOATC permission checks. The third patch implements atomic A/D bit updates using CAS, with page-table walk retries on concurrent modifications and G-stage permission checks for implicit writes during nested translation. The implementation has been validated with QTests, Linux DMA tests under KVM and TCG, and concurrency tests covering CAS retries, PTE modifications, and G-stage mapping changes. Tan Chi (3): hw/riscv: iommu: Fix implicit G-stage page-table accesses hw/riscv: iommu: Check permissions on IOATC hits hw/riscv: iommu: Support automatic PTE A/D updates hw/riscv/riscv-iommu.c | 256 +++++++++++++++++++++++++++++++++++++---- hw/riscv/riscv-iommu.h | 1 + 2 files changed, 232 insertions(+), 25 deletions(-) -- 2.53.0
