/arm-architecture-deep-dive:arm-aarch64-exception-levels-memory-model-and-mmufrom arm-architecture-deep-dive
Covers AArch64 register/instruction design vs AArch32, exception levels EL0-EL3, weak memory model with barriers and acquire-release semantics, and MMU translation regimes, page table formats, and TLB behaviour.
Ships in arm-architecture-deep-dive. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Part 2 of 6 of the ARM: A Deep Dive reference (plugin
arm-architecture-deep-dive), covering §5–§9. Sibling skills:arm-what-arm-is-licensing-families-and-isa-generations(§0–§4),arm-vectors-atomics-numerics-and-security-architecture(§10–§15),arm-system-architecture-boot-and-virtualization(§16–§20),arm-cortex-m-toolchain-porting-and-performance(§21–§25),arm-reference(§26–§31). Section numbers are shared across the set; a reference written as §N →skillpoints into that sibling skill.Currency: The architecture is documented and stable. Two things moved decisively. See §26 →
arm-referencefor Arm's business model, and its actual market position.
⚠️ ARM is a business model as much as an instruction set, and you cannot understand the architecture without understanding that. ⚠️ The design choices — modularity, optional extensions, profiles, strict architectural compliance — exist because the ISA has to be implementable by dozens of independent companies at wildly different power and performance points.
Builds on a microarchitecture reference (§20 ISA design, §8 memory consistency) and a semiconductor reference. Complements a digital-logic reference for the boot chain and a computer-hardware reference for the datacentre context.
⚠️ GOTCHA boxes mark where ARM differs from x86 in ways that break assumptions.
The three ideas that organize this document:
- ⚠️ THE ARCHITECTURE IS A CONTRACT, NOT A CHIP (§1 →
arm-what-arm-is-licensing-families-and-isa-generations, §4 →arm-what-arm-is-licensing-families-and-isa-generations). "ARM" names a specification that Apple, Qualcomm, Amazon and a microcontroller vendor all implement completely differently. Statements about "ARM performance" are usually category errors.- ⚠️ THE WEAK MEMORY MODEL IS THE MOST CONSEQUENTIAL DIFFERENCE FROM x86 (§8, §23 →
arm-cortex-m-toolchain-porting-and-performance). Concurrent code that is correct on x86-TSO can be silently broken on ARM with no source change. This is the single most common real porting failure and it produces intermittent bugs.- ⚠️ SECURITY IS ARCHITECTED, NOT BOLTED ON (§13–§15 →
arm-vectors-atomics-numerics-and-security-architecture). TrustZone, pointer authentication, BTI, MTE and CCA are architectural features with silicon support — which is genuinely different from mitigation-by-software, and it is a large part of why ARM won mobile.
⚠️ A clean-sheet design, and its choices are instructive because they were made with forty years of hindsight.
⚠️ REGISTERS ⚠️ 31 general-purpose (X0-X30, or W0-W30 for
32-bit views), ⚠️ plus a ZERO REGISTER (XZR/WZR) and a
separate stack pointer
⚠️ COMPARE x86-64's 16 — ⚠️ more registers means less
spilling, and it is one of the genuine ISA-level differences
⚠️ ⚠️ WHAT AArch64 DELIBERATELY REMOVED from AArch32
⚠️ CONDITIONAL EXECUTION on nearly every instruction —
⚠️ ARM's famous feature, dropped because it complicates
out-of-order register renaming badly
⚠️ ⚠️ THE PC AS A GENERAL REGISTER — ⚠️ AArch32 let you write
to r15 and branch. Elegant, and a nightmare for
implementation and security
⚠️ Load/store multiple with arbitrary register lists
⚠️ The barrel shifter on every operand (⚠️ retained in
reduced form)
⚠️ WHAT IT KEPT ⚠️ FIXED 32-BIT INSTRUCTION LENGTH (⚠️ which
makes parallel DECODE far easier than x86's variable
length — see a microarchitecture reference §20) ·
load/store architecture · condition flags (NZCV) ·
⚠️ conditional SELECT instructions (CSEL) replacing
predication
⚠️ ADDRESSING MODES base+offset, pre/post-indexed, scaled
register, PC-relative — ⚠️ and PC-relative addressing plus
ADRP is how position-independent code works efficiently
⚠️ Load/store architecture — ⚠️ arithmetic operates on registers only, so memory
access is explicit; this makes the memory model (§8) analyzable.
⚠️ Load/store PAIR (LDP/STP) — ⚠️ two registers in one instruction, heavily used in
prologues and epilogues.
⚠️ CSEL and the conditional-select family — ⚠️ branchless selection without full
predication.
⚠️ Bitfield instructions (UBFX, SBFX, BFI) — ⚠️ single-instruction extract and insert,
notably better than the x86 equivalents.
⚠️ Encoding constraints: ⚠️ immediates are limited by the fixed 32-bit width, so large
constants need MOVZ/MOVK sequences or a literal pool — ⚠️ which is why disassembly shows
apparently redundant instruction pairs.
⚠️ System registers are accessed via MRS/MSR, ⚠️ and the naming convention
(REG_ELx) tells you which exception level owns it (§7).
⚠️ Code density: ⚠️ AArch64 is denser than fixed-32-bit RISC traditionally was but
less dense than Thumb-2 or x86 — a deliberate trade for decode simplicity.
⚠️ The privilege model, and it is cleaner than x86's rings.
⚠️ THE LEVELS ⚠️ EL0 (applications) · EL1 (OS kernel) ·
⚠️ EL2 (HYPERVISOR) · ⚠️ EL3 (SECURE MONITOR — the highest,
and where the world switch happens, §13)
⚠️ ⚠️ EL2 EXISTING AS AN ARCHITECTED LEVEL is the key difference
from x86, where virtualization was retrofitted. ⚠️ The
hypervisor has its own level, its own registers and its own
translation regime by design (§20)
⚠️ ⚠️ ORTHOGONAL TO THIS: SECURITY STATE (§13). ⚠️ Secure and
Non-secure worlds each have their own EL0/EL1, so the
privilege model is TWO-DIMENSIONAL. ⚠️ ARMv9's CCA adds a
third dimension with Realm state (§15)
⚠️ EXCEPTION HANDLING ⚠️ a VECTOR TABLE indexed by exception
type AND by the level/state the exception came from ·
⚠️ ELR (return address), SPSR (saved state), ESR (⚠️ the
syndrome register, which tells you WHY — enormously useful
for debugging)
⚠️ ⚠️ EXCEPTIONS ROUTE UPWARD, and where they route is
CONFIGURABLE via HCR_EL2 and SCR_EL3 — ⚠️ which is what lets
a hypervisor trap and emulate specific guest operations
⚠️ SYNCHRONOUS vs asynchronous (IRQ, FIQ, SError) ·
⚠️ FIQ historically the fast interrupt, now largely used for
secure-world interrupts
⚠️ §1 →
arm-what-arm-is-licensing-families-and-isa-generations's second organizing idea, and the thing most likely to bite you. See a microarchitecture reference §8 for consistency models generally.
⚠️ ⚠️ ARM IS WEAKLY ORDERED. ⚠️ Loads and stores can be reordered
far more freely than on x86-TSO — ⚠️ store-store, load-load,
load-store and store-load reordering are all permitted where
no dependency exists
⚠️ ⚠️ THE PRACTICAL CONSEQUENCE: CONCURRENT CODE THAT IS CORRECT
ON x86 CAN BE BROKEN ON ARM WITH NO SOURCE CHANGE. ⚠️ x86's
stronger model HIDES missing synchronization. ⚠️ The bugs are
intermittent, load-dependent and hard to reproduce
⚠️ THE BARRIERS
⚠️ DMB data memory barrier — orders memory accesses
⚠️ DSB data synchronization barrier — stronger, waits for
completion
⚠️ ISB instruction synchronization barrier — ⚠️ needed after
changing system state that affects instruction fetch
⚠️ Each takes a SHAREABILITY DOMAIN and access-type qualifier
(ISH, OSH, NSH; LD, ST) — ⚠️ using the weakest sufficient
variant matters for performance
⚠️ ⚠️ ACQUIRE/RELEASE IS BUILT INTO THE INSTRUCTIONS
⚠️ LDAR (load-acquire) and STLR (store-release) — ⚠️ ordering
semantics without a separate barrier, and generally FASTER
than a full DMB. ⚠️ This is the idiom to use
⚠️ ⚠️ ADDRESS, DATA AND CONTROL DEPENDENCIES provide some
ordering for free — ⚠️ and relying on them is subtle and
compiler-hostile, because the compiler may optimize the
dependency away
⚠️ MEMORY TYPES ⚠️ NORMAL (cacheable, reorderable, speculatable)
vs ⚠️ DEVICE (nGnRnE through nGRE — ⚠️ device memory
attributes control gathering, reordering and early
acknowledgement, and getting these wrong on MMIO causes
baffling driver bugs)
⚠️ CACHE MAINTENANCE ⚠️ ARM requires explicit cache maintenance
in places x86 does not, particularly for ⚠️ SELF-MODIFYING
CODE and JITs — ⚠️ instruction and data caches are not
coherent, so a JIT must clean D-cache and invalidate I-cache
⚠️ Translation regimes are per exception level and per security state, ⚠️ which is why
there are so many system registers.
⚠️ TTBR0 and TTBR1 — ⚠️ two base registers split by address range, so user and kernel
mappings live in separate tables and a context switch changes only TTBR0. ⚠️ This is
architecturally cleaner than the x86 arrangement and made Meltdown-style page-table
isolation cheaper.
⚠️ Granule sizes of 4 KB, 16 KB and 64 KB — ⚠️ note that 16 KB is what Apple uses, and
it is a real source of porting friction for code that assumes 4 KB pages.
⚠️ Multi-level tables, up to 4 or 5 levels, ⚠️ with configurable address size (TCR).
⚠️ ASIDs and VMIDs avoid TLB flushes on context and VM switch.
⚠️ STAGE 2 TRANSLATION is the virtualization feature (§20 → arm-system-architecture-boot-and-virtualization): ⚠️ the guest's "physical"
address is translated again by the hypervisor's tables — architected, not emulated.
⚠️ TLB maintenance is explicit and has broadcast variants, ⚠️ and TLBI instructions
plus the required DSB/ISB sequencing are a classic source of subtle kernel bugs.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
aarch64, arm-architecture, exception-levels, memory-model, mmu
Other plugins' skills for the same job
6 skills in this plugin
/arm-cortex-m-toolchain-porting-and-performanceUse when actually building or moving software onto ARM: Cortex-M and the embedded profile with its interrupt model and memory protection, the toolchain and ABI including calling conventions and the AAPCS, porting from x86 and the memory-ordering, intrinsics and undefined-behaviour traps that bite, performance analysis with PMU counters and the ARM-specific pitfalls, and the competitive landscape against x86 and RISC-V./arm-referenceUse when correcting an ARM misconception, looking up a register, exception level, cache, extension or performance figure, finding the sources, or needing a quick-reference picker — plus the current state of Arm's business model and its actual market position. Companion to the other ARM skills./arm-system-architecture-boot-and-virtualizationUse for the system level around the core: big.LITTLE and DynamIQ heterogeneous topologies and their scheduling consequences, interrupts and timers with the GIC generations, interconnect and the AMBA protocol family with coherency, boot and firmware on ARM including the trusted firmware stages and how it differs from x86, and virtualization with stage-2 translation and the hypervisor exception level.npx claudepluginhub the-vibey-project/vibey --plugin arm-architecture-deep-dive