Re: [PATCH] lib/sbi_pmu: Don't fallback to fixed counters when sscofpmf && !smcntrpmf

Michael Ellerman <[email protected]>
Newsgroups org.infradead.lists.opensbi
Message-ID <[email protected]>
On 11/5/2026 17:52, Anup Patel wrote:
> On Tue, Mar 24, 2026 at 5:59 PM Michael Ellerman <[email protected]> wrote:
>>
>> Currently when searching for a hardware counter for an event, if no
>> programmable counter is available, the code falls back to using a fixed
>> counter (mcycle/minstret) if one matches the event.
>>
>> However the fallback is incorrect when sscofpmf is present but
>> smcntrpmf is not. That's because with sscofpmf, programmable counters
>> support mode filtering, but the fixed counters do not (without
>> smcntrpmf). Even if the caller didn't configure mode filtering, by
>> default programmable counters don't count M mode when sscofpmf is
>> present, whereas mcycle/minstret do.
>>
>> Fix the logic to not fallback to a fixed counter if sscofpmf is present
>> but smcntrpmf is not.
>>
>> Signed-off-by: Michael Ellerman <[email protected]>
> 
> Fixes tag is missing but I will add this at the time of merging.

Thanks.

cheers

-- 
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.