[PATCH v2 0/2] lib: sbi: pmu: Rework SSE callbacks
Anup Patel
anup at brainfault.org
Sun Jun 15 06:21:17 PDT 2025
On Mon, May 19, 2025 at 2:10 PM Clément Léger <cleger at rivosinc.com> wrote:
>
> 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()
Applied this series to the riscv/opensbi repo.
Thanks,
Anup
More information about the opensbi
mailing list