[PATCH v4 01/14] perf: RISC-V: Define helper functions expose hpm counter width and count
Andrew Jones
ajones at ventanamicro.com
Thu Feb 2 06:59:48 PST 2023
On Wed, Feb 01, 2023 at 03:12:37PM -0800, Atish Patra wrote:
> KVM module needs to know how many hardware counters and the counter
> width that the platform supports. Otherwise, it will not be able to show
> optimal value of virtual counters to the guest. The virtual hardware
> counters also need to have the same width as the logical hardware
> counters for simplicity. However, there shouldn't be mapping between
> virtual hardware counters and logical hardware counters. As we don't
> support hetergeneous harts or counters with different width as of now,
> the implementation relies on the counter width of the first available
> programmable counter.
>
> Reviewed-by: Anup Patel <anup at brainfault.org>
> Signed-off-by: Atish Patra <atishp at rivosinc.com>
> ---
> drivers/perf/riscv_pmu_sbi.c | 37 ++++++++++++++++++++++++++++++++--
> include/linux/perf/riscv_pmu.h | 3 +++
> 2 files changed, 38 insertions(+), 2 deletions(-)
>
Reviewed-by: Andrew Jones <ajones at ventanamicro.com>
More information about the linux-riscv
mailing list