7.1 Observers, “observed by” and “completes”
DDI0487 specifies the memory model, and every barrier, in terms of a small set of defined words: observer, observed, globally observed, complete, Coherence order, Reads-from. Pipeline vocabulary such as “drained”, “retired”, “flushed” or “hit the bus” appears nowhere in the normative text. Before reading a barrier rule, translate it into these terms. This section defines them and ties each one to the non-architectural hardware picture in 6.1. That picture explains why a rule exists. It is never a substitute for the rule.
Observers
An observer is any agent that can issue reads or writes to memory: a PE, a DMA engine, a GPU, an accelerator, or a debugger acting through a memory access port. A shareability domain (6.4) is just a named set of observers. Every barrier with a domain option (ISH, OSH, NSH, SY) is a statement about the observers in that set.
A single PE generates more than one stream of memory effects, and the model treats them differently:
| Stream | Model term | Ordered by DMB/DSB like loads and stores? |
|---|---|---|
LDR/STR/atomics/LDAR etc. | Explicit accesses (Exp in aarch64.cat) | Yes |
| Instruction fetch | Implicit, instruction-fetch effects | No; needs IC maintenance and ISB (8.6) |
| Translation table walks | Implicit, TTD reads (and hardware AF/DBM writes) | Only through specific rules (DSB, CSE, FEAT_ETS2) (9.1) |
| MTE allocation-tag reads | Implicit tag effects | Through specific rules (13.4) |
The consequence is easy to miss. “The PE has written the descriptor” and “the PE’s own table walker will see the descriptor” are two different claims. The walker is, for ordering purposes, close to a separate observer. That is why the TLB update sequence needs a DSB and why the instruction stream needs an ISB.
Program order, Coherence order, Reads-from
Three base relations underpin every definition.
- Program order (
po): the order of instructions in one PE’s execution, as the ISA sequential semantics define it. It is a per-PE order and says nothing about what other observers see. - Coherence order (
co): for each location, a single total order over all writes to that location, agreed by all observers. Coherence is per location. It is the only ordering you get “for free” across observers, and only for that one location. - Reads-from (
rf): links each read to the write whose value it returns (or to the initial value).
The model combines these into derived relations. The ones that cross observers are the external versions: rfe (read from a write by another observer), coe (a write coherence-after another observer’s write) and fre (“from-reads”: a read that returns a value coherence-before another observer’s write).
“Observed by”
DDI0487 gives “observed” two framings. Learn both, because older text (and most Arm application notes) uses the first, while the formal model in B2 uses the second.
Operational definitions. A write to a location is observed by an observer when:
- a later read of that location by that observer returns the value written, or the value of a write coherence-after it; or
- a later write to that location by that observer is coherence-after it.
A read of a location is observed by an observer when a later write to that location by that observer can no longer affect the value the read returns.
A read or write is globally observed for a shareability domain when it is observed by every observer in that domain.
Axiomatic definition. In the formal model (aarch64.cat, and the “Definition of the Arm memory model” in DDI0487 B2), an effect E1 is Observed-by E2 when E1 and E2 come from different observers and E2 reads from E1, or E2 is coherence-after E1, or E1 reads a value coherence-before E2. In relational form this is obs = rfe | coe | fre. Every outcome the architecture forbids comes from a cycle that the model rules out, which consists of obs edges joined by the per-PE “ordered-before” edges that dependencies, barriers and acquire/release provide (7.3).
The two framings say the same thing. Observation is about values: an observer has observed a write only once it can no longer read anything older from that location. Nothing in the definition mentions caches or buses.
“Complete”
Completion is the stronger notion, and it is what DSB waits for (7.6). DDI0487 defines it per kind of operation:
| Operation | Complete for a shareability domain when… |
|---|---|
| Read or write | it is globally observed for that domain, and any translation table walks associated with it are complete for that domain |
TLB maintenance (TLBI) | every memory access that used the invalidated entries has been observed to the extent its attributes require, and no new access using those entries can be observed |
Cache maintenance by VA (DC/IC) | its effects are complete for that domain, and any walks it caused are complete |
Two consequences matter for firmware.
- Completion is relative to a domain. A store can be complete for the Inner Shareable domain while an observer outside that domain, such as a non-coherent DMA master, still sees stale memory. That is a cacheability and Point of Coherency problem (8.4), not an ordering one.
- For Device memory, “complete” means the write has been acknowledged, not that its side effect has happened. With the Early Write Acknowledgement attribute (
E, as innGnRE), an intermediate buffer may give that acknowledgement. Even withnEthe architecture does not promise that the peripheral has acted on the write. 7.9 works this through.
The hardware picture, mapped
The mapping to the 6.1 model is approximate and non-architectural, but it builds the right intuition:
| Where the store is (6.1 model) | Architectural status |
|---|---|
| Executed, still speculative | Not an effect yet. No observer may see it (stores are never speculatively visible) |
| Retired, sitting in the store buffer | The writing PE may read it (store-to-load forwarding). No other observer has observed it |
| Written into a coherent L1/L2 line held unique | Observed by all observers in the coherent domain, which is why Armv8 is other-multi-copy atomic (7.2) |
| Non-cacheable or Device write accepted by an interconnect buffer | Complete, if that buffer is allowed to acknowledge it |
| Device write accepted by the peripheral | Complete (nE). The side effect may still be pending |
For loads: a load is complete once the value it returns is fixed and no write by any observer in the domain can change it. A load that hits in a line which can still be snooped away and replayed is, in this picture, not yet complete. This is why “loads complete” is a meaningful thing for DSB to wait for.
Validation note: Architecturally, you can only test observation through reads. A litmus test observes a write by reading it back on another PE (7.11). For completion to an endpoint, you need evidence from the device side, such as a peripheral status register, a bus trace or a CMN/interconnect PMU count. A test that “proves” a DSB made a peripheral see a write by reading the same register back from the PE proves less than it appears to: the read-back is ordered after the write by Device ordering rules, and that is a different property.
Ordering, completion and context
Every barrier rule falls into one of three bins. Keep them apart:
| Property | Question it answers | Mechanism |
|---|---|---|
| Ordering | “Will every observer in domain D see A before B?” | DMB, dependencies, LDAR/STLR, Device nR (7.4, 7.5, 7.7) |
| Completion | “Has A finished for domain D before anything after this point executes?” | DSB (7.6) |
| Context synchronization | “Will later instructions be fetched and executed with the effects of A (a system-register write, a completed TLBI)?” | ISB, exception entry/return (7.8) |
A common bug is to use a property from one bin to get a result from another. A DMB cannot make a TLBI finish. A DSB does not make the PE refetch instructions. An ISB does not wait for stores.
Checkpoint
Q7.1.1 PE0 executes STR w1, [x0] to Inner Shareable, Write-Back memory and then reads the same location back with LDR w2, [x0], getting the new value. What does that read prove about observation by PE1, which is in the same Inner Shareable domain?
- A. PE1 has observed the write, because Coherence order is the same for all observers
- B. PE1 has observed the write, because the store must have left the store buffer for the load to return its value
- C. Nothing: PE0 may read its own write by forwarding before any other observer has observed it
- D. PE1 has observed the write only if the location is in a cache line PE0 holds unique
Answer
C. The model lets a PE see its own write before it is visible to others. That is the “other” in other-multi-copy atomicity. Option A confuses agreement on the order of writes with when each observer sees them. Option B assumes no store-to-load forwarding, which the architecture explicitly allows.
Read more: Arm ARM (DDI0487), B2 “Definitions” (Observer, Observed, Multi-copy atomicity)
Q7.1.2 Firmware writes a Device-nGnRE register and executes DSB SY. Which statement does the architecture actually guarantee once the DSB completes?
- A. The write has been acknowledged as complete, possibly by an intermediate buffer, but the peripheral may not yet have acted on it
- B. The peripheral has performed the side effect of the write
- C. The write has reached the peripheral, because Device memory is never buffered
- D. Nothing about the write, because DSB only orders Normal memory accesses
Answer
A. Completion for Device memory means the write has been acknowledged. With E (Early Write Acknowledgement permitted), a buffer on the path may give that acknowledgement. Even nE only moves the acknowledgement to the endpoint, and it still does not guarantee the side effect. Option C ignores the E attribute. Option D is wrong: DSB covers all explicit accesses of the required types, whatever the memory type.
Read more: Arm ARM (DDI0487), B2 “Completion and endpoint ordering”; Device memory attributes (Early Write Acknowledgement)
Q7.1.3 Why does the model treat a PE’s translation table walks as effects that ordinary load/store ordering rules do not cover?
- A. Because walks always use Non-cacheable memory types
- B. Because walks happen only after a TLBI, so ordering is implicit
- C. Because walks are performed by the SMMU, not the PE
- D. Because the walker reads descriptors independently of program order, so a store to a descriptor is not guaranteed visible to the PE’s own walks without the specific DSB/CSE rules
Answer
D. Walks are implicit accesses. They can happen speculatively and at any time, not at a program-order point. The model only orders them through particular rules (for example DSB before relying on a new descriptor, or FEAT_ETS2 in some cases). Option A is wrong: walk cacheability comes from TCR_ELx.IRGN/ORGN, and is often Write-Back.
Read more: Arm ARM (DDI0487), B2 “Definition of the Arm memory model” (implicit effects); the AArch64 VMSA chapter, ordering of translation table walks