OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@kernel.org>
To: Anup Patel <anup@brainfault.org>
Cc: opensbi@lists.infradead.org
Subject: Re: [PATCH] lib/sbi_pmu: Don't fallback to fixed counters when sscofpmf && !smcntrpmf
Date: Mon, 18 May 2026 11:13:44 +1000	[thread overview]
Message-ID: <bc946e89-a33f-4f29-8d4d-119f1a76d26e@kernel.org> (raw)
In-Reply-To: <CAAhSdy1FUMVpOAmTgdgyPwKRQ0Vepjoqh4NOq32kVUsYyT1jvw@mail.gmail.com>

On 11/5/2026 17:52, Anup Patel wrote:
> On Tue, Mar 24, 2026 at 5:59 PM Michael Ellerman <mpe@kernel.org> 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 <mpe@kernel.org>
> 
> Fixes tag is missing but I will add this at the time of merging.

Thanks.

cheers

-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

      reply	other threads:[~2026-05-18  1:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 12:29 [PATCH] lib/sbi_pmu: Don't fallback to fixed counters when sscofpmf && !smcntrpmf Michael Ellerman
2026-05-11  7:52 ` Anup Patel
2026-05-18  1:13   ` Michael Ellerman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bc946e89-a33f-4f29-8d4d-119f1a76d26e@kernel.org \
    --to=mpe@kernel.org \
    --cc=anup@brainfault.org \
    --cc=opensbi@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox