Modified: line is dirty, only this cache has it. Exclusive: line is clean, only this cache has it. Shared: line is clean, multiple caches may have it. Invalid: line is not in this cache.
Transitions happen via snoops and local accesses. A write to a Shared line requires upgrade to Modified (invalidate other copies). A snoop invalidate moves a line to Invalid.
MESI STATES
Invalid <--snoop inv-- Shared <--snoop/shared read-- Exclusive
| | |
+--local read miss----+ |
| +--local write--> Modified <--+
+--local write miss---------------------------------+Conceptually, a clean makes dirty data visible at a specified point while retaining a valid copy; an invalidate removes a local copy under an ownership contract; a combined operation performs both in a defined order. Exact instruction names, cache levels, target point (such as PoC/PoU), completion and effects are architecture-specific—'flush' is too ambiguous without those details.
For non-coherent DMA, follow the platform DMA API for mapping, synchronisation and ownership transfer. CPU-produced data may need cleaning before device reads; device-produced data may require invalidation before CPU reads. The exact sequence also depends on direction, barriers and shared-line ownership. Do not apply a universal flush recipe to hardware-coherent DMA or invalidate unrelated dirty CPU data.
Use the architecture-reported maintenance granule and alignment rules; do not assume a universal 64-byte line.
PoC (Point of Coherency) vs PoU (Point of Unification) matters for maintenance scope.
Hardware coherency doesn't eliminate all software maintenance needs.
Use the architecture-reported maintenance granule and alignment rules; do not assume a universal 64-byte line.
PoC (Point of Coherency) vs PoU (Point of Unification) matters for maintenance scope.
Hardware coherency doesn't eliminate all software maintenance needs.