DC CVAC's Point of Coherency Scope in ARMv8.2: Stale Cache Uncertainty
0 reputation · 14 Apr 2023, 03:38 UTC
0 reputation · 14 Apr 2023, 03:38 UTC
Determine whether the DC CVAC instruction alone guarantees visibility of data written on one core to all other cores on ARMv8.2 systems, given the implementation‑defined shareability of its point of coherency (PoC).
The ARMv8‑A manual specifies that PoC may be either inner‑shareable or outer‑shareable, with no architectural change across ARMv8.0‑v8.2. This ambiguity can lead to stale cache observations when a core writes to a location that is only outer‑shareable cached on another core, without additional cache maintenance or synchronization.
32775 reputation · 14 Apr 2023, 07:36 UTC
No. On ARMv8.2, DC CVAC alone does not guarantee that data written on one core is visible to all other cores. The Point of Coherency (PoC) is implementation-defined; if the PoC is restricted to an inner-shareable domain, a core in an outer-shareable domain may continue to observe stale data from its own local cache.
Confirmed: The ARMv8-A architecture maintains a consistent definition of the PoC across versions 8.0 through 8.2. DC CVAC cleans the cache line to the PoC, but the scope of that PoC (whether it is inner-shareable or outer-shareable) depends entirely on the specific hardware implementation.
Likely Explanation: Stale data occurs when the writing core issues DC CVAC for a memory region where the PoC is inner-shareable, but the reading core is located in a different cluster or domain that only shares data at the outer-shareable level. Because the maintenance operation stops at the inner PoC, it does not invalidate or update the copies held in outer-level caches, leaving the reading core with outdated information.
To ensure portable inter-core visibility across different ARMv8.2 implementations, avoid relying on DC CVAC in isolation. Use the following sequence:
DC CIVAC (Clean and Invalidate by VA to PoC) to ensure the line is pushed to the PoC and invalidated locally.DSB SY (Data Synchronization Barrier, System scope) to ensure the maintenance operation is complete and visible before the next step.To verify the behavior on a specific target, you can read the ID_AA64MMFR_EL1 register or consult the Technical Reference Manual (TRM) for the specific SoC to determine the PoC scope. A practical test involves a two-core loop where Core A writes and cleans, and Core B polls for the update; if Core B hangs or reads old data without a DSB, the PoC is likely narrower than the shareability domain.
Missing Diagnostic: Which specific processor implementation (e.g., Cortex-A75, Neoverse N1) are you targeting? The recommendation only changes if the silicon documentation explicitly guarantees an outer-shareable PoC for your specific memory attributes.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.