x86 page table management

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
teodori
Member
Member
Posts: 103
Joined: Wed Nov 14, 2012 4:55 pm

x86 page table management

Post by teodori »

Hello I have a question about page table management on x86. To allocate a page, is it enough to add a page table entry with the physical address and the right bits? To free a page, is it enough to set a page table entry to zero and to use invlpg? How do I use invlpg (physical or virtual page address)?
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: x86 page table management

Post by Gigasoft »

Allocating a page means picking some free page and deciding that you want to use it. When you refer to it from a page table, it's called mapping the page, and when you stop referring to it, it is called unmapping. Invlpg is used with a memory operand and applies to the page that contains the address. For example, if the DS base is 0, the instruction invlpg ds:[12345678h] will invalidate the TLB entry for linear address 12345000h.
teodori
Member
Member
Posts: 103
Joined: Wed Nov 14, 2012 4:55 pm

Re: x86 page table management

Post by teodori »

So invlpg takes a virtual page address?
alexfru
Member
Member
Posts: 1112
Joined: Tue Mar 04, 2014 5:27 am

Re: x86 page table management

Post by alexfru »

Naturally. But have you heard of Intel® 64 and IA-32 Architectures Software Developer Manuals?
Post Reply