Commit 9f828bc3 authored by Mayuresh Chitale's avatar Mayuresh Chitale Committed by Palmer Dabbelt

drivers/perf: RISC-V: Allow programming custom firmware events

Applications need to be able to program the SBI implementation specific
or custom firmware events in addition to the standard firmware events.
Remove a check in the driver that prohibits the programming of the custom
firmware events.
Signed-off-by: default avatarMayuresh Chitale <mchitale@ventanamicro.com>
Reviewed-by: default avatarAndrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20230208074314.3661406-1-mchitale@ventanamicro.comSigned-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent 81a1dd10
...@@ -385,11 +385,8 @@ static int pmu_sbi_event_map(struct perf_event *event, u64 *econfig) ...@@ -385,11 +385,8 @@ static int pmu_sbi_event_map(struct perf_event *event, u64 *econfig)
bSoftware = config >> 63; bSoftware = config >> 63;
raw_config_val = config & RISCV_PMU_RAW_EVENT_MASK; raw_config_val = config & RISCV_PMU_RAW_EVENT_MASK;
if (bSoftware) { if (bSoftware) {
if (raw_config_val < SBI_PMU_FW_MAX) ret = (raw_config_val & 0xFFFF) |
ret = (raw_config_val & 0xFFFF) | (SBI_PMU_EVENT_TYPE_FW << 16);
(SBI_PMU_EVENT_TYPE_FW << 16);
else
return -EINVAL;
} else { } else {
ret = RISCV_PMU_RAW_EVENT_IDX; ret = RISCV_PMU_RAW_EVENT_IDX;
*econfig = raw_config_val; *econfig = raw_config_val;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment