linux/arch/riscv/kvm
Sean Christopherson 2031f28768 KVM: Add helpers to wrap vcpu->srcu_idx and yell if it's abused
Add wrappers to acquire/release KVM's SRCU lock when stashing the index
in vcpu->src_idx, along with rudimentary detection of illegal usage,
e.g. re-acquiring SRCU and thus overwriting vcpu->src_idx.  Because the
SRCU index is (currently) either 0 or 1, illegal nesting bugs can go
unnoticed for quite some time and only cause problems when the nested
lock happens to get a different index.

Wrap the WARNs in PROVE_RCU=y, and make them ONCE, otherwise KVM will
likely yell so loudly that it will bring the kernel to its knees.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Tested-by: Fabiano Rosas <farosas@linux.ibm.com>
Message-Id: <20220415004343.2203171-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-04-21 13:16:11 -04:00
..
Kconfig riscv: do not select non-existing config ANON_INODES 2021-10-22 05:53:37 -04:00
main.c KVM: RISC-V: Avoid spurious virtual interrupts after clearing hideleg CSR 2022-01-06 15:18:18 +05:30
Makefile RISC-V: KVM: Add SBI HSM extension in KVM 2022-01-06 15:12:47 +05:30
mmu.c RISC-V: Do not use cpumask data structure for hartid bitmap 2022-01-20 09:27:22 -08:00
tlb.S RISC-V: KVM: Fix GPA passed to __kvm_riscv_hfence_gvma_xyz() functions 2021-10-31 02:45:43 -04:00
vcpu_exit.c KVM: Add helpers to wrap vcpu->srcu_idx and yell if it's abused 2022-04-21 13:16:11 -04:00
vcpu_fp.c RISC-V: KVM: include missing hwcap.h into vcpu_fp 2022-04-09 09:16:00 +05:30
vcpu_sbi_base.c RISC-V: KVM: Fix SBI implementation version 2022-02-02 18:58:06 +05:30
vcpu_sbi_hsm.c RISC-V: KVM: Implement SBI HSM suspend call 2022-03-11 19:02:39 +05:30
vcpu_sbi_replace.c RISC-V: KVM: Implement SBI v0.3 SRST extension 2022-03-11 19:02:31 +05:30
vcpu_sbi_v01.c RISC-V: KVM: Add common kvm_riscv_vcpu_sbi_system_reset() function 2022-03-11 19:02:29 +05:30
vcpu_sbi.c RISC-V: KVM: Implement SBI v0.3 SRST extension 2022-03-11 19:02:31 +05:30
vcpu_switch.S RISC-V: KVM: Refine __kvm_riscv_switch_to() implementation 2022-03-11 19:02:22 +05:30
vcpu_timer.c RISC-V: KVM: remove unneeded semicolon 2021-11-01 17:35:13 +05:30
vcpu.c KVM: Add helpers to wrap vcpu->srcu_idx and yell if it's abused 2022-04-21 13:16:11 -04:00
vm.c RISC-V: KVM: Add VM capability to allow userspace get GPA bits 2022-01-06 15:16:58 +05:30
vmid.c RISC-V: Do not use cpumask data structure for hartid bitmap 2022-01-20 09:27:22 -08:00