]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RISC-V: KVM: No need of explicit writable slot check
authorAtish Patra <atishp@rivosinc.com>
Tue, 9 Sep 2025 07:03:25 +0000 (00:03 -0700)
committerAnup Patel <anup@brainfault.org>
Tue, 16 Sep 2025 06:19:31 +0000 (11:49 +0530)
commit41f4d0cc331a1e9dc247ce22ae45f983f0ed9054
tree712b7b7ad31062b6d9f4321c793ce5e06a7a2fb7
parent880fcc329e2473ba02ffbc446fcd403972ab1fca
RISC-V: KVM: No need of explicit writable slot check

There is not much value in checking if a memslot is writable explicitly
before a write as it may change underneath after the check. Rather, return
invalid address error when write_guest fails as it checks if the slot
is writable anyways.

Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Acked-by: Paul Walmsley <pjw@kernel.org>
Link: https://lore.kernel.org/r/20250909-pmu_event_info-v6-6-d8f80cacb884@rivosinc.com
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/kvm/vcpu_pmu.c
arch/riscv/kvm/vcpu_sbi_sta.c