lib: sbi: Fix counter index calculation for SBI_PMU_CFG_FLAG_SKIP_MATCH
authorAlexandre Ghiti <alexghiti@rivosinc.com>
Thu, 13 Apr 2023 14:02:19 +0000 (16:02 +0200)
committerAnup Patel <anup@brainfault.org>
Mon, 17 Apr 2023 03:56:28 +0000 (09:26 +0530)
commit674e0199b23effebfc5311d09b636ca9b46cde7e
treedc5bc8021cd3031446fb3fd29a3bf33ff7ed3b26
parentbdb3c42bca1c7fddd0c43f0be24c3a1590f02e50
lib: sbi: Fix counter index calculation for SBI_PMU_CFG_FLAG_SKIP_MATCH

As per the SBI specification, we should "unconditionally select the first
counter from the set of counters specified by the counter_idx_base and
counter_idx_mask", so implement this behaviour.

Suggested-by: Atish Patra <atishp@atishpatra.org>
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
lib/sbi/sbi_pmu.c