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

How to use this book

The book is meant to be read selectively. Each part says at its top what it assumes and what you can skip, and the four reading paths below give explicit section lists for the four reasons you are most likely to be reading it.

What a section looks like

Each section is a 5–10 minute read (labs, exercise sets and some deep-dive sections run longer), and covers one topic at register level. A section usually contains:

  • The rule, stated in the Arm ARM’s terms, followed by the reason for it. For the memory model, the reason is usually an observable outcome that the rule permits or forbids.
  • Register and field tables for the controls involved, with bit positions where they are stable across issues.
  • A short example. A64 code is written in GNU assembler syntax, firmware code in C, and Arm pseudocode (ASL) or layout diagrams in plain text blocks. Examples are kept minimal and are meant to be correct as written, not illustrative pseudo-assembly.
  • Callouts (below) where the topic has a direct bring-up, security or validation consequence.
  • A Checkpoint of 2–3 questions at the end.

Each part opens with a three-line block:

  • Prerequisites: the sections the part assumes, as links.
  • If you already know: what you can skim or skip, and which subsections not to skip even if the topic is familiar.
  • Why this matters for bring-up/validation: one sentence on why the part is worth your time.

Parts 3, 4 and 12 are marked Review part. They cover the reader’s strong areas and are concise and register-precise rather than introductory. Parts 6–10 and 14 are the deep-dive parts. They go slowly, define each term before using it, and use litmus tests and worked sequences to show why a rule exists.

Callouts

Three kinds of callout are used, and only where they add something:

Bring-up note: A consequence for early firmware or first silicon. Typical content: a reset value that is UNKNOWN and must be written, an enable bit that EL3 must set before a lower EL can use a feature, or a sequence that works on a model but not on hardware.

Security note: A consequence for isolation between Exception levels, Security states or worlds. Typical content: state that leaks across a world switch if it is not saved, cleared or invalidated, or a trap that must be enabled for a guarantee to hold.

Validation note: How to test the rule. It says what to run, what a failure looks like (a hang, a stale value, a fault syndrome, a litmus outcome that should be impossible) and which register or PMU event confirms the result. Parts 5–10, 14 and 16 each contain at least one.

Checkpoint quizzes

Each section ends with a Checkpoint of 2–3 multiple-choice questions, numbered Q<part>.<section>.<n>. Each has exactly one defensible answer, and the wrong options are chosen to be plausible misconceptions. The questions test reasoning about sequences and outcomes rather than recall.

  • Click an option (or focus it with Tab and press Enter or Space). The book marks your choice right or wrong, shows the correct option and opens the explanation. The explanation ends with a Read more pointer into the Arm ARM or a companion specification.
  • Your answer is saved only in your browser, in local storage, keyed by page and question. Nothing is sent anywhere. Returning to the page shows your earlier answer. Clearing site data, using a private window, or switching browsers or machines starts you afresh.
  • Try again appears under an answered question. It clears the saved answer for that question and lets you choose again.
  • Without JavaScript, the questions render as plain lists, and the Answer disclosure under each one holds the answer and its explanation.

A wrong answer is useful information. Most distractors are a rule that holds on some other architecture, in some other context, or on most implementations without being guaranteed. Reread the explanation of why the tempting option is wrong.

Labs

Parts 5, 7 and 8 end with a runnable lab:

LabRuns onWhat it does
5.9 Debugging translation with AT and PAR_EL1QEMU virt or FVP, bare-metal at EL3Builds translation tables with deliberate faults and decodes each with AT S1E1R and PAR_EL1
7.11 Litmus testing from model to siliconherd7, then litmus7 on QEMU, FVP and a boardComputes what the memory model allows, then measures what implementations do
8.10 Validating coherency and cache maintenanceQEMU, FVP with cache-state modelling, and a boardTests with checkers and PMU fingerprints, each run again with the maintenance removed

Lab setup covers installation, a minimal bare-metal EL3 image that the labs build on, and the labs/partNN/ directory layout. Each lab says when a step needs real hardware. Read 18.4 before trusting a model result: QEMU does not model caches or a weak memory order, and the FVP models cache state only when asked and never reorders memory accesses.

Exercises

7.11, 8.10 and 14.8 contain applied exercises. Most take the form “here is a sequence from firmware or a driver: which barrier, maintenance operation or mitigation is missing, and why?” Each answer is collapsed under an Answer disclosure. Write your answer down before you open it, because the value is in having to state the reason. The answers name the minimum sufficient sequence and explain why stronger but common alternatives are unnecessary or still insufficient.

How the parts depend on each other

Read the diagram from the top. A part assumes every part above it on its own line of descent, and A --> B means that B assumes A. A note such as (+7.8) lists further prerequisites that the lines do not show. Only the main dependencies appear. Each part’s opener lists the exact prerequisite sections.

[1] Landscape: versions, FEAT_, ID registers
 |
[2] AArch64 programmer's model
 |
[3] Exception model (review) --------------> [15] SIMD, FP, SVE, SME (+7.8)
 |
 +---------------------------+
 |                           |
[4] GIC and timers (review) [5] VM I: translation ------> [11] Virtualization (+4)
 |                           |
 |                          [6] Memory types and attributes
 |                           |
 |                          [7] Memory ordering model
 |                           |
 |                          [8] Caches and coherency --+--> [10] Atomics
 |                           |                         +--> [13] Hardening, MTE
 |                           |                         +--> [16] Debug, trace, PMU, RAS
 |                          [9] VM II: TLBs, BBM, MMU on
 |                           |
 |                           +--> [14] Speculation
 |                           +--> [18] Debugging, validation, compliance (+16)
 |                           |
 +------------------------> [12] Secure world, firmware, RME
                             |
                            [17] Boot and bring-up

The same graph as a table, for searching:

PartAssumes
1nothing (start here on every path)
21
32
42, 3
52, 3
65
73, 6
86, 7
95, 6, 7, 8
106, 7, 8
112, 3, 4, 5
122, 3, 4, 5, 8, 9
132, 3, 5, 6, 8
143, 6, 7, 9
152, 3, 7.8
162, 3, 7.8, 8
173, 4, 8, 9, 12 (17.1–17.3 can be read straight after Part 5)
183, 5, 9, 16

Reading paths

Four paths, each an explicit, ordered list of sections. They overlap. A section on more than one path is written to serve all of them. Every path assumes you have read this page and Reading the Arm ARM. Lab setup is needed only for the labs on that path.

B: bring-up

For bringing up firmware on a new SoC or a new core: from reset to a booted OS, and debugging what goes wrong along the way. 17.1–17.3 come directly after Part 5. They use forward references into Parts 8 and 9, which you can follow or leave for later.

Foundations

  1. 1.1 Versions, FEAT_ names and discovery
  2. 1.3 Implementations and errata
  3. 2.5 System registers
  4. 2.6 The trap-control map
  5. 3.2 Entry and return
  6. 3.3 Routing and masking
  7. 3.4 SError, architecturally

Interrupts and timers

  1. 4.1 GICv3 architecture
  2. 4.2 Interrupt types and lifecycle
  3. 4.3 Groups, security and priority
  4. 4.4 LPIs and the ITS
  5. 4.5 GIC bring-up and the interrupt-never-arrives checklist
  6. 4.6 The Generic Timer
  7. 4.7 Reading time correctly

Translation, then early boot

  1. 5.1 Translation regimes and stages
  2. 5.2 TCR_ELx and TCR2_ELx
  3. 5.3 Descriptors and walk mechanics
  4. 5.8 MMU faults and how to decode them
  5. 5.9 Lab: debugging translation with AT and PAR_EL1
  6. 17.1 Reset
  7. 17.2 Initialising EL3
  8. 17.3 The EL3 feature-enable checklist

The memory system as firmware sees it

  1. 6.1 A hardware mental model (non-architectural)
  2. 6.5 MAIR_ELx and AttrIndx
  3. 7.5 DMB
  4. 7.6 DSB
  5. 7.7 Acquire/release as one-way barriers
  6. 7.8 Context synchronization and ISB
  7. 7.9 Device memory ordering
  8. 7.10 Ordering patterns
  9. 8.4 Points of coherency and beyond
  10. 8.5 Data cache maintenance
  11. 8.6 Instruction cache maintenance and cross-modifying code
  12. 8.7 DMA and non-coherent masters
  13. 8.8 Caches at power transitions
  14. 9.1 TLBs and TLB maintenance
  15. 9.2 Break-before-make and FEAT_BBM
  16. 9.3 Turning the MMU and caches on
  17. 10.4 Waiting and locking

Firmware interfaces, debug access and the rest of boot

  1. 12.2 The architectural contract of a secure boot chain
  2. 12.3 Firmware interfaces
  3. 16.2 External debug and CoreSight
  4. 17.4 Secondary cores and CPU power states
  5. 17.5 Multi-chiplet bring-up
  6. 17.6 Handing off to the OS

When it breaks

  1. 18.1 Decoding a crash end to end
  2. 18.2 Triage of a hung core
  3. 18.3 Bring-up failure signatures

M: memory system

For the reader whose weak spot is the memory system: Parts 6–10 in order, then speculation’s effect on the memory system, then the parts of MTE and address tagging that depend on it. This path assumes you can read a translation table descriptor. If you cannot yet, read 5.1–5.3 first.

  1. 6.1 A hardware mental model (non-architectural)
  2. 6.2 Normal and Device memory
  3. 6.3 Cacheability
  4. 6.4 Shareability
  5. 6.5 MAIR_ELx and AttrIndx
  6. 6.6 Mismatched attributes and aliases
  7. 7.1 Observers, “observed by” and “completes”
  8. 7.2 Single-copy and multi-copy atomicity
  9. 7.3 Litmus tests
  10. 7.4 Dependencies
  11. 7.5 DMB
  12. 7.6 DSB
  13. 7.7 Acquire/release as one-way barriers
  14. 7.8 Context synchronization and ISB
  15. 7.9 Device memory ordering
  16. 7.10 Ordering patterns
  17. 7.11 Lab and exercises: litmus testing from model to silicon
  18. 8.1 Cache organisation
  19. 8.2 Hardware coherency concepts
  20. 8.3 Coherency at system scale: instructions to transactions
  21. 8.4 Points of coherency and beyond
  22. 8.5 Data cache maintenance
  23. 8.6 Instruction cache maintenance and cross-modifying code
  24. 8.7 DMA and non-coherent masters
  25. 8.8 Caches at power transitions
  26. 8.9 MPAM: resource partitioning and monitoring
  27. 8.10 Lab and exercises: validating coherency and cache maintenance
  28. 9.1 TLBs and TLB maintenance
  29. 9.2 Break-before-make and FEAT_BBM
  30. 9.3 Turning the MMU and caches on
  31. 10.1 Exclusives
  32. 10.2 LSE atomics (FEAT_LSE)
  33. 10.3 Wide and unaligned accesses
  34. 10.4 Waiting and locking
  35. 14.1 How speculation is modelled and what it attacks
  36. 14.2 Speculation and the memory system
  37. 13.3 Who owns the upper address bits
  38. 13.4 MTE architecture
  39. 13.5 MTE tag checking
  40. 13.6 MTE in a system

S: security

For TEE, hypervisor and platform-security work: isolation boundaries, the secure-world and Realm architecture, hardening features and speculation. This path assumes the exception model from Part 3, which this reader is expected to know already.

  1. 2.1 Exception levels, Security states and execution states
  2. 5.5 Access permissions
  3. 11.5 The SMMU (SMMUv3)
  4. 12.1 TrustZone-A recap, precisely
  5. 12.2 The architectural contract of a secure boot chain
  6. 12.3 Firmware interfaces
  7. 12.4 RME and Arm CCA
  8. 12.5 Memory Encryption Contexts (FEAT_MEC)
  9. 13.1 Pointer Authentication and BTI
  10. 13.2 Guarded Control Stack and Translation Hardening
  11. 13.3 Who owns the upper address bits
  12. 13.4 MTE architecture
  13. 13.5 MTE tag checking
  14. 13.6 MTE in a system
  15. 14.1 How speculation is modelled and what it attacks
  16. 14.2 Speculation and the memory system
  17. 14.3 Spectre v1 (bounds check bypass)
  18. 14.4 Spectre v2 and BHB
  19. 14.5 Spectre v4 (speculative store bypass)
  20. 14.6 Meltdown-class leaks
  21. 14.7 Prediction isolation on a world switch
  22. 14.8 Exercises: auditing for missing mitigations
  23. 17.3 The EL3 feature-enable checklist

V: silicon validation

For pre-silicon and post-silicon validation: what the architecture permits (so you know what counts as a bug), how coherency becomes transactions, the instruments (PMU, AMU, trace, RAS), and how to write tests that can fail. This path assumes the ordering and coherency vocabulary of Parts 6–8. If those are new to you, take the M path through Part 8 first.

  1. 1.1 Versions, FEAT_ names and discovery
  2. 1.2 What Armv9-A actually changed
  3. 1.3 Implementations and errata
  4. 6.1 A hardware mental model (non-architectural)
  5. 7.1 Observers, “observed by” and “completes”
  6. 7.2 Single-copy and multi-copy atomicity
  7. 7.3 Litmus tests
  8. 7.11 Lab and exercises: litmus testing from model to silicon
  9. 8.2 Hardware coherency concepts
  10. 8.3 Coherency at system scale: instructions to transactions
  11. 8.9 MPAM: resource partitioning and monitoring
  12. 8.10 Lab and exercises: validating coherency and cache maintenance
  13. 9.1 TLBs and TLB maintenance
  14. 16.2 External debug and CoreSight
  15. 16.3 PMUv3
  16. 16.4 Activity Monitors (AMU)
  17. 16.5 The PMU as a validation instrument
  18. 16.6 Profiling and trace
  19. 16.7 RAS architecture
  20. 16.8 RAS handling and error injection
  21. 17.5 Multi-chiplet bring-up
  22. 18.1 Decoding a crash end to end
  23. 18.2 Triage of a hung core
  24. 18.3 Bring-up failure signatures
  25. 18.4 Pre-silicon environments and their blind spots
  26. 18.5 Writing directed architectural tests
  27. 18.6 Conformance and platform standards

Which parts each path uses

“all” means the whole part. An empty cell means the path does not use the part.

No path covers Part 15 or most of Part 11. Read 15.3 if you write EL3 or EL2 code on a core with SVE or SME, and Part 11 when you work on a hypervisor or need the stage 2 and SMMU material in full.

Other conventions

  • Search with the magnifying glass or by pressing s or /. Register names are searchable: HCR_EL2, TCR2_EL1.
  • Linux and TF-A references name a function or file, such as TF-A’s el3_entrypoint_common macro or Linux’s arch/arm64/include/asm/tlbflush.h, so you can find it in any recent tree. They are mappings, not specifications. When the code and the Arm ARM disagree, the Arm ARM wins, and the difference is usually a deliberate implementation choice or a workaround for an erratum.
  • Appendices (feature timeline, register cheat sheet, barrier and maintenance recipes, ESR decode card, bring-up checklists, glossary, references) collect lookup material that the parts link to.