[PATCH v2 0/2] lib: sbi: pmu: Rework SSE callbacks
Clément Léger
cleger at rivosinc.com
Mon May 19 01:39:47 PDT 2025
While testing the PMU SSE support in Linux, a few problem were spotted.
The first one was due to interrupts happing during some PMU critical
sections. Indeed, the PMU core actually disable interrupts when entering
these sections. However, while this works when interrupts are targeting
the S-mode, this is not the case with SSE. Fixing this required to
implement pmu_disable/enable() in Linux [1]. These two callbacks now
call sse_event_disable/enable() which now just needs to set/clear
MIE/MIP. Second problem was that reported PMU events count were quite
low. This proved to be due to some interrupts being losed when
reenabling SSE event. We still need to clear the pending PMU interrupts
upon disabling otherwise we might get some spurious interrupts when
reenabling it.
Link: https://lore.kernel.org/linux-riscv/20250516152355.560448-1-cleger@rivosinc.com/ [1]
Clément Léger (2):
lib: sbi: pmu: Add SSE register/unregister() callbacks
lib: sbi: pmu: Remove MIP clearing from pmu_sse_enable()
lib/sbi/sbi_pmu.c | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
--
2.49.0
More information about the opensbi
mailing list