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

Part 6: Memory types and attributes

Prerequisites: 5.1, 5.2 and 5.3 (translation regimes, TCR_ELx walk attributes, and where AttrIndx and SH sit in a descriptor).

If you already know: the Device G/R/E types and the MAIR encodings, skim 6.2, 6.3 and the encoding tables in 6.5. Do not skip 6.1, the “always Outer Shareable” rule in 6.4, the MMU-off consequences in 6.5, or 6.6, because Parts 7, 8, 9 and 14 build directly on them.

Why this matters for bring-up/validation: most “works on the model, fails on silicon” memory bugs in early firmware come from an attribute that permits more than the code assumed: speculation, merging, a narrower shareability domain, or a stale line created under different attributes.

Part 6 is the first of the deep-dive memory-system parts. It answers a question that Part 5 left open: once a translation succeeds, what is the PE allowed to do with the access?

6.1 starts with an explicitly non-architectural picture of a core and its interconnect: pipelines, store buffers, line-fill buffers, write buffers and home nodes. With that picture you can see where an access is “in flight”, and later parts refer back to it whenever an architectural rule needs an intuition. 6.2 to 6.4 then define the attributes precisely:

  • the Normal and Device memory types, and what each permits in speculation, merging, reordering and repetition;
  • Inner and Outer cacheability, with its allocation and transience hints;
  • the three shareability domains, including the rule that Device and Normal Non-cacheable accesses are always Outer Shareable, and what that rule means for DMB ISH versus DMB OSH around MMIO.

The last two sections are where bring-up bugs live. 6.5 covers MAIR_ELx and the fixed memory types that apply while the MMU or the D-cache is off. These defaults explain the classic early-boot faults: alignment faults, DC ZVA faults, unreliable exclusives, and why TF-A builds with -mstrict-align. 6.6 covers mismatched attributes and aliases. It explains what DDI0487 guarantees and what it does not, the rules Linux follows, and a case study of the cache maintenance needed when data crosses between caches-off and caches-on code, or between a non-coherent master and a PE. The full treatment of ordering is in Part 7, of caches and maintenance in Part 8, and of the stage 1/stage 2 attribute combination in 11.3.