x86-64 page tables are 4-level (optionally 5-level on recent CPUs) arrays of 64-bit entries.
Regardless of the level, every entry is 8 bytes wide and has the same basic flag layout; what changes is:
• Whether the entry points to another page-table page (the usual case)
• or maps a “large page” directly (1 GiB via PDPTE, 2 MiB via PDE).
Below is the canonical 4-level layout used by Linux, Windows, *BSD, etc.:
code Copy code
Virtual address bits: 63 … 48 | 47 … 39 | 38 … 30 | 29 … 21 | 20 … 12 | 11 … 0
sign-ext PML4 PDPT PD PT page-ofs
Entry level: PML4E PDPTE PDE PTE
A. Common 64-bit entry format (flags ≡ same position in every level)
Bit Name Meaning (when set) 0 P Present (must be 1 to be used in translation) 1 RW Writable (0 = read-only) 2 US User/Supervisor (1 = user mode allowed) 3 PWT Page-Write-Through cache policy 4 PCD Page-Cache-Disable 5 A Accessed by hardware on first use 6 D Dirty (only valid in PTE or large-page PDE/PDPTE) 7 PS Page Size (applies in PDE & PDPTE only) 8 G Global (TLB entry not flushed on CR3 reload; PTE level) 9-11 AVL Available to OS / hypervisor 12-51 PhysAddr Bits 51-12 of the next-level page-table frame, or the physical base address of the mapped page when PS=1 52 PAT PAT index bit (PTE & 2 MiB pages) 53 RSVD Reserved (was PAT for 1 GiB pages) 54-58 OSX More “available to software” (Intel 5-level leaves 7 bits) 59 PKE Protection-Key bit (if CR4.PKE=1; PTE level) 62 ENC AMD SME Encryption Mask (if enabled) 63 NX No-eXecute (1 = Instruction fetch disabled)
(Related extended features: PCID lives in CR3, not inside the entry.)
B. Address bits by page size
PS Level mapping Bits 51…??? Page size Offset bits 0 PTE 51…12 → 4 KiB page 4 KiB 11…0 1 PDE 51…21 → 2 MiB page 2 MiB 20…0 1 PDPTE 51…30 → 1 GiB page 1 GiB 29…0
C. Example hex dump → dissection
Suppose PTE = 0x0000_7FFF_FF12_3D23
• Present=1, RW=1, US=0, NX=0
• PhysAddr = 0x0000_7FFF_FF12_3000 → physical page @ 0x7FFF FF12 3000
• Dirty=1, Accessed=1, PAT=0, Global=0
D. 5-level mode (LA57)
New root: PML5, adds 9 more virtual-address bits (bits 56…48).
Entry format is identical; only the walk depth grows to 5.
E. Things people often forget
Bits above 51 in the physical address are reserved until processors support ≥ 52-bit PA (current Intel/AMD use up to 48-bit).
Any reserved bit set to 1 causes a #PF with RSVD=1.
Dirty bit is written by hardware only when CR0.WP=0 or the page is writable.
Global bit is meaningful only when CR4.PGE=1.
NX is active only when EFER.NXE=1.
F. Quick mnemonic
“P RW US PWT PCD A D PS G A A A | 40-bit frame | PAT | 8 sw | NX”
That’s what a page-table entry looks like on x86-64 🗺️