[PATCH v2 0/2] perf: arm_spe: Validate the filter configs per-bit

Ping Li leeonion.muyu at gmail.com
Sun Nov 29 22:13:29 PST 2026


Probe the supported filter bits of PMSNEVFR_EL1 and PMSDSFR_EL1
separately instead of reusing the mask probed from PMSEVFR_EL1, and
validate the inverse event filter and the data source filter against
their own masks.

Runtime-tested on Cortex-A78AE (SPEv1.0, which implements neither
FnE nor FDS) and on Cortex-A720AE (SPEv1.2, which implements FnE
but not FDS): the PMU probes cleanly with the per-register
discovery in place, event filter configs are validated per-bit
against the probed masks with unimplemented bits rejected using
-EOPNOTSUPP, and sampling is unaffected. Only the FDS path lacks
coverage on hardware implementing the feature.

Changes in v2:
- Split into two patches so each fix can be backported
  independently (Leo Yan).
- Reword the PMSNEVFR_EL1 motivation: implementations are expected
  to use the same bit positions, the practical benefit of the early
  mask check is reporting the error at the first opportunity when
  FEAT_INV_FILT_EVT is absent (Leo Yan).
- Group the data source filter check with the FDS presence check so
  that config4 is only validated when the filter is in use (Leo
  Yan).
- Drop the Tested-by tag (Leo Yan).

Ping Li (2):
  perf: arm_spe: Validate the inverse event filter against PMSNEVFR_EL1
  perf: arm_spe: Validate the data source filter per-bit

 drivers/perf/arm_spe_pmu.c | 34 ++++++++++++++++++++++++++++++----
 1 file changed, 30 insertions(+), 4 deletions(-)


base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
-- 
2.34.1




More information about the linux-arm-kernel mailing list