Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

18.3 Bring-up failure signatures

The failures in this section recur on almost every new SoC. Each comes with a signature (what you observe), the first check (the one measurement that splits the cause space in two), and a pointer to the section that holds the full mechanism. The second half gives a procedure for SError triage, the case where the PE gives the least help.

Dead after SCTLR_ELx.M = 1

Signature: the UART goes quiet at the MSR SCTLR_EL3, x0; ISB. There is no exception output, because the handler would need the same translation tables to run.

First check: halt the core and read PC, ESR_EL3, ELR_EL3 and SPSR_EL3.

  • PC in the vector region with ESR_EL3 showing an Instruction Abort (EC 0x21): the tables do not map the code that runs after the ISB, or they do not map the vectors. Read the xFSC level. A fault at the start level points at TCR_EL3.T0SZ/TG0/PS or TTBR0_EL3. A fault at the last level points at the memory map entries (9.3).
  • PC far from anything: the next fetch used a VA that is not the identity of the PA that was executing. The trampoline must be identity-mapped.
  • No exception at all, PC advancing normally, but output stopped: the UART is now accessed through a mapping it lacks, or as Normal memory, so writes are merged or held in a cache. Map MMIO as Device-nGnRE (6.5).

On FVP, run with Tarmac trace and look at the first fetch after the ISB: the trace prints the translation result. A boot path that works on FVP but fails on silicon with garbage walks is the stale-table-line case (18.4).

Recursive exceptions at VBAR

Signature: the PC is always within the vector table. ELR_ELx also points into the vector table, SPSR_ELx.M is the current EL with SPx, and ESR_ELx changes every time you look, or is stuck at an abort on the vector address.

Each nested exception overwrites ELR, SPSR, ESR and FAR, so the original fault is gone after the first recursion. The usual causes, in order of frequency:

  1. The handler’s first memory access faults. The stack (SP_EL3) is not mapped, not yet set up, or not 16-byte aligned with SCTLR_ELx.SA == 1. The prologue’s STP takes a Data Abort, which vectors to the same handler, which does the same STP.
  2. The vector table itself is not executable. It is not mapped, it is mapped XN, or VBAR_ELx was written with a misaligned value (its low 11 bits are RES0, so the table must be 2 KB aligned).
  3. The handler uses a feature that is still trapped, such as FP/SIMD register saves with CPTR_EL3.TFP == 1, which takes EC 0x07 to EL3 from inside the EL3 handler.

First check: make the first instructions of each vector entry record the syndrome without touching memory, so the original fault survives:

    .balign 0x80
sync_spx:                       // bring-up build only: clobbers x0-x3
    mrs  x0, ESR_EL3
    mrs  x1, ELR_EL3
    mrs  x2, FAR_EL3
    mrs  x3, TPIDR_EL3          // reset code zeroes TPIDR_EL3 before anything can fault
    cbnz x3, 1f                 // non-zero: a fault is already recorded, so this is recursion
    msr  TPIDR_EL3, x0          // first fault: keep its ESR where nothing else writes it
    b    real_sync_handler
1:  b    .                      // park: TPIDR_EL3 = first ESR, x0-x2 = nested fault

Nothing here touches memory, so it runs even when the stack and data are unmapped. It catches recursion wherever the nested fault happens (in the stub or in real_sync_handler’s prologue), because it keys on “a fault is already recorded” rather than on ELR. TPIDR_EL3 resets to an UNKNOWN value, so the reset code must zero it, and a same-EL synchronous exception is treated as fatal. A debugger halt then reads x0–x2 and TPIDR_EL3 with EDITR. The recursion guard turns an endless loop into a parked core that still holds the first syndrome. This is for a bare-metal or bring-up build: in TF-A, TPIDR_EL3 already holds the per-CPU context pointer, so pick a different scratch location there.

SError at the first DRAM access

Signature: an SError (EC 0x2F) shortly after the first cacheable access to DRAM, with ELR_ELx in an unrelated place.

Typical causes:

  • DRAM not trained or not out of self-refresh. The DMC returns a slave error, or the interconnect times out.
  • The address map is wrong. The DMC region in the interconnect’s system address map does not match what software uses, so a request decodes to nothing (17.5).
  • ECC memory not initialised. A read of a location that was never written has random check bits, so it reports an uncorrectable error. Partial-line writes are the trap: a cache eviction of a partly written line, or a narrow non-cacheable write, makes the DMC do a read-modify-write, and the read half fails. Initialise (scrub) all ECC DRAM with full-line writes, usually with the DMC’s own init engine, before the first use.
  • Speculative accesses. A large Normal mapping covers a hole or a not-yet-ready region, and the core speculatively fetches or prefetches from it (9.3, 14.2).

First check: read the DMC’s error records before anything else (see the procedure below). They tell you whether the DMC saw the request at all. If the DMC has no error, the request never reached it, and the interconnect logs are next.

A secondary core that never arrives

Signature: PSCI CPU_ON returns SUCCESS (it only means the request was accepted), but the secondary never prints, never checks in, and never increments its counter.

Split the problem by asking whether the core left reset, and then whether it reached the entry point:

ObservationLikely causeFirst check
EDPRSR.PU == 0 or EDPRSR.R == 1The power controller did not power it up or release resetPower controller status registers; the PPU/SCP firmware log
Core running, PC near RVBAR but loopingIt reached BL31’s warm-boot path but is waiting in a holding pen or on a mailbox it never seesMEM-AP read of the mailbox vs what the core reads. Missing clean to the PoC by the writer, or a missing SEV after the write (10.4)
PC at an unexpected address from the startRVBAR_EL3/the reset-address configuration register was not programmed for this core, or is per-cluster and only the boot cluster was setThe SoC’s reset-vector registers
Arrives at BL31, faults in the warm-boot pathPer-core state not initialised: MPIDR not in the platform’s core-position table, errata workarounds faulting on a different revision, CPUECTLR_EL1.SMPEN (pre-DynamIQ)MPIDR_EL1 vs the platform topology; TF-A’s plat_core_pos_by_mpidr
Arrives in the kernel, then hangs at the first TLBI ...ISCore not in the DVM/coherency domain18.2

The second row is the most common, and it is a cache-maintenance bug: the primary writes the entry point with caches on, and the secondary reads it with its caches and MMU off, from memory. The primary must clean the line to the PoC (DC CVAC, then DSB) before signalling. The secondary must not hit a stale line of its own when it turns caches on (8.8, 17.4).

A timer that never ticks

Signature: the first udelay() hangs, or the scheduler never preempts. No faults.

First check: read CNTPCT_EL0 twice. If the values are equal, the system counter is stopped (CNTCR.EN == 0 in CNTControlBase). If they differ, check CNTFRQ_EL0 against the real clock, then the timer interrupt path (PPI group, enable and priority, PMR). The full list is in 4.6.

Triaging an SError

An SError is, by default, the least attributable failure there is (3.4). Use this procedure:

1. Read the error records first

Do this before you reset anything, because a reset can clear the records (it depends on the node’s reset domain).

  • PE-local nodes: for each record n below ERRIDR_EL1.NUM, write ERRSELR_EL1 = n, ISB, then read ERXSTATUS_EL1, ERXADDR_EL1 and ERXMISC0_EL1.
  • System nodes (DSU/L3, interconnect home nodes, DMCs, SMMU): read the memory-mapped ERRnSTATUS, ERRnADDR and ERRnMISCx in each node’s RAS register frame, via the PE or the MEM-AP. On ACPI systems, the AEST table lists where they are (18.6).

For each record with STATUS.V == 1, note UE, DE, CE, OF (overflow, meaning more than one error), AV and ADDR (an address is valid), MV (MISC is valid) and the SERR code. A record with UE == 1 and a valid address in a DMC node identifies the failing request. A PE-local record often shows only “an external error was received”, which tells you to look further out. The field definitions are in 16.7.

2. Correlate with interconnect error logs

The interconnect usually has its own error capture, outside the Arm RAS register model or in IMPLEMENTATION DEFINED RAS nodes: decode errors (no target for an address), timeouts, firewall or TZC/GPC violations, and parity or ECC errors on internal paths. Match the address and requester ID against the core’s memory map. A decode error at an address in a Normal mapping that no code touches is a speculation problem. A firewall error on a Non-secure request to a Secure carve-out is an attribute bug.

3. Bisect by masking PSTATE.A

If the records do not identify the access, make the PE localize it:

    msr  DAIFSet, #4            // mask SError: it now stays pending
    // ... suspect region ...
    dsb  sy                     // force outstanding accesses to complete
    mrs  x0, ISR_EL1            // ISR_EL1.A (bit 8) == 1: an SError is pending
    // with FEAT_RAS, use ESB instead and read DISR_EL1.A

Binary-search the code between checkpoints: move the DSB plus check until one access separates “pending” from “not pending”. ISR_EL1.A works on any v8.0 core. With FEAT_RAS, ESB defers the pending SError into DISR_EL1 with its syndrome, which is more convenient (3.4). Remember that the DSB changes timing and can hide a race. If the bug disappears once checkpoints are added, that is information too.

Bring-up note: SCR_EL3.EA == 1 routes SErrors to EL3 regardless of where they occur. During bring-up that is what you want: one handler that dumps the error records for every SError. Leave the dumping in place in production firmware, since firmware-first handling, which reports errors to the OS through APEI/HEST (16.8), needs the same code.

Checkpoint

Q18.3.1 After enabling the MMU at EL3, the core loops forever in the vector table. ESR_EL3 reads as a Data Abort on an address just below SP_EL3’s initial value. What is the most likely root cause?

  • A. VBAR_EL3 is not 2 KB aligned
  • B. TCR_EL3.T0SZ is wrong, so no address translates
  • C. The EL3 stack is not mapped, so the handler’s first STP faults and re-enters the same handler
  • D. The original fault was an SError, which always recurses
Answer

C. The faulting address is the stack, and the PC can fetch the vector table, so the table and the code are mapped but the stack is not. B would make the vector fetch fail too, giving Instruction Aborts. A misaligned VBAR (A) gives fetches from the wrong address, not a data abort on the stack. D is false: an SError is masked on entry because PSTATE.A is set.

Read more: Arm ARM (DDI0487), VBAR_EL3; Exception entry, PSTATE on taking an exception

Q18.3.2 A secondary core’s PC samples show it looping in BL31’s warm-boot holding code, waiting for its entry point. A MEM-AP read of the mailbox shows the correct entry point. What is the most likely bug?

  • A. The secondary’s RVBAR_EL3 is wrong
  • B. The primary wrote the mailbox with caches on and did not clean it to the PoC, or the secondary is reading a stale line in its own cache
  • C. The secondary is held in reset
  • D. The GIC redistributor of the secondary is asleep
Answer

B. The core is running the right code (so not A or C), and the value is in memory (the MEM-AP sees it), but the core does not see it. That is a cache visibility problem between a cacheable writer and a reader that is non-cacheable or stale. D matters only if the secondary waits for an interrupt rather than polling a mailbox.

Read more: Arm ARM (DDI0487), Data cache maintenance instructions and the Point of Coherency

Q18.3.3 You are bisecting an imprecise SError. Which step makes a pending SError observable at a chosen point, without taking it?

  • A. Mask PSTATE.A, execute DSB SY, then read ISR_EL1.A (or, with FEAT_RAS, execute ESB and read DISR_EL1)
  • B. Set SCR_EL3.EA = 0 so the SError stays at EL1
  • C. Execute ISB, which makes all outstanding errors synchronous
  • D. Read FAR_EL3 after each store
Answer

A. With PSTATE.A masked the SError stays pending. The DSB waits for outstanding accesses so that errors they produce are signalled, and ISR_EL1.A or the ESB/DISR_EL1 path reports it. B changes routing, not attribution. ISB (C) is a context synchronization event, not an error synchronization barrier. FAR_EL3 (D) is not written for SErrors without FEAT_RASv2 indications.

Read more: Arm ARM (DDI0487), ISR_EL1; RAS Extension, Error synchronization barrier and DISR_EL1