Skip to content

Commit 1c93116

Browse files
SiFiveHollandgregkh
authored andcommitted
drivers/perf: riscv: Reset the counter to hpmevent mapping while starting cpus
[ Upstream commit 7dd646c ] 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>
1 parent a88e36e commit 1c93116

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/perf/riscv_pmu_sbi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ static inline void pmu_sbi_stop_all(struct riscv_pmu *pmu)
634634
* which may include counters that are not enabled yet.
635635
*/
636636
sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_STOP,
637-
0, pmu->cmask, 0, 0, 0, 0);
637+
0, pmu->cmask, SBI_PMU_STOP_FLAG_RESET, 0, 0, 0);
638638
}
639639

640640
static inline void pmu_sbi_stop_hw_ctrs(struct riscv_pmu *pmu)

0 commit comments

Comments
 (0)