I have a question regarding CLFLUSH.
Presumably if I code in assembler (or equivilent intrinsics)
The processor will "drill" through the cache to obtain the contents of [location] (or locations in samecache line as location).
The problem I see though is what happens if an interruptand possiblythread context switch occures during the CLFLUSH? i.e. between CFLUSH and SomeReadInstruction.
It is potentialy possible that the interrupt, the O/S or read-ahead logic may have populated the cache line and then returning much later resume at SomeReadInstruction and then re-read the now stale cache line.
Alternately if I were only interested in read
LOCK CMPXCHG [location], RAX
Is there any sequencing rules such as if MFENCE is followed by CFLUSH, is followed by memory reference instruction that the chain of instructions occure without interruption? If so, then would anyone have these rules? Or the Intel document name?
(the rule would have to nip abusive use of the rule such as the CIF problem in the old PDP-8 system)