I don?t get this instruction working (only tested under Bochs). I?m writing my dealloc functions for the vmm. So I can invalid just 1 page or I can flush the whole tlb. But I don?t get the point how this instruction is working.
When I have the virtual addr in eax, must I use "invlpg [eax]" or need the addr where the page?s physical address stands (in a pt)?
Also when I map a page to a address space, must I than also invalide the the tlb entry for that address?
INVLPG instruction
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:INVLPG instruction
the argument of invlpg is the offset (within DS or some other segment) of the logical address that you want to invalidate.
So if you just (for some insane reason) modified the mapping for offset 0xb8000 in a zero-based data segment you'd need to
And if your data-segment was 0xC0000000-based, you'd have
Afaik, it's not necessary to invalidate pages that you make present and that had no previous line in the TLB on intel processors (though i've seen other founders that were also caching non-present pages in the TLB and thus which require a flush after a page has been defined, can't remember which ones).
So if you just (for some insane reason) modified the mapping for offset 0xb8000 in a zero-based data segment you'd need to
Code: Select all
invlpg [0xb8000]
Code: Select all
invlpg [0x400b8000]
Re:INVLPG instruction
AFAIK, Cyrixes. Not Via Cyrix chips, Cyrix M2 like chipsPype.Clicker wrote: Afaik, it's not necessary to invalidate pages that you make present and that had no previous line in the TLB on intel processors (though i've seen other founders that were also caching non-present pages in the TLB and thus which require a flush after a page has been defined, can't remember which ones).
Re:INVLPG instruction
OK, or I put e.g. 0xb8000 in eax and then I have to use "invlpg [eax]", right? Because I tried this in Bochs and it didn?t work.
Edit::
OK, it is working, was my fault - I should give the function the right address -.
Edit::
OK, it is working, was my fault - I should give the function the right address -.