background image

4-22 Vol. 3A

PAGING

If CR4.PKE = 1, IA-32e paging associates with each linear address a protection key. Section 4.6 explains how the 
processor uses the protection key in its determination of the access rights of each linear address.
The following items describe the IA-32e paging process in more detail as well has how the page size and protection 
key are determined.

A 4-KByte naturally aligned PML4 table is located at the physical address specified in bits 51:12 of CR3 (see 
Table 4-12). A PML4 table comprises 512 64-bit entries (PML4Es). A PML4E is selected using the physical 
address defined as follows:
— Bits 51:12 are from CR3.
— Bits 11:3 are bits 47:39 of the linear address.
— Bits 2:0 are all 0.
Because a PML4E is identified using bits 47:39 of the linear address, it controls access to a 512-GByte region of 
the linear-address space.

A 4-KByte naturally aligned page-directory-pointer table is located at the physical address specified in 
bits 51:12 of the PML4E (see Table 4-14). A page-directory-pointer table comprises 512 64-bit entries 
(PDPTEs). A PDPTE is selected using the physical address defined as follows:
— Bits 51:12 are from the PML4E.
— Bits 11:3 are bits 38:30 of the linear address.
— Bits 2:0 are all 0.

Because a PDPTE is identified using bits 47:30 of the linear address, it controls access to a 1-GByte region of the 
linear-address space. Use of the PDPTE depends on its PS flag (bit 7):

1

If the PDPTE’s PS flag is 1, the PDPTE maps a 1-GByte page (see Table 4-15). The final physical address is 
computed as follows:
— Bits 51:30 are from the PDPTE.
— Bits 29:0 are from the original linear address.
If CR4.PKE = 1, the linear address’s protection key is the value of bits 62:59 of the PDPTE.

If the PDPTE’s PS flag is 0, a 4-KByte naturally aligned page directory is located at the physical address 
specified in bits 51:12 of the PDPTE (see Table 4-16). A page directory comprises 512 64-bit entries (PDEs). A 
PDE is selected using the physical address defined as follows:
— Bits 51:12 are from the PDPTE.
— Bits 11:3 are bits 29:21 of the linear address.
— Bits 2:0 are all 0.

Because a PDE is identified using bits 47:21 of the linear address, it controls access to a 2-MByte region of the 
linear-address space. Use of the PDE depends on its PS flag:

If the PDE's PS flag is 1, the PDE maps a 2-MByte page (see Table 4-17). The final physical address is computed 
as follows:
— Bits 51:21 are from the PDE.
— Bits 20:0 are from the original linear address.
If CR4.PKE = 1, the linear address’s protection key is the value of bits 62:59 of the PDE.

If the PDE’s PS flag is 0, a 4-KByte naturally aligned page table is located at the physical address specified in 
bits 51:12 of the PDE (see Table 4-18). A page table comprises 512 64-bit entries (PTEs). A PTE is selected 
using the physical address defined as follows:
— Bits 51:12 are from the PDE.
— Bits 11:3 are bits 20:12 of the linear address.
— Bits 2:0 are all 0.

1. The PS flag of a PDPTE is reserved and must be 0 (if the P flag is 1) if 1-GByte pages are not supported. See Section 4.1.4 for how 

to determine whether 1-GByte pages are supported.