]> git.hungrycats.org Git - linux/commit
drivers/perf: riscv: Reset the counter to hpmevent mapping while starting cpus
authorSamuel Holland <samuel.holland@sifive.com>
Fri, 28 Jun 2024 07:51:42 +0000 (00:51 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2024 07:53:39 +0000 (09:53 +0200)
commit1c93116ad8ce63241876f87aedfc0c5237fd8c4a
tree22d48fc8ac69e7042533834117dabfa0d6fe437d
parenta88e36e5761a3e69290a6ae892161a71d2b271ce
drivers/perf: riscv: Reset the counter to hpmevent mapping while starting cpus

[ Upstream commit 7dd646cf745c34d31e7ed2a52265e9ca8308f58f ]

Currently, we stop all the counters while a new cpu is brought online.
However, the hpmevent to counter mappings are not reset. The firmware may
have some stale encoding in their mapping structure which may lead to
undesirable results. We have not encountered such scenario though.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Link: https://lore.kernel.org/r/20240628-misc_perf_fixes-v4-2-e01cfddcf035@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/perf/riscv_pmu_sbi.c