All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] hw/riscv: iommu: Support automatic PTE A/D updates
@ 2026-11-13 15:12 Tan Chi
  2026-11-13 15:12 ` [PATCH v2 1/3] hw/riscv: iommu: Fix implicit G-stage page-table accesses Tan Chi
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Tan Chi @ 2026-11-13 15:12 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-riscv, palmer, alistair.francis, liwei1518, daniel.barboza,
	zhiwei_liu, chao.liu, pierrick.bouvier, nutty.liu, Tan Chi

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.

---
Changes in v2:
- Set iotval2 to zero for S-stage page faults, as suggested by
  Daniel Henrique Barboza.
- Avoid duplicate implicit_read calculations, as suggested by Nutty Liu.
- Document the new amo-hwad device property.

v1: https://lore.kernel.org/qemu-devel/20261108143934.129923-1-tanchi25@mails.ucas.ac.cn/

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

 docs/specs/riscv-iommu.rst |   2 +
 hw/riscv/riscv-iommu.c     | 254 +++++++++++++++++++++++++++++++++----
 hw/riscv/riscv-iommu.h     |   1 +
 3 files changed, 232 insertions(+), 25 deletions(-)

-- 
2.53.0



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-24 19:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13 15:12 [PATCH v2 0/3] hw/riscv: iommu: Support automatic PTE A/D updates Tan Chi
2026-11-13 15:12 ` [PATCH v2 1/3] hw/riscv: iommu: Fix implicit G-stage page-table accesses Tan Chi
2026-11-13 15:12 ` [PATCH v2 2/3] hw/riscv: iommu: Check permissions on IOATC hits Tan Chi
2026-11-13 15:12 ` [PATCH v2 3/3] hw/riscv: iommu: Support automatic PTE A/D updates Tan Chi
2026-11-17 14:30 ` [PATCH v2 0/3] " Gong Shuai
2026-11-18 14:40   ` Tan Chi
2026-11-23 19:58   ` Daniel Henrique Barboza
2026-11-24  5:18     ` Gong Shuai
2026-11-24 19:58       ` Daniel Henrique Barboza

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.