[PATCH v4] perf: arm_spe: Properly set hw.state on failures

Will Deacon will at kernel.org
Tue Feb 3 12:29:02 PST 2026


On Tue, 03 Feb 2026 14:40:43 +0000, Leo Yan wrote:
> When arm_spe_pmu_next_off() fails to calculate a valid limit, it returns
> zero to indicate that tracing should not start.  However, the caller
> arm_spe_perf_aux_output_begin() does not propagate this failure by
> updating hwc->state, cause the error to be silently ignored by upper
> layers.
> 
> Because hwc->state remains zero after a failure, arm_spe_pmu_start()
> continues to programs filter registers unnecessarily.  The driver
> still reports success to the perf core, so the core assumes the SPE
> event was enabled and proceeds to enable other events.  This breaks
> event group semantics: SPE is already stopped while other events in the
> same group are enabled.
> 
> [...]

Applied to arm64 (for-next/core), thanks!

[1/1] perf: arm_spe: Properly set hw.state on failures
      https://git.kernel.org/arm64/c/283182c1c239

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev



More information about the linux-arm-kernel mailing list