Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Younis_A_
Beginner
74 Views

Can clflush evict any address

Hi

I'm wondering, can clflush instruction flush any type of addresses in a cache line (logical, linear or physical address) or has to be only a linear address.

Thank you in advance for your help

0 Kudos
2 Replies
McCalpinJohn
Black Belt
74 Views

The description in Volume 2 "Instruction Set Reference" of the Intel Software Developer's Guide seems clear enough -- CLFLUSH takes a linear address as its argument and flushes the cache line containing that linear address from all levels of the memory hierarchy and from all caches in the system.

Inside the L1 cache, all aliased virtual to physical translations map to the same cache set (on current Intel processors) so there is no difference between evicting the linear address and the physical address.   (This can be more complex with other processors.)

Outside of the L1 cache, all addresses used by the system are physical addresses, so it is the physical address that gets broadcast globally for eviction.  If that cache line was loaded into a cache using a different virtual address, it will get evicted anyway, which may be unexpected.   (Virtual address aliasing is frowned on for data, but it is heavily used for instructions in Address Space Layout Randomization.)

 

Younis_A_
Beginner
74 Views

Thank you so much John.

Reply