perf: RISC-V: Improve privilege mode filtering for perf
authorAtish Patra <atishp@rivosinc.com>
Sun, 5 Feb 2023 01:15:03 +0000 (17:15 -0800)
committerAnup Patel <anup@brainfault.org>
Tue, 7 Feb 2023 15:05:33 +0000 (20:35 +0530)
commit8929283a687bb4b71ec9d3f1e827aecf829c6b1a
treeebca3a7bad3979818bd451fcfe3d71bf3c3bb6fe
parent585e351ff359c032ea7ab48d999b252ba09f8051
perf: RISC-V: Improve privilege mode filtering for perf

Currently, the host driver doesn't have any method to identify if the
requested perf event is from kvm or bare metal. As KVM runs in HS
mode, there are no separate hypervisor privilege mode to distinguish
between the attributes for guest/host.

Improve the privilege mode filtering by using the event specific
config1 field.

Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
drivers/perf/riscv_pmu_sbi.c
include/linux/perf/riscv_pmu.h