perf: arm_spe: Relax period restriction
authorLeo Yan <leo.yan@arm.com>
Fri, 27 Jun 2025 16:30:28 +0000 (17:30 +0100)
committerWill Deacon <will@kernel.org>
Tue, 8 Jul 2025 17:04:03 +0000 (18:04 +0100)
commitba2ff3e1b640ca7aa0841be3dae94daa6b60bf49
tree9f1f09d868069b2c9fa65f75b48500df9be6ee0b
parent58074a0fce66c6c97b35ce8a28ed4e7b780f9a8f
perf: arm_spe: Relax period restriction

The minimum interval specified the PMSIDR_EL1.Interval field is a
hardware recommendation. However, this value is set by hardware designer
before the production. It is not actual hardware limitation but tools
currently have no way to test shorter periods.

This change relaxes the limitation by allowing any non-zero periods,
with simplifying code with clamp_t().

The downside is that small periods may increase the risk of AUX ring
buffer overruns. When an overrun occurs, the perf core layer will
trigger an irq work to disable the event and wake up the tool in user
space to read the trace data. After the tool finishes reading, it will
re-enable the AUX event.

Signed-off-by: Leo Yan <leo.yan@arm.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/20250627163028.3503122-1-leo.yan@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm_spe_pmu.c