18.2 Triage of a hung core
A hung core leaves no exception and no log. The aim of triage is to classify the hang with as little disturbance as possible, before halting anything: is the core asleep, spinning, or stalled? Each answer points at a different layer. This section assumes the external debug and CoreSight background in 16.2.
The four hang classes
| Class | What the PE is doing | PC behaviour | Can it be halted? | Typical root cause |
|---|---|---|---|---|
Asleep in WFI/WFE | Waiting for an event or interrupt, possibly in a low-power state | Constant, at or just after the WFI/WFE | Usually yes, if the core is powered. A halt request is a wake-up event for WFI/WFE | Interrupt never delivered (4.5), missing SEV, timer not counting (4.6), core powered down by the power controller |
| Spinning on an exclusive | Retrying LDAXR/STLXR with STLXR always returning 1 | Cycles over a few instructions | Yes | Exclusives to memory that has no global monitor, or a monitor cleared every iteration (10.1) |
| Stalled on a Device access | One load (or a store before a DSB) waiting for a response that never comes | Frozen at one load, or at the DSB after the store | Often not: entering Debug state may wait for the access, and that behaviour is IMPLEMENTATION DEFINED | Unclocked or reset peripheral, wrong address that the interconnect does not terminate, a firewall that drops instead of erroring |
| Stalled on a DVM sync | DSB after TLBI ...IS or IC IVAU broadcast, waiting for all DVM participants to complete | Frozen at the DSB | Often not, for the same reason | A participant in the DVM domain that does not respond: a powered-down cluster or chiplet that was not removed from the domain, or an SMMU or chiplet link not set up for DVM (17.5) |
The first two are software bugs at heart, and the debugger handles them easily. The last two are system bugs, and the PE is the wrong place to look: the stuck transaction lives in the interconnect.
Step 1: is the core powered and accessible?
Read EDPRSR over the debug APB. This read does not need the core to be in any particular state, as long as the debug power domain is on.
EDPRSR.PU == 0: the core power domain is off. External debug registers other than the few in the debug power domain return an error. This is not a hang: something (PSCICPU_OFF, the power controller, a reset you did not expect) turned it off. SetEDPRCR.COREPURQif you need the core to stay powered for debugging.EDPRSR.R == 1: the core is held in reset. A secondary that never left reset is a power-controller orRVBARproblem (18.3).EDPRSR.HALTED == 1: it is already in Debug state, possibly because someone’s CTI cross-halt fired.- Check the OS Lock (
EDPRSR.OSLK) and the OS Double Lock status. Firmware that set the OS Lock on the power-down path and never cleared it blocks most external debug accesses.
Step 2: sample the PC without halting
PC sampling reads the PC of a running core with no effect on its execution. It is the most useful non-intrusive hang tool, and it is optional.
| Feature | Registers | Where |
|---|---|---|
| FEAT_PCSRv8 | EDPCSR (lo at 0x0A0, hi at 0x0AC), EDCIDSR, EDVIDSR | External debug register block |
| FEAT_PCSRv8p2 | PMPCSR (at 0x200), PMCID1SR, PMCID2SR, PMVIDSR | External PMU register block |
EDPCSR exists only when FEAT_PCSRv8 is implemented and FEAT_PCSRv8p2 is not. Discover which one you have from EDDEVID.PCSample and PMDEVID.PCSample. Reading the low word captures one sample and latches the matching high word, the context ID and the VMID/EL/Security information into the companion registers, so always read the low word first. A low word of 0xFFFFFFFF means the PE is in Debug state or sampling is prohibited (for example, sampling Secure state without the authentication signal that permits it). The value is UNKNOWN in some cases, including when no branch has retired since the last read, so a core that is truly stalled may return stale or UNKNOWN values. That is itself a signal.
Read it in a loop and build a histogram:
| Histogram | Diagnosis |
|---|---|
One address, a WFI or WFE | Asleep. Next: check the GIC pending state and the wake-up source |
2–5 addresses spanning LDAXR…CBNZ | Exclusive spin. Next: what memory type is the lock in, and is the MMU on? |
| A tight loop elsewhere | A software poll: read the variable it polls via the MEM-AP |
One address, a load or a DSB, and later reads return UNKNOWN | Stalled. Next: the interconnect |
Reads return 0xFFFFFFFF | Halted, or sampling not permitted in the current state |
The most common exclusive-spin case in early boot is a spinlock taken with the MMU and caches off. Then the lock is in Device-nGnRnE memory (MMU off), or in Non-cacheable memory. Exclusives to such memory need a global exclusive monitor in the memory system, and many DRAM controllers and interconnects do not provide one for those types. With no monitor, the store-exclusive can fail forever, or its behaviour is IMPLEMENTATION DEFINED (10.1). LSE atomics behave the same way in principle: a far atomic to an agent that does not support it may fault, hang or be handled by the interconnect, depending on the system.
Step 3: read system state over the MEM-AP
A MEM-AP (an AXI-AP or AHB-AP on the system bus, or an APB-AP on the debug bus) issues transactions into the system without the core’s help. Use it before halting anything:
- The variable the core polls: the mailbox, the lock word or the holding-pen entry address. MEM-AP accesses are usually configured as non-cacheable system accesses. They see the value at the memory side of the interconnect, not dirty data still in the core’s cache. If the core reads a stale line that the writer never cleaned, the MEM-AP will show the “right” value while the core spins on the wrong one. That difference is the diagnosis (8.7).
- GIC state:
GICR_WAKER,GICR_ISPENDR0,GICD_ISPENDRnandGICD_IROUTERnfor the interrupt that should have woken a sleeping core. - RAS records and interconnect error logs: for a stalled access, an interconnect node may have logged a timeout or a decode error.
- Power controller and clock status for the target peripheral.
Bring-up note: If the MEM-AP itself hangs (no
ACKfrom the AP, orCSW.TrInProgstays set), the system bus is wedged at the same point the core is. Switch to the APB-AP and the debug APB, which normally use a separate path. If the interconnect exposes its configuration and error registers on a debug-accessible path, that is where to look next. Ask the SoC team at design time for such a “back door” into the interconnect. Without one, a wedged bus is invisible.
Step 4: halt, with the CTI
Halting gives you all of the register state, but it changes the core: it can wake it from WFI, change timing, and break the race you are chasing. Halt only once the non-intrusive evidence has been collected.
The architected CTI connections on each PE are: output trigger 0 = debug request (halt), output trigger 1 = restart; input trigger 0 = cross-halt (this PE entered Debug state). To halt every core at once:
for each core n:
CTICONTROL.GLBEN = 1
CTIGATE = 0x1 // let channel 0 out to the CTM
CTIOUTEN0 = 0x1 // channel 0 -> output trigger 0 (debug request)
CTIINEN0 = 0x1 // cross-halt -> channel 0 (optional: halting one halts all)
then, on any one core's CTI:
CTIAPPPULSE = 0x1 // pulse channel 0
then, on each core:
poll EDPRSR.HALTED; read EDSCR.STATUS for the reason
CTIINTACK = 0x1 // acknowledge output trigger 0 before restarting
Halting debug must be permitted. For a Non-secure-only debugger, Secure state with SPIDEN low means a request is held pending until the core enters Non-secure state. A core spinning in EL3 then looks “unhaltable”. Check EDSCR and the authentication status (DBGAUTHSTATUS_EL1, or the external view) first.
Once halted, read state by executing instructions through EDITR. For example, MRS x0, ESR_EL3 followed by MSR DBGDTR_EL0, x0 moves the value into the DCC, where the debugger reads it through the external DTR registers (DBGDTRTX_EL0 and DBGDTRRX_EL0 together hold a 64-bit value). Prefer reading system registers this way to running memory accesses in Debug state: a load issued in Debug state allocates into the cache and changes what you are looking at (16.2).
If the halt never completes (EDPRSR.HALTED stays 0 while the PC samples are frozen), the core is very likely waiting on an outstanding access or DSB that it cannot abandon. Go back to step 3. Some cores provide an IMPLEMENTATION DEFINED way to force completion or to see outstanding transactions; check the TRM.
DVM sync hangs in more detail
A TLBI VAE1IS is broadcast to every PE (and SMMU) in the Inner Shareable domain as a DVM operation. The DSB ISH that follows does not complete until a DVM Sync has been acknowledged by all participants (9.1). If any participant cannot reply (it is powered off but still in the snoop/DVM domain, it is in a die whose link is down, or it was never configured to accept DVM), every PE that issues broadcast maintenance hangs at its DSB. The signature is distinctive:
- Several cores frozen at a
DSBimmediately after aTLBIorIC IVAU. - No fault, no SError.
- Often triggered by the first CPU hot-unplug, or by the first boot with a second chiplet present.
The check is to compare the interconnect’s DVM domain membership with the set of powered clusters. On a DynamIQ system, power-down must leave the coherency and DVM domains through the sequence the DSU and TF-A implement (8.8, 17.4).
Validation note: reproduce each class on purpose to prove the triage path works before you need it: a
WFIwith all interrupts disabled at the GIC; anLDXR/STXRloop to a Device-nGnRE page; a load from an address the interconnect leaves unterminated (agree on one with the RTL team); and aTLBI VMALLE1IS; DSB ISHwith one cluster held out of the DVM domain. For each, record the PC-sample histogram, whether a CTI halt completes, and what the MEM-AP and interconnect logs show. The PMU confirms the exclusive case without a debugger:STREX_FAIL_SPEC(where implemented) climbs whileINST_RETIREDkeeps counting, while in the stalled cases both counters stop.
Checkpoint
Q18.2.1 PC sampling on a core in early boot returns a cycle of three addresses: an LDAXR, an STLXR and a CBNZ. The MMU is still off. What is the most likely cause?
- A. A missing
SEV, so the core never leavesWFE - B. The lock is in memory that, with the MMU off, is Device-nGnRnE, and the system provides no global exclusive monitor for it, so the store-exclusive never succeeds
- C. Another core holds the lock and is stalled on a DVM sync
- D. The core is halted and the samples are UNKNOWN
Answer
B. The histogram shows the core retrying a store-exclusive. With the MMU off, data accesses are Device-nGnRnE, and exclusives to such memory depend on a system global monitor that many systems lack. C is possible, but then the loop would be the “lock is held” path, typically spinning on the LDAXR and WFE without reaching STLXR often. A would show a single WFE address. D would read 0xFFFFFFFF.
Read more: Arm ARM (DDI0487), Synchronization and semaphores: exclusive access instructions and Non-shareable/Shareable memory
Q18.2.2 Four cores are frozen at a DSB ISH that follows a TLBI VAE1IS. CTI halt requests do not complete. What do you check first?
- A.
ESR_EL1on each core, after forcing a warm reset - B. Whether the
TLBIwas issued with the right ASID - C. Whether
SCTLR_EL1.Mis set on all cores - D. Whether every participant in the DVM domain is powered and able to respond, using the interconnect’s configuration and status registers over a debug path
Answer
D. DSB ISH after a broadcast TLBI waits for every DVM participant to complete the sync. A wrong ASID (B) would cause stale translations, not a hang. A warm reset (A) destroys the evidence, and ESR_EL1 holds nothing because no exception was taken. The evidence is in the interconnect, not in the PEs.
Read more: Arm ARM (DDI0487), TLB maintenance instructions, and the completion requirements of DSB
Q18.2.3 Why should a MEM-AP read of a mailbox be interpreted with care when diagnosing a core that polls that mailbox?
- A. The MEM-AP normally sees the memory-side value, while the polling core may hit a stale line in its own cache, or the writer’s data may still be dirty in another cache
- B. MEM-AP reads always halt the core first
- C. A MEM-AP read clears the exclusive monitor of every core
- D. MEM-AP accesses bypass the MMU, so they read a different physical address
Answer
A. MEM-AP transactions are system accesses that usually do not look up the PE’s caches. A disagreement between what the MEM-AP sees and what the core acts on is the classic sign of missing cache maintenance. D is tempting, but the MEM-AP issues physical addresses directly, so a VA must be translated first. That is a lookup step, not a reason for divergence. B is false: MEM-AP accesses do not involve the core.
Read more: CoreSight Architecture Specification and ADIv5/ADIv6, MEM-AP; Arm ARM (DDI0487), External debug memory access