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

5.8 MMU faults and how to decode them

An MMU fault arrives as an Instruction Abort (EC 0x20 from a lower EL, 0x21 from the same EL) or a Data Abort (EC 0x24/0x25). The exception entry mechanics and the EC table are in 3.2, and the one-page card is Appendix D. This section covers the abort ISS, which tells you what kind of translation failure happened, at which level, at which stage, and whether FAR_ELx can be trusted.

The fault status code (DFSC/IFSC)

ISS[5:0] is the DFSC (data) or IFSC (instruction). Most classes encode the walk level in the low two bits (LL). Levels −1 and −2 cannot be expressed that way, so they have separate codes.

DFSCFaultLevelsTypical meaning
0x00–0x03Address size0–3An OA (TTBR base, table address, or output) exceeds IPS/PS or PARange. Level 0 means the TTBR itself
0x29 / 0x2CAddress size−1 / −2Same, for LPA2 / D128 walks (5.7)
0x04–0x07Translation0–3Invalid descriptor, VA outside the TxSZ range, or EPDn/E0PDn set
0x2B / 0x2ATranslation−1 / −2Same, for LPA2 / D128 walks
0x08–0x0BAccess flag0–3AF == 0 with hardware AF disabled (5.6)
0x0C–0x0FPermission0–3AP/PIE/POE/XN/PAN check failed (5.5)
0x10Synchronous External abort, not on a walk–The access itself got an error response (3.4, 16.7)
0x11Synchronous Tag Check Fault–MTE (13.5)
0x12, 0x13, 0x14–0x17Synchronous External abort on a walk−2, −1, 0–3The descriptor read (or hardware update) got an error
0x18, 0x1B, 0x1C–0x1FSynchronous parity/ECC error (not on / on a walk)–, −1, 0–3Only when FEAT_RAS is not implemented. With RAS these are reserved, and errors are reported as SEA
0x21Alignment–Unaligned access to Device memory, SCTLR_ELx.A, or an exclusive/atomic alignment rule
0x23, 0x24–0x27Granule Protection Fault on a walk−1, 0–3RME: the descriptor’s PA is not accessible in this PAS (12.4)
0x28Granule Protection Fault, not on a walk–RME: the output PA is not accessible in this PAS
0x30TLB conflict abort–Overlapping TLB entries, usually a break-before-make violation (9.2)
0x31Unsupported atomic hardware update–The walker’s AF/dirty RMW is not supported on the table memory
0x34, 0x35IMPLEMENTATION DEFINED (lockdown; unsupported exclusive or atomic)–0x35 usually means an exclusive or atomic to memory whose type or target cannot support it (10.1)

Two distinctions carry most of the diagnostic value:

  • Translation vs Address size. A Translation fault means the walk found nothing valid. An Address size fault means it found something but the address is too wide for the configuration. The first points to the tables, the second to IPS/PS, the TTBR value or the physical memory map.
  • External abort on a walk vs not on a walk. 0x14–0x17 say the walker’s read of the table failed: tables in memory that does not respond, is not yet initialised, or is blocked by a TZC/firewall for the walk’s security attribute. 0x10 says the translation succeeded and the target access failed.

The other ISS fields

Data Abort ISS (EC 0x24/0x25); the Instruction Abort ISS is the subset marked †:

BitsFieldMeaning
[24]ISVBits [23:14] hold a valid instruction syndrome
[23:22]SASAccess size: byte, halfword, word, doubleword
[21]SSEThe load sign-extends
[20:16]SRTTransfer register number
[15]SF64-bit register transfer
[14]ARAcquire/release semantics
[13]VNCRFault on an FEAT_NV2 access through VNCR_EL2 (11.2)
[12:11]SET†With FEAT_RAS, the error state of a synchronous External abort (recoverable, uncontainable, restartable)
[10]FnV†FAR is not valid (meaningful only for External aborts)
[9]EA†IMPLEMENTATION DEFINED classification of an External abort
[8]CMFault on a cache maintenance instruction, or on an AT instruction’s stage 2 walk
[7]S1PTW†Stage 2 fault on a stage 1 table walk
[6]WnRWrite (1) or read (0)
[5:0]DFSC/IFSC†Fault status, above

ISS2 (ESR_ELx[55:32]) adds bits for newer features, for example DirtyBit [5] (a PIE dirty-state permission fault), Overlay [6] (a POE overlay fault), GCS [8], TagAccess [9], TnD [10] and HDBSSF [11]. A permission fault that you cannot explain from AP/XN alone usually has one of these set.

Reading the fields correctly

  • WnR with CM or S1PTW. Faults on cache maintenance instructions report WnR = 1 whatever the instruction. With S1PTW = 1, WnR describes the walker’s access to the stage 1 table (which may be a hardware AF/dirty write), not the instruction’s access. Linux’s esr_dabt_iswrite() carries the comment “Always check for S1PTW before using this”.
  • ISV and emulation. A hypervisor emulating MMIO decodes the access from SAS/SSE/SRT/SF/AR without fetching the guest instruction. The architecture provides a valid syndrome only for a qualifying single-register load or store (no writeback, not a pair, not SIMD/FP, not an exclusive) that faults at stage 2. For anything else ISV = 0, and the hypervisor must decode the instruction or refuse, as KVM does when a guest uses LDP or a post-indexed store to a device. Do not rely on ISV for faults taken to EL1 or EL3.
  • VNCR = 1 means the fault was taken on a memory access that FEAT_NV2 generated by redirecting a guest hypervisor’s system register access to the page at VNCR_EL2. It was not a fault on the instruction’s operand.

Which address registers are valid

RegisterHoldsValid when
FAR_ELxFaulting VAInstruction and Data Aborts, PC alignment, watchpoints. Not valid if FnV = 1 (some External aborts). Not written for SError
HPFAR_EL2Faulting IPA (FIPA, bits [47:4] = IPA[55:12]; NS [63])Stage 2 faults taken to EL2: Translation, Access flag and Address size faults, and any fault with S1PTW = 1. For a stage 2 Permission fault that is not on a stage 1 walk, HPFAR_EL2 may be UNKNOWN
PFAR_ELx (FEAT_PFAR)Faulting PA, with NS/NSESynchronous External aborts and SErrors, when the syndrome’s PFV indication says it is valid. The address may be anywhere within an IMPLEMENTATION DEFINED naturally aligned granule

Notes on each:

  • FAR_ELx gives the VA only to page granularity in some cases. For accesses that span pages (unaligned, LDP, DC ZVA, SVE contiguous loads), it can hold an address inside the access other than its start. The FAR_ELx description in DDI0487 gives the exact rules. With TBI enabled, a Data Abort’s FAR includes the address tag. The exception is a synchronous MTE Tag Check fault, for which bits [63:60] are UNKNOWN unless FEAT_MTE_TAGGED_FAR is implemented (13.3).
  • HPFAR_EL2.FIPA holds only IPA[N:12]. The page offset comes from FAR_EL2[11:0]. When HPFAR_EL2 may be UNKNOWN (a stage 2 Permission fault), KVM recomputes the IPA by running AT S1E1R on FAR_EL2 (5.9). Some older cores had errata that made even the “valid” cases unreliable, for example Cortex-A57 erratum 834220, which KVM works around the same way.
  • FEAT_PFAR is an Armv8.9 extension, OPTIONAL from Armv8.8 (ID_AA64PFR1_EL1.PFAR). It provides PFAR_EL1, PFAR_EL2 and the PFAR_EL12 alias. Its main use is RAS: correlating a synchronous External abort with the memory controller’s error record without walking tables in the handler. Access from lower ELs is controlled by fine-grained traps (FEAT_FGT2).

Worked decode

ESR_EL1 = 0x0000_0000_9600_0045   FAR_EL1 = 0xffff_8000_1234_5678
  EC  [31:26] = 0x25   Data Abort, same EL
  IL  [25]    = 1      32-bit instruction
  ISV [24]    = 0      no syndrome (normal at EL1)
  WnR [6]     = 1      write
  DFSC[5:0]   = 0x05   Translation fault, level 1
=> a store to a TTBR1 address whose level 1 descriptor is invalid (bit[0] == 0, or a block
   encoding where the granule does not permit level 1 blocks). Read TTBR1_EL1 and walk: L0 index = VA[47:39], L1 index = VA[38:30].

ESR_EL3 = 0x8600_000F   FAR_EL3 = 0x0000_0000_0400_1000
  EC = 0x21 Instruction Abort, same EL;  IFSC = 0x0F  Permission fault, level 3
=> fetching from a page mapped XN at EL3 (or writable with SCTLR_EL3.WXN = 1).

Bring-up triage table

SymptomFirst suspectsConfirm with
Instruction Abort, IFSC 0x04–0x07, FAR = the instruction after MSR SCTLR_ELxThe code that enables the MMU is not identity-mapped. Or TTBR0 points at the wrong table, or T0SZ implies a different start level than the tables were built forWalk by hand from TTBRn using T0SZ (5.4). Before setting M, dry-run the same tables in the EL1&0 regime with AT S1E1R on the PC. AT S1E3R with SCTLR_EL3.M == 0 only reports the flat MMU-off mapping (5.9)
Data Abort, level 0 Translation fault right after MMU onTTBR0 vs TTBR1 range confusion, EPD0 = 1, or tables written with caches off but walked as cacheable, so the walker read stale linesTCR_ELx, TTBR values. Clean the tables to PoC or match the walk attributes (9.3)
Address size fault, level 0 (0x00)TTBR base above IPS/PS, or PS left at its reset valueTCR_ELx.PS/IPS against the DRAM base
Access flag fault (0x09–0x0B)Hand-built descriptor without bit 10Dump the leaf descriptor
Alignment fault (0x21) in early CData accesses with the MMU off are Device-nGnRnE; compiler-generated unaligned access or memcpy (build with -mstrict-align). Or DRAM mapped through a Device AttrIndxSCTLR_ELx.M/C, MAIR_ELx slot (6.5)
SEA on walk (0x14–0x17)Tables in DRAM before the controller is trained, or in memory a TZC/firewall blocks for the walk’s NS attributeInterconnect error logs. Move the tables to SRAM
Permission fault on a fetch at EL1/EL2PXN, WXN, the implicit PXN on EL0-writable pages, or the GCS/BTI page attributesISS2 bits, descriptor PXN/UXN, SCTLR_ELx.WXN
0x30 TLB conflictChanging block ↔ table, or the output address, without break-before-make9.2
0x35 on a spinlock before the MMU is onExclusive to Device or Non-cacheable memoryUse locks that do not need exclusives early (TF-A’s bakery lock, 10.4)
0x24–0x28 GPFGPT marks the PA for another PAS, or the GPT is not yet enabled correctlyGPCCR_EL3, GPTBR_EL3, the GPT entry for the PA
Guest stage 2 fault with S1PTW = 1The guest’s page tables live at an IPA that stage 2 does not mapHPFAR_EL2 gives the table’s IPA

More end-to-end examples are in 18.1, and the “dead after SCTLR.M = 1” playbook is in 18.3.

Validation note: Build a fault-matrix test. For each DFSC class you can provoke (Translation and Access flag at each level, Address size at level 0 via TTBR and at the leaf via OA, Permission with and without PAN, Alignment, TLB conflict by deliberately skipping BBM), make the vector handler log ESR, FAR, HPFAR/PFAR when relevant, and ELR, and compare them against an expected table. Pre-silicon, the common failures are a wrong level in LL (the model reports the level where it detected the fault, not the level of the invalid descriptor), S1PTW not set on stage 2 faults during a stage 1 walk, and FnV or FAR mismatches on External aborts. The harness pattern is in 18.5.

Checkpoint

Q5.8.1 BL31 sets SCTLR_EL3.M = 1. The next exception has ESR_EL3.EC = 0x21, IFSC 0x06, and FAR_EL3 equal to the address of the instruction after the MSR. What does this tell you first?

  • A. The ISB after the MSR is missing, so the old translation regime is still in use
  • B. The tables are fine, but MAIR_EL3 maps the code as Device, so it cannot be fetched
  • C. The instruction fetch after the enable found no valid descriptor at level 2: the running code is not mapped (usually not identity-mapped) in the new tables
  • D. The page is mapped but marked XN
Answer

C. EC 0x21 is an Instruction Abort at the same EL, and IFSC 0x06 is a Translation fault at level 2. The fetch of the next instruction, now translated, found an invalid level 2 descriptor. A is backwards: a fault on translation shows that the new regime is in use. D would be a Permission fault (0x0C–0x0F). B: fetching from Device memory that is not marked execute-never is CONSTRAINED UNPREDICTABLE, and the permitted outcomes do not include a Translation fault at the level where a valid descriptor exists.

Read more: Arm ARM (DDI0487), ESR_ELx ISS encoding for an exception from an Instruction Abort

Q5.8.2 A hypervisor gets a stage 2 Data Abort with S1PTW = 1, WnR = 1, DFSC 0x07. The guest executed a load. How should the hypervisor interpret this?

  • A. The guest’s stage 1 walk (possibly a hardware AF/dirty update to the guest table) touched an IPA with no valid stage 2 level 3 entry. HPFAR_EL2 gives that table’s IPA, and WnR describes the walker’s access, not the load
  • B. The load is to an MMIO region, so the hypervisor should emulate it using SRT
  • C. WnR = 1 with a load means that the syndrome is corrupt
  • D. It is a stage 1 fault and should be reinjected into the guest
Answer

A. S1PTW = 1 means that the stage 2 fault happened on the stage 1 walk, so the faulting IPA is a guest table address, reported in HPFAR_EL2. WnR reflects the walk access, which can be a write when the guest’s hardware AF/dirty management updates its descriptor. B would require the fault to be on the data access itself, with ISV = 1.

Read more: Arm ARM (DDI0487), ESR_EL2.ISS.S1PTW, HPFAR_EL2

Q5.8.3 Early firmware takes DFSC 0x15 on its first access to a DRAM-backed variable after turning on the MMU, with tables placed in DRAM. Which is the best first hypothesis?

  • A. The variable’s page is missing, so the fault is a Translation fault at level 1
  • B. The walker’s read of the level 1 table got an External abort: the DRAM holding the tables (or the path to it, such as a TZC region or an untrained controller) is not usable for that access
  • C. The leaf descriptor has AF = 0
  • D. IPS is too small for the DRAM address
Answer

B. 0x15 is a synchronous External abort on a translation table walk at level 1. The descriptor read failed, which says nothing about the descriptor’s contents. A Translation fault at level 1 would be 0x05, and an Address size fault would be 0x01. Check the memory controller and TZC configuration, or move the tables to SRAM to bisect.

Read more: Arm ARM (DDI0487), ESR_ELx.DFSC; 16.7