coresight: cpu-debug: PC sampling via PMPCSR (FEAT_PCSRv8p2)?
Igor Velkov
iav at iav.lv
Fri Nov 13 16:08:16 PST 2026
On Fri, Nov 13, 2026 at 02:46:23PM +0000, Leo Yan wrote:
> For example, with CPUidle enabled, a CPU can be powered off any time so
> it still race even move sampling in smp_send_stop().
I tested this on S905X3 (Cortex-A55, PMPCSR) and RK3399 (Cortex-A53 +
A72, EDPCSR, idle states with core powerdown).
Sampling only the CPUs still online after the stop request avoids the
race: a CPU that did not stop within the timeout did not take the stop
IPI, so it is not in a powerdown state; it spins with IRQs off or is
stuck on the bus. On RK3399 the CPUs found powered down in idle all
stopped.
EDPRSR still has to be checked, and PU alone is not enough:
- A55 after CPU_OFF on the crash path: PU=0; reading PMPCSR aborts.
- A72 after CPU_OFF: PU=1, R=1 (the same in idle); reading EDPCSR
aborts.
- S905X3: once every other core is off, even EDPRSR reads do not
return. With a stuck core still on, reading it from the panic CPU
worked on both SoCs, across clusters on RK3399.
The cpu-debug panic notifier reads every possible CPU after COREPURQ;
on RK3399 on the crash path without pseudo-NMI it hit an SError on the
first CPU that was off.
So I would send:
1. cpu-debug notifier: online CPUs other than the panic CPU, read only
with PU=1, R=0 and DLK=0, no COREPURQ;
2. PMPCSR when EDDEVID.PCSample is 0 and PMDEVID.PCSample is not.
Panic notifiers run after the stop only with crash_kexec_post_notifiers;
with a crash kernel loaded and without it, they do not run at all. Is
that acceptable, or would you rather see a hook in the crash stop path?
Thanks,
Igor
More information about the linux-arm-kernel
mailing list