diff options
| author | Jinyu Tang <tjytimi@163.com> | 2026-05-17 18:34:27 +0300 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2026-06-03 15:50:04 +0300 |
| commit | 7705be59eb2d173933b55608ff7d26e14343e2f3 (patch) | |
| tree | 9d82cce155ae1072dfb7f63d945197ed0aedf329 /scripts/Makefile.thinlto | |
| parent | d7a26a0ba71542c9778d7d802dc79b0874f852bf (diff) | |
| download | linux-7705be59eb2d173933b55608ff7d26e14343e2f3.tar.xz | |
KVM: riscv: Fast-path dirty logging write faults
With dirty logging enabled, guest writes often fault on an existing 4K
G-stage leaf that was write-protected only for dirty tracking. The slow
path still performs the full fault handling flow and takes mmu_lock for
write, even though the page-table shape does not change.
x86 handles the analogous case in its fast page fault path by atomically
making a writable SPTE writable again when the fault is only a
write-protection fault. Add the same style of fast path for RISC-V. If a
write fault hits an existing 4K leaf in a writable dirty-log memslot,
mark the page dirty and atomically set the PTE writable and dirty under
the read side of mmu_lock.
The dirty bitmap is updated before the PTE becomes writable again. The
PTE D bit is also set so systems that trap on a clear D bit do not fall
back to the slow path for a writable but clean PTE.
Signed-off-by: Jinyu Tang <tjytimi@163.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260517153427.94889-6-tjytimi@163.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
