Devicetree
 help / color / mirror / Atom feed
* [PATCH v3 0/3] riscv: support effective hardware PTE A/D updates
@ 2026-06-09 13:00 Yunhui Cui
  2026-06-09 13:00 ` [PATCH v3 1/3] dt-bindings: riscv: clarify Svadu boot-time behavior Yunhui Cui
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Yunhui Cui @ 2026-06-09 13:00 UTC (permalink / raw)
  To: akpm, alex, andrew+kernel, aou, apatel, apopple, atishp,
	baolin.wang, cleger, conor+dt, cuiyunhui, debug, devicetree,
	guodong, hui.wang, krzk+dt, linux-kernel, linux-riscv,
	liu.xuemei1, namcao, nick.hu, palmer, pincheng.plct, pjw,
	qingwei.hu, ritesh.list, rmclure, robh, wangruikang, zhangchunyan,
	zong.li

This series makes RISC-V track hardware PTE A/D updating by the
effective runtime state instead of treating Svadu discovery alone as
enough.

When both Svade and Svadu are present, Svadu is disabled at boot and
must be enabled through SBI FWFT.  The series enables FWFT PTE A/D
hardware updating on all currently online CPUs before enabling the
global static key, and enables it for later hotplug CPUs early in
smp_callin(), before they are marked online.  If FWFT setup fails, the
kernel falls back to software-managed A/D updates.

It also makes live PTE access/permission updates use cmpxchg-based
merges so that software updates do not lose concurrently
hardware-updated accessed, dirty, or soft-dirty state.

Changes since v2:
- Split the devicetree binding clarification into a separate patch.
- Avoid CPUHP_AP_ONLINE_DYN for FWFT setup; enable FWFT for current
  online CPUs during init and for hotplug CPUs early in smp_callin().
- Export riscv_hw_pte_ad_updating for modular KVM.
- Preserve _PAGE_SOFT_DIRTY together with A/D bits and rename the helper
  variable to avoid implying only hardware bits are preserved.

Yunhui Cui (3):
  dt-bindings: riscv: clarify Svadu boot-time behavior
  riscv: track effective hardware PTE A/D updating
  riscv: preserve A/D and soft-dirty state across PTE updates

 .../devicetree/bindings/riscv/extensions.yaml |  6 +-
 arch/riscv/include/asm/cpufeature.h           |  8 ++
 arch/riscv/include/asm/pgtable.h              | 27 ++++--
 arch/riscv/kernel/cpufeature.c                | 89 +++++++++++++++++--
 arch/riscv/kernel/smpboot.c                   |  4 +
 arch/riscv/mm/pgtable.c                       | 68 +++++++++++---
 6 files changed, 175 insertions(+), 27 deletions(-)

-- 
2.39.5

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

end of thread, other threads:[~2026-06-09 16:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 13:00 [PATCH v3 0/3] riscv: support effective hardware PTE A/D updates Yunhui Cui
2026-06-09 13:00 ` [PATCH v3 1/3] dt-bindings: riscv: clarify Svadu boot-time behavior Yunhui Cui
2026-06-09 16:08   ` Conor Dooley
2026-06-09 13:00 ` [PATCH v3 2/3] riscv: track effective hardware PTE A/D updating Yunhui Cui
2026-06-09 13:16   ` sashiko-bot
2026-06-09 13:00 ` [PATCH v3 3/3] riscv: preserve A/D and soft-dirty state across PTE updates Yunhui Cui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox