[PATCH v4 0/3] riscv: support effective hardware PTE A/D updates
Yunhui Cui
cuiyunhui at bytedance.com
Wed Jun 17 23:44:03 PDT 2026
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 v3:
- Keep the only-Svadu binding contract as always enabled, and only
describe the Svade+Svadu boot state as disabled instead of turned-off.
- Detect the need for FWFT from per-CPU Svade state instead of the global
ISA intersection, so asymmetric Svade/Svadu systems do not skip FWFT.
- Document the secondary-hart FWFT bringup state flow in the commit log.
Yunhui Cui (3):
dt-bindings: riscv: describe Svadu as disabled at boot
riscv: track effective hardware PTE A/D updating
riscv: preserve A/D and soft-dirty state across PTE updates
.../devicetree/bindings/riscv/extensions.yaml | 2 +-
arch/riscv/include/asm/cpufeature.h | 8 ++
arch/riscv/include/asm/pgtable.h | 27 +++--
arch/riscv/kernel/cpufeature.c | 101 ++++++++++++++++--
arch/riscv/kernel/smpboot.c | 4 +
arch/riscv/mm/pgtable.c | 68 ++++++++++--
6 files changed, 185 insertions(+), 25 deletions(-)
--
2.39.5
More information about the linux-riscv
mailing list