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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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”.
You can find that and many more handy manuals at:
http://www.intel.com/products/processor/manuals/index.htm