Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Leo Yan <leo.yan@arm.com>
Cc: will@kernel.org, mark.rutland@arm.com,
	ilkka@os.amperecomputing.com, linux-perf-users@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] perf/arm-cmn: Fix multi-filter encoding
Date: Wed, 16 Sep 2026 16:27:20 +0100	[thread overview]
Message-ID: <aaafc5a8-e64a-4091-b615-257e48c34781@arm.com> (raw)
In-Reply-To: <20260916093146.GG200420@e132581.arm.com>

On 16/09/2026 10:31 am, Leo Yan wrote:
> On Tue, Sep 15, 2026 at 01:24:22PM +0100, Robin Murphy wrote:
>> The current special-case for EVICT_STATE_SEL filtering effectively
>> assigns the "filter" and "filter2" controls in the opposite order from
>> how the CMN S3 r2 TRM states "Filtering is programmed in pmu_hbt_lbt_sel
>> and pmu_evict_state_sel". On reflection, not only does this seem
>> unnecessarily non-obvious to users, but it's also likely to be a problem
>> for scaling to a full multi-filter abstraction in future. There is a
>> logical order to filters based on their bitfield positions in the
>> pmu_event_sel register, which the TRM descriptions allude to, and the
>> cmn_filter_select enum already (almost) follows, so let's fix the UABI
>> to follow suit while it's still unreleased.
>>
>> Fixes: 09178f536bb9 ("perf/arm-cmn: Plumb in new filter types")
>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> 
> It's hard to say how useful my review is, but I went through the patch
> and also asked AI to explain the rationale. It makes sense to me:
> 
> Reviewed-by: Leo Yan <leo.yan@arm.com>
> 
> Seems we could implement a generic way to navigate filters based on
> the hardware bitfield ordering, e.g. filter_next(sel) and
> filter_prev(sel). This can be deferred until we have more combined
> filters.

Yup, that's the direction this was always heading - in the (near-ish) 
future we definitely are going to have to support different events 
having overlapping combinations of multiple filters, and even more cases 
of one event having different filters per CMN model. Thus one option I 
realised I'd like to keep open, in case arrays get too clunky, is to 
encode cmn_filter_select values in a bitmap, wherein a mapping of bits 
to CMN_EVENT_FILTER*() fields could always be implied based on this 
consistent ordering.

Thanks,
Robin.


  reply	other threads:[~2026-09-16 15:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15 12:24 [PATCH v2] perf/arm-cmn: Fix multi-filter encoding Robin Murphy
2026-09-16  9:31 ` Leo Yan
2026-09-16 15:27   ` Robin Murphy [this message]
2026-09-17  1:51 ` Ilkka Koskinen
2026-09-18 12:28 ` Will Deacon

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=aaafc5a8-e64a-4091-b615-257e48c34781@arm.com \
    --to=robin.murphy@arm.com \
    --cc=ilkka@os.amperecomputing.com \
    --cc=leo.yan@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=will@kernel.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