I have read the document about the CLFLUSH instruction of Intel x86 machine.
I understand that CLFLUSH m8 means flush the cache line containing linear address m8 if I run the instruction inside a Linux module on the bare metal.
However, what if I want to run the instruction inside a VM in virtualization environment? What the parameter of CLFLUSH is?
To be specific, suppose I want to flush a cache line that hold the content for virtual address va of a program in a VM. The virtual address va is mapped to physical address pa in the VM, and pa will be mapped to the machine address ma in the VMM/hypervisor. Which address should I use for the CLFLUSH instruction, va, pa or ma?
Thank you very much!
vaaddress, I'm wondering how hardware can figure out which cache line should be flushed based on theva? On bare metal, I can understand that the hardware can use CR3 register to transfer thevato machine address to find the cache line to flush. But in virtualized environment, will the hardware do the translation fromvatomaautomatically? - Mike