Cache Maintenance
Cache Maintenance Operations, or CMOs, instruct caches to clean and/or invalidate cache lines. Unlike allocation hints, a cache that receives a CMO targeting a line it holds must action it according to the CMO semantics.
A CMO is not primarily a data transfer. It is a request about the state of a cache line: make dirty data visible, remove cached copies, or push data far enough downstream for persistence or storage requirements. The important question is therefore not “what bytes are carried?”, but “which caches must observe this operation, and when is the operation complete?”
Cache Maintenance Operations (CMO)
| CMO | Meaning |
|---|---|
CleanShared | Cached copies are Clean and associated writes are observable. |
CleanSharedPersist | Clean to the Point of Persistence. |
CleanSharedDeepPersist | Clean to the Point of Deep Persistence. |
CleanInvalid | Dirty copies are written back and cached copies invalidated. |
CleanInvalidPoPA | Clean and invalidate past the Point of Physical Aliasing. |
CleanInvalidStorage | Clean and invalidate past the Point of Physical Storage. |
MakeInvalid | Cached copies are invalidated; Dirty data might be discarded. |
| Concept | Meaning |
|---|---|
| Clean | Dirty data is written far enough that required observers can see the latest value. |
| Invalidate | Cached copies are removed so later accesses cannot use stale data. |
| Persistence clean | Data is pushed to the Point of Persistence or Point of Deep Persistence. |
| Storage clean | Data is pushed past the Point of Physical Storage. |
Actions on receiving a CMO
When a component receives a CMO, it checks whether it is a cache and whether the CMO applies. A coherent interconnect must send snoops to peer caches that might hold the line. Dirty data must be written back for Clean operations. The component waits for required snoops and writes before responding or propagating the CMO downstream.
CMO request attributes
CMO requests must be cache-line-sized and Regular. Device/System Domain is not permitted for CMOs; CMO transactions must be Normal memory transactions. AxCACHE and AxDOMAIN determine which caches must act on the operation.
CMOs on the write channels
CMOs can be transported on either read or write channels. The specification recommends new designs transmit CMOs on the write channels. A write-channel CMO uses AW and B without W data.
CMOs on the read channels
A read-channel CMO uses AR and a single R response.
Write with CMO
Write with CMO combines a data write and cache maintenance operation. This is useful when an I/O agent writes data that must become visible downstream of caches, or when persistent memory requires both data update and persistence clean behavior.
The combined request saves bandwidth and ordering work because the write and its related maintenance intent travel together. WritePtlCMO is used for a partial-line-or-smaller write, and WriteFullCMO is used for a cache-line-sized Regular write. AWCMO selects the maintenance operation that is associated with the write.
| Rule | Why it matters |
|---|---|
WritePtlCMO must not cross a cache-line boundary. | The CMO applies to the whole addressed cache line. |
WriteFullCMO must be cache-line-sized and Regular. | The transaction represents a full-line update plus maintenance. |
| The CMO part is treated as cacheable and Shareable. | Required caches must see the maintenance operation even if the write attributes are different. |
| A split implementation must issue the write before the CMO. | Observers must not see maintenance complete before the data update is ordered correctly. |
A combined write with CMO can later be split into separate write and CMO transactions, but the split must preserve ordering and visibility rules. For simple clean or clean-invalidate cases, the response indicates that both the write and CMO are observable. For persistence CMOs, the response path can also indicate whether the data has reached the persistence point.
CMOs for Persistence
Persistence CMOs introduce concepts such as Point of Persistence and Point of Deep Persistence.
Cache maintenance to the Point of Physical Storage
Storage CMOs can clean and invalidate to the Point of Physical Storage. RME can require CleanInvalidPoPA to clean and invalidate cache lines past the Point of Physical Aliasing.
For verification, persistence CMOs are important because BCOMP and BPERSIST can create multiple response meanings on the write response channel.
AXI Protocol