Reputation: 377
While researching virtual memory, I sometimes see conflicting use of the nouns page table, page table entry, and page. For example "A page table is a table of pages..." and "A page table holds page table entries".
My understanding of the relationships (in the context of x86-64) are as follows:
Is this high-level summary, and use of the aforementioned nouns, accurate?
Upvotes: 1
Views: 293
Reputation: 37232
Is this high-level summary, and use of the aforementioned nouns, accurate?
Not quite (none of the entries ever contain virtual addresses). For "plain 32-bit paging" on 80x86 (2 levels):
A page directory is an array of page directory entries
A page table is an array of page table entries
For "long mode paging" on 80x86 (4 levels):
A PML4 (Page Map Level 4) is an array of PML4 entries
A PDPT (Page Directory Pointer Table) is an array of PDPT entries
A page directory is an array of page directory entries
A page table is an array of page table entries
Of course there's a pattern here:
A <NAME>
is an array of <NAME>
entries
<NAME>
entry contains the physical address of a <NEXT_LOWER_LEVEL_NAME>
, with some bits (that would've been zero) re-purposed for various flags (e.g. permission bits).. where "<NAME>
" is (from highest to lowest) one of: PML5
, PML4
, Page Directory Pointer Table
, Page Directory
, Page Table
.
Upvotes: 2