perf: RISC-V: exclude invalid pmu counters from SBI calls
authorSergey Matyukevich <sergey.matyukevich@syntacore.com>
Tue, 30 Aug 2022 15:53:05 +0000 (18:53 +0300)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 8 Sep 2022 20:34:50 +0000 (13:34 -0700)
commit1537bf26e212ffcf007d0590958025f6bfdd4ac8
treeb2a498f8d14239173d11ee1a97a7911b356504e9
parent82c75dca6f95c9ac4649031a493456156ddfec2f
perf: RISC-V: exclude invalid pmu counters from SBI calls

SBI firmware may not provide information for some counters in response
to SBI_EXT_PMU_COUNTER_GET_INFO call. Exclude such counters from the
subsequent SBI requests. For this purpose use global mask to keep track
of fully specified counters.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich@syntacore.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Link: https://lore.kernel.org/r/20220830155306.301714-3-geomatsi@gmail.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
drivers/perf/riscv_pmu_legacy.c
drivers/perf/riscv_pmu_sbi.c
include/linux/perf/riscv_pmu.h