32-bit paging, 4 KiB pages, without PAE In
protected mode with paging enabled (bit 31, PG, of control register CR0 is set), but without PAE,
x86 processors use a two-level page translation scheme.
Control register CR3 holds the page-aligned physical address of a single 4 KB long
page directory. This is divided into 1024 four-byte page directory entries that in turn, if valid, hold the page-aligned physical addresses of
page tables, each 4 KB in size. These similarly consist of 1024 four-byte page table entries which, if valid, hold the page-aligned physical addresses of 4 KB long
pages of physical memory (RAM).
32-bit paging, 4 MiB pages, without PAE The entries in the page directory have an additional flag in bit 7, named PS (for
page size). If the system has set this bit to 1, the page directory entry does not point to a page table but to a single, large 4 MB page (
Page Size Extension).
32-bit paging, 4 KiB pages, with PAE Enabling PAE (by setting bit 5, PAE, of the system register CR4) causes major changes to this scheme. By default, the size of each page remains as 4 KB. Each entry in the page table and page directory becomes 64 bits long (8 bytes), instead of 32 bits, to allow for additional address bits. However, the size of each table
does not change, so both table and directory now have only 512 entries. Because this allows only one half of the entries of the original scheme, an extra level of hierarchy has been added, so the system register now points physically to a
Page Directory Pointer Table, a short table containing four pointers to page directories. Supporting 64 bit addresses in the page-table is a significant change as this enables two changes to the processor addressing. Firstly, the page table walker, which uses physical addresses to access the page table and directory, can now access physical addresses greater than the 32-bit physical addresses supported in systems without PAE. From , the page table walker can access page directories and tables that are beyond the 32-bit range. Secondly, the physical address for the data being accessed (stored in the page table) can be represented as a physical address larger than the 32-bit addresses supported in a system without PAE. Again, this allows data accesses to access physical memory regions beyond the 32-bit range.
32-bit paging, 2 MiB pages, with PAE The entries in the page directory have an additional flag in bit 7, named PS (for
page size). If the system has set this bit to 1, the page directory entry does not point to a page table but to a single, large 2 MB page (
Page Size Extension).
Summary of 32-bit paging In all page table formats supported by
IA-32 and
x86-64, the 12 least significant bits of the page table entry are either interpreted by the memory management unit or are reserved for operating system use. In processors that implement the "no-execute" or "execution disable" feature, the most significant bit (bit 63) is the
NX bit. The next eleven most significant bits (bits 52 through 62) are reserved for operating system use by both Intel and AMD's architecture specifications. Thus, from 64 bits in the page table entry, 12 low-order and 12 high-order bits have other uses, leaving 40 bits (bits 12 though 51) for the physical page number. Combined with 12 bits of "offset within page" from the linear address, a maximum of 52 bits are available to address physical memory. This allows a maximum RAM configuration of 252 bytes, or 4 petabytes (about 4.5×1015 bytes).
x86-64 paging On
x86-64 processors in native
long mode, the address translation scheme uses PAE but adds a fourth table, the 512-entry
page-map level 4 table, and extends the page directory pointer table to 512 entries instead of the original 4 entries it has in protected mode. This means that 48 bits of virtual page number are translated, giving a virtual address space of up to 256 TB. For some processors, a mode can be enabled with a fifth table, the 512-entry
page-map level 5 table; this means that 57 bits of virtual page number are translated, giving a virtual address space of up to 128 PB. In the page table entries, in the original specification, 40 bits of physical page number are implemented. == Hardware support ==