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:
| Lab | Runs on | What it does |
|---|---|---|
| 5.9 Debugging translation with AT and PAR_EL1 | QEMU virt or FVP, bare-metal at EL3 | Builds translation tables with deliberate faults and decodes each with AT S1E1R and PAR_EL1 |
| 7.11 Litmus testing from model to silicon | herd7, then litmus7 on QEMU, FVP and a board | Computes what the memory model allows, then measures what implementations do |
| 8.10 Validating coherency and cache maintenance | QEMU, FVP with cache-state modelling, and a board | Tests 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:
| Part | Assumes |
|---|---|
| 1 | nothing (start here on every path) |
| 2 | 1 |
| 3 | 2 |
| 4 | 2, 3 |
| 5 | 2, 3 |
| 6 | 5 |
| 7 | 3, 6 |
| 8 | 6, 7 |
| 9 | 5, 6, 7, 8 |
| 10 | 6, 7, 8 |
| 11 | 2, 3, 4, 5 |
| 12 | 2, 3, 4, 5, 8, 9 |
| 13 | 2, 3, 5, 6, 8 |
| 14 | 3, 6, 7, 9 |
| 15 | 2, 3, 7.8 |
| 16 | 2, 3, 7.8, 8 |
| 17 | 3, 4, 8, 9, 12 (17.1–17.3 can be read straight after Part 5) |
| 18 | 3, 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 Versions, FEAT_ names and discovery
- 1.3 Implementations and errata
- 2.5 System registers
- 2.6 The trap-control map
- 3.2 Entry and return
- 3.3 Routing and masking
- 3.4 SError, architecturally
Interrupts and timers
- 4.1 GICv3 architecture
- 4.2 Interrupt types and lifecycle
- 4.3 Groups, security and priority
- 4.4 LPIs and the ITS
- 4.5 GIC bring-up and the interrupt-never-arrives checklist
- 4.6 The Generic Timer
- 4.7 Reading time correctly
Translation, then early boot
- 5.1 Translation regimes and stages
- 5.2 TCR_ELx and TCR2_ELx
- 5.3 Descriptors and walk mechanics
- 5.8 MMU faults and how to decode them
- 5.9 Lab: debugging translation with AT and PAR_EL1
- 17.1 Reset
- 17.2 Initialising EL3
- 17.3 The EL3 feature-enable checklist
The memory system as firmware sees it
- 6.1 A hardware mental model (non-architectural)
- 6.5 MAIR_ELx and AttrIndx
- 7.5 DMB
- 7.6 DSB
- 7.7 Acquire/release as one-way barriers
- 7.8 Context synchronization and ISB
- 7.9 Device memory ordering
- 7.10 Ordering patterns
- 8.4 Points of coherency and beyond
- 8.5 Data cache maintenance
- 8.6 Instruction cache maintenance and cross-modifying code
- 8.7 DMA and non-coherent masters
- 8.8 Caches at power transitions
- 9.1 TLBs and TLB maintenance
- 9.2 Break-before-make and FEAT_BBM
- 9.3 Turning the MMU and caches on
- 10.4 Waiting and locking
Firmware interfaces, debug access and the rest of boot
- 12.2 The architectural contract of a secure boot chain
- 12.3 Firmware interfaces
- 16.2 External debug and CoreSight
- 17.4 Secondary cores and CPU power states
- 17.5 Multi-chiplet bring-up
- 17.6 Handing off to the OS
When it breaks
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.
- 6.1 A hardware mental model (non-architectural)
- 6.2 Normal and Device memory
- 6.3 Cacheability
- 6.4 Shareability
- 6.5 MAIR_ELx and AttrIndx
- 6.6 Mismatched attributes and aliases
- 7.1 Observers, “observed by” and “completes”
- 7.2 Single-copy and multi-copy atomicity
- 7.3 Litmus tests
- 7.4 Dependencies
- 7.5 DMB
- 7.6 DSB
- 7.7 Acquire/release as one-way barriers
- 7.8 Context synchronization and ISB
- 7.9 Device memory ordering
- 7.10 Ordering patterns
- 7.11 Lab and exercises: litmus testing from model to silicon
- 8.1 Cache organisation
- 8.2 Hardware coherency concepts
- 8.3 Coherency at system scale: instructions to transactions
- 8.4 Points of coherency and beyond
- 8.5 Data cache maintenance
- 8.6 Instruction cache maintenance and cross-modifying code
- 8.7 DMA and non-coherent masters
- 8.8 Caches at power transitions
- 8.9 MPAM: resource partitioning and monitoring
- 8.10 Lab and exercises: validating coherency and cache maintenance
- 9.1 TLBs and TLB maintenance
- 9.2 Break-before-make and FEAT_BBM
- 9.3 Turning the MMU and caches on
- 10.1 Exclusives
- 10.2 LSE atomics (FEAT_LSE)
- 10.3 Wide and unaligned accesses
- 10.4 Waiting and locking
- 14.1 How speculation is modelled and what it attacks
- 14.2 Speculation and the memory system
- 13.3 Who owns the upper address bits
- 13.4 MTE architecture
- 13.5 MTE tag checking
- 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.
- 2.1 Exception levels, Security states and execution states
- 5.5 Access permissions
- 11.5 The SMMU (SMMUv3)
- 12.1 TrustZone-A recap, precisely
- 12.2 The architectural contract of a secure boot chain
- 12.3 Firmware interfaces
- 12.4 RME and Arm CCA
- 12.5 Memory Encryption Contexts (FEAT_MEC)
- 13.1 Pointer Authentication and BTI
- 13.2 Guarded Control Stack and Translation Hardening
- 13.3 Who owns the upper address bits
- 13.4 MTE architecture
- 13.5 MTE tag checking
- 13.6 MTE in a system
- 14.1 How speculation is modelled and what it attacks
- 14.2 Speculation and the memory system
- 14.3 Spectre v1 (bounds check bypass)
- 14.4 Spectre v2 and BHB
- 14.5 Spectre v4 (speculative store bypass)
- 14.6 Meltdown-class leaks
- 14.7 Prediction isolation on a world switch
- 14.8 Exercises: auditing for missing mitigations
- 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 Versions, FEAT_ names and discovery
- 1.2 What Armv9-A actually changed
- 1.3 Implementations and errata
- 6.1 A hardware mental model (non-architectural)
- 7.1 Observers, “observed by” and “completes”
- 7.2 Single-copy and multi-copy atomicity
- 7.3 Litmus tests
- 7.11 Lab and exercises: litmus testing from model to silicon
- 8.2 Hardware coherency concepts
- 8.3 Coherency at system scale: instructions to transactions
- 8.9 MPAM: resource partitioning and monitoring
- 8.10 Lab and exercises: validating coherency and cache maintenance
- 9.1 TLBs and TLB maintenance
- 16.2 External debug and CoreSight
- 16.3 PMUv3
- 16.4 Activity Monitors (AMU)
- 16.5 The PMU as a validation instrument
- 16.6 Profiling and trace
- 16.7 RAS architecture
- 16.8 RAS handling and error injection
- 17.5 Multi-chiplet bring-up
- 18.1 Decoding a crash end to end
- 18.2 Triage of a hung core
- 18.3 Bring-up failure signatures
- 18.4 Pre-silicon environments and their blind spots
- 18.5 Writing directed architectural tests
- 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.
| Part | B | M | S | V |
|---|---|---|---|---|
| 1. The architecture landscape | 1.1, 1.3 | all | ||
| 2. AArch64 programmer’s model | 2.5, 2.6 | 2.1 | ||
| 3. The exception model | 3.2, 3.3, 3.4 | |||
| 4. Interrupts and timers | all | |||
| 5. Virtual memory I: translation structure | 5.1, 5.2, 5.3, 5.8, 5.9 | 5.5 | ||
| 6. Memory types and attributes | 6.1, 6.5 | all | 6.1 | |
| 7. The memory ordering model | 7.5, 7.6, 7.7, 7.8, 7.9, 7.10 | all | 7.1, 7.2, 7.3, 7.11 | |
| 8. Caches and coherency | 8.4, 8.5, 8.6, 8.7, 8.8 | all | 8.2, 8.3, 8.9, 8.10 | |
| 9. Virtual memory II: maintaining translations | all | all | 9.1 | |
| 10. Atomics and synchronization | 10.4 | all | ||
| 11. Virtualization | 11.5 | |||
| 12. Secure world, firmware and RME | 12.2, 12.3 | all | ||
| 13. Hardening features | 13.3, 13.4, 13.5, 13.6 | all | ||
| 14. Speculation and side channels | 14.1, 14.2 | all | ||
| 15. SIMD, FP, SVE and SME | ||||
| 16. Debug, trace, PMU and RAS | 16.2 | 16.2, 16.3, 16.4, 16.5, 16.6, 16.7, 16.8 | ||
| 17. Boot and system bring-up | all | 17.3 | 17.5 | |
| 18. Debugging, validation and compliance | 18.1, 18.2, 18.3 | all |
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
sor/. 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_commonmacro or Linux’sarch/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.