Some questions about ARM/ARM64 write combine(NORMAL_NC) memory attribute read/write and memory barriers

2026-06-18

Stack Overflow: View Question

Tags: caching, architecture, arm, hardware, arm64

Score: 2 | Views: 122

The asker wants to validate DDR by writing a value then reading it back, mapping the page as Normal Non-Cacheable (Normal_NC) — a "write-combining" attribute commonly used for framebuffers and device memory. Their test code issues a store, a dsb sy, then a load, and they're trying to reason about whether the load is guaranteed to see DRAM (not a merge buffer) and whether the barrier is sufficient.

This question is interesting because Normal_NC sits in a confusing middle ground of the ARM memory model. Unlike Device memory, Normal_NC accesses can be gathered, merged, reordered, and speculatively prefetched — but they are not cached in L1/L2. So intuition from x86 WC memory only partially carries over.

Key technical points:

Direction for an answer:

Gotchas: write-combining behavior is implementation-defined within architectural limits, so two different SoCs (even both ARMv8.2) can give different observable results for the same code. And on real hardware, the DDR controller's own write buffer and refresh cycles further blur "did it reach the cell."

The challenge: The asker conflates "the store completed architecturally" with "the bit physically flipped in the DRAM array" — and the ARM memory model only guarantees the former.

All newsletters