diff options
| author | Jinyu Tang <tjytimi@163.com> | 2026-05-17 18:34:23 +0300 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2026-06-03 15:49:53 +0300 |
| commit | 9090ba2e7cf8bf8a54879182db5665452d515bb0 (patch) | |
| tree | ee5806e9331fa414a9e96ab8db3e8997e88c6400 /scripts/checkstack.pl | |
| parent | c70faabb6ddd06327ae778bf4f9b5b977749b315 (diff) | |
| download | linux-9090ba2e7cf8bf8a54879182db5665452d515bb0.tar.xz | |
KVM: riscv: Rely on common MMU notifier locking
The common KVM invalidation paths call kvm_unmap_gfn_range() with
mmu_lock already held for write.
For the standard MMU notifier path, the call chain is:
kvm_mmu_notifier_invalidate_range_start()
kvm_handle_hva_range()
kvm_unmap_gfn_range()
kvm_mmu_notifier_invalidate_range_start() leaves range.lockless clear.
kvm_handle_hva_range() therefore takes KVM_MMU_LOCK(kvm) before invoking
the handler.
The guest_memfd path has the same locking contract:
__kvm_gmem_invalidate_begin()
kvm_mmu_unmap_gfn_range()
kvm_unmap_gfn_range()
__kvm_gmem_invalidate_begin() explicitly takes KVM_MMU_LOCK(kvm) before
calling kvm_mmu_unmap_gfn_range().
So remove the local trylock and make the common locking contract explicit
with lockdep_assert_held_write() like x86.
Signed-off-by: Jinyu Tang <tjytimi@163.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260517153427.94889-2-tjytimi@163.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'scripts/checkstack.pl')
0 files changed, 0 insertions, 0 deletions
