I'm disassembling a bit of code and I came across:
mov eax, cr3
mov cr3, eax
What is the function of those lines?
This is x86 low-level (bios/firmware/before boot loader) initialization code. We haven't even setup up caches yet.
It is flushing the TLBs (Translation Lookaside Buffers) by loading cr3 with itself.
Intel even mentions the code in their "Intel 64 and IA-32 Architectures Software Develoment Manual Volume 3A - System Programming Guide".
mov EAX,CR3 ; invalidate the TLB
mov CR3,EAX ; by copying CR3 to itself
You can find that and many more handy manuals at:
http://www.intel.com/products/processor/manuals/index.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With