mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-03-15 19:31:32 +00:00
lib: sbi: Do not clear active_events for cycle/instret when stopping
Those events are enabled by default and should not be reset afterwards since when using SBI_PMU_CFG_FLAG_SKIP_MATCH, it leads to unaccessible counters after the first use. Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Reviewed-by: Atish Patra <atishp@rivosinc.com>
This commit is contained in:
parent
e41dbb507c
commit
bdb3c42bca
1 changed files with 1 additions and 1 deletions
|
@ -532,7 +532,7 @@ int sbi_pmu_ctr_stop(unsigned long cbase, unsigned long cmask,
|
|||
else
|
||||
ret = pmu_ctr_stop_hw(cidx);
|
||||
|
||||
if (flag & SBI_PMU_STOP_FLAG_RESET) {
|
||||
if (cidx > (CSR_INSTRET - CSR_CYCLE) && flag & SBI_PMU_STOP_FLAG_RESET) {
|
||||
active_events[hartid][cidx] = SBI_PMU_EVENT_IDX_INVALID;
|
||||
pmu_reset_hw_mhpmevent(cidx);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue