Re:HigherHalfBareBones question?
Posted: Wed Apr 12, 2006 10:06 pm
Hi,
Basically, sooner or later the CPU will run out ot TLB entries and it will non-deterministically invalidate your global TLB entries to free some up. It's even more "non-deterministic" than that though...
For example, imagine you've got code like this:
If you think this is impossible, have a look at SMM (System Management Mode) - an SMI can occur at any time and can't be blocked. The SMI makes the CPU enter SMM mode (which includes disabling paging) and the BIOS's SMM handler can do anything it likes for as long as it likes. The only way an OS can detect if an SMI was handled is by constantly monitoring the time stamp counter to see if it changes more than it should have.
Cheers,
Brendan
I would assume that for "the entry will remain in the TLB indefinately", the word indefinately means "for an undefined amount of time".Colonel Kernel wrote:So, to answer your question, nothing would happen unless you explicitly disabled paging or invalidated the global TLB entry yourself. Otherwise, the address translation for that page will not change.When the processor loads a page-directory or page-table entry for a global page into a TLB, the entry will remain in the TLB indefinitely. The only ways to deterministically invalidate global page entries are as follows:
- Clear the PGE flag; this will invalidate the TLBs.
- Execute the INVLPG instruction to invalidate individual page-directory or page-table entries in the TLBs.
Basically, sooner or later the CPU will run out ot TLB entries and it will non-deterministically invalidate your global TLB entries to free some up. It's even more "non-deterministic" than that though...
For example, imagine you've got code like this:
Code: Select all
cli
mov eax,[thePage] ;eax = old data from old TLB
mov ebx,[thePage] ;ebx = old data from old TLB still
mov ecx,[thePage] ;ecx = new data from new TLB
mov edx,[thePage] ;edx = new data from new TLB
sti
Cheers,
Brendan