]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RISC-V: KVM: Disable the kernel perf counter during configure
authorAtish Patra <atishp@rivosinc.com>
Mon, 3 Mar 2025 22:53:06 +0000 (14:53 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:11 +0000 (14:39 +0200)
commitff435a627342fd98feedcf58bbc01f904bbac146
treef81d4cdec387a1dae025eee9b09f69ef21647574
parente2bda794d38112fec91941001ee53500ff6e9f96
RISC-V: KVM: Disable the kernel perf counter during configure

[ Upstream commit bbb622488749478955485765ddff9d56be4a7e4b ]

The perf event should be marked disabled during the creation as
it is not ready to be scheduled until there is SBI PMU start call
or config matching is called with auto start. Otherwise, event add/start
gets called during perf_event_create_kernel_counter function.
It will be enabled and scheduled to run via perf_event_enable during
either the above mentioned scenario.

Fixes: 0cb74b65d2e5 ("RISC-V: KVM: Implement perf support without sampling")
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Link: https://lore.kernel.org/r/20250303-kvm_pmu_improve-v2-1-41d177e45929@rivosinc.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/kvm/vcpu_pmu.c