diff options
| author | Jinyu Tang <tjytimi@163.com> | 2026-05-17 23:34:24 +0800 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2026-06-03 18:19:55 +0530 |
| commit | cc98f006c63c8e9f825ca5f89388fe5ace6a5c74 (patch) | |
| tree | 248b14f8106e8a142c31b6aac7e8bab469642de2 /arch/riscv/include/asm | |
| parent | 9090ba2e7cf8bf8a54879182db5665452d515bb0 (diff) | |
| download | linux-next-cc98f006c63c8e9f825ca5f89388fe5ace6a5c74.tar.gz linux-next-cc98f006c63c8e9f825ca5f89388fe5ace6a5c74.zip | |
KVM: riscv: Use an rwlock for mmu_lock
RISC-V KVM currently uses a spinlock for mmu_lock. That serializes all
G-stage MMU operations, including permission-only updates that do not
allocate or free page-table pages.
Use KVM's rwlock form of mmu_lock, as x86 and arm64 already do. Keep the
existing map, unmap and teardown paths on the write side. This prepares
RISC-V for read-side handling of G-stage permission updates.
Signed-off-by: Jinyu Tang <tjytimi@163.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260517153427.94889-3-tjytimi@163.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'arch/riscv/include/asm')
| -rw-r--r-- | arch/riscv/include/asm/kvm_host.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/kvm_host.h b/arch/riscv/include/asm/kvm_host.h index 75b0a951c1bc..60017ceec9d2 100644 --- a/arch/riscv/include/asm/kvm_host.h +++ b/arch/riscv/include/asm/kvm_host.h @@ -48,6 +48,8 @@ #define __KVM_HAVE_ARCH_FLUSH_REMOTE_TLBS_RANGE +#define KVM_HAVE_MMU_RWLOCK + #define KVM_DIRTY_LOG_MANUAL_CAPS (KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE | \ KVM_DIRTY_LOG_INITIALLY_SET) |
