Linux Perf Users
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: James Clark <james.clark@linaro.org>
Cc: Ping Li <leeonion.muyu@gmail.com>,
	robh@kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	will@kernel.org, mark.rutland@arm.com
Subject: Re: [PATCH v2 1/2] perf: arm_spe: Validate the inverse event filter against PMSNEVFR_EL1
Date: Mon, 30 Nov 2026 10:56:12 +0000	[thread overview]
Message-ID: <20261130105612.GK861809@e132581.arm.com> (raw)
In-Reply-To: <da259d87-6b50-4598-9c7b-8f2aa978d8a1@linaro.org>

On Mon, Nov 30, 2026 at 10:42:48AM +0000, James Clark wrote:
> On 30/11/2026 06:13, Ping Li wrote:

> > config3 is validated against the mask probed from PMSEVFR_EL1, even
> > though it is written verbatim to PMSNEVFR_EL1. Implementations are
> > expected to use the same bit positions for the two registers, but the
> > borrowed mask also lets an invalid config pass the early check when
> > FEAT_INV_FILT_EVT is absent, deferring the error to the later
> > PMSFCR_EL1.FnE feature check.

When read v1, I thought pmsnevfr_res0 could prevent the inverse
event filter from being configured when FEAT_INV_FILT_EVT is not
supported.

However, the current driver already prevents this in event init:

  if ((FIELD_GET(PMSFCR_EL1_FnE, reg)) &&
      !(spe_pmu->features & SPE_PMU_FEAT_INV_FILT_EVT))
        return -EOPNOTSUPP;

> > Probe the supported filter bits of PMSNEVFR_EL1 separately and
> > validate config3 against its own mask. Keep a full mask when the
> > feature is not implemented so that any attempt to use the inverse
> > event filter is rejected at the earliest opportunity.
> > 
> > Fixes: 8d9190f00a975 ("perf: arm_spe: Add support for SPEv1.2 inverted event filtering")
> 
> I don't think this actually fixes anything or is required. The ARM states
> that the availability of filters are based on the existence of the same
> events and features for both inverted and non inverted filters. The pseudo
> code also uses a single mask variable to define both filters.
> 
> Unless you can show some specific exception?

Based on above, I agreed this patch is not quite useful.

Thanks,
Leo

  reply	other threads:[~2026-11-30 10:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  6:13 [PATCH v2 0/2] perf: arm_spe: Validate the filter configs per-bit Ping Li
2026-11-30  6:13 ` [PATCH v2 1/2] perf: arm_spe: Validate the inverse event filter against PMSNEVFR_EL1 Ping Li
2026-11-30 10:42   ` James Clark
2026-11-30 10:56     ` Leo Yan [this message]
2026-11-30  6:13 ` [PATCH v2 2/2] perf: arm_spe: Validate the data source filter per-bit Ping Li
2026-11-30 10:40   ` Leo Yan
2026-11-30  6:24 ` [PATCH v2 0/2] perf: arm_spe: Validate the filter configs per-bit sashiko-bot
     [not found] <"da259d87-6b50-4598-9c7b-8f2aa978d8a1@linaro.org">
2026-11-30 11:56 ` [PATCH v2 1/2] perf: arm_spe: Validate the inverse event filter against PMSNEVFR_EL1 Ping Li

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=20261130105612.GK861809@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=james.clark@linaro.org \
    --cc=leeonion.muyu@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh@kernel.org \
    --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