3 ms·
In order for memory mirroring to be enabled, the memory must probably be read first since its value must be used. The processor must then ask the cache controll
by avianes 6y ago
In order for memory mirroring to be enabled, the memory must probably be read first since its value must be used.
The processor must then ask the cache controller to acquire the cache-line in a "no writer / multiple reader" mode ("S" state).
If another processor wants to write to this cache-line it must first take the cache-line in "single writer / no reader" mode ("M" state) which invalidates the cache-line in all other caches.
In the processor performing the memory mirroring, if the cache-line goes out of the "S" state then the processor cannot read the cache-line anymore and memory mirroring has to stop since it reads this memory.
In order to continue it must ask for the cache-line again, read it again, and then get an updated value.
It's just a guess, but that's probably what happens in order for the memory mirroring not to break the cache-coherency.
So "yes, there is such logic", but it already existed in the processor to avoid the same problem when data is in the cache.
And so, there would be no additional logic to handle this.