riscv: Make legacy counter enum match the HW numbering
authorAlexandre Ghiti <alexghiti@rivosinc.com>
Wed, 2 Aug 2023 08:03:21 +0000 (10:03 +0200)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 16 Aug 2023 14:28:17 +0000 (07:28 -0700)
commite8b785e98abb0cc12edd4ba2d3ccad767ab8b68d
tree87e724167adc3b4c01af9a3fb3bcdaefa2d82414
parentf117ae55b0198dd6fc36ce521e06d8b44a4bb203
riscv: Make legacy counter enum match the HW numbering

RISCV_PMU_LEGACY_INSTRET used to be set to 1 whereas the offset of this
hardware counter from CSR_CYCLE is actually 2: make this offset match the
real hw offset so that we can directly expose those values to userspace.

Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
drivers/perf/riscv_pmu_legacy.c