Intel 5-level paging
   HOME

TheInfoList



OR:

Intel 5-level paging, referred to simply as ''5-level paging'' in
Intel Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California, and Delaware General Corporation Law, incorporated in Delaware. Intel designs, manufactures, and sells computer compo ...
documents, is a processor extension for the
x86-64 x86-64 (also known as x64, x86_64, AMD64, and Intel 64) is a 64-bit extension of the x86 instruction set architecture, instruction set. It was announced in 1999 and first available in the AMD Opteron family in 2003. It introduces two new ope ...
line of processors. It extends the size of
virtual address Virtual may refer to: * Virtual image, an apparent image of an object (as opposed to a real object), in the study of optics * Virtual (horse), a thoroughbred racehorse * Virtual channel, a channel designation which differs from that of the actual ...
es from 48 bits to 57 bits by adding an additional level to x86-64's multilevel page tables, increasing the addressable
virtual memory In computing, virtual memory, or virtual storage, is a memory management technique that provides an "idealized abstraction of the storage resources that are actually available on a given machine" which "creates the illusion to users of a ver ...
from 256  TiB to 128  PiB. The extension was first implemented in the Ice Lake processors.


Technology

In the 4-level paging scheme (previously known as
IA-32e IA3 or similar may refer to: * '' Ice Age: Dawn of the Dinosaurs'', a 2009 3-D computer-animated adventure comedy film * Iowa Highway 3, a state highway that runs from east to west across the state of Iowa * Iowa's 3rd congressional district Iow ...
paging), the 64-bit virtual memory address is divided into five parts. The lowest 12 bits contain the offset within the 4 KiB memory page, and the following 36 bits are evenly divided between the four 9 bit descriptors, each linking to a 64-bit
page table entry A page table is a data structure used by a virtual memory system in a computer to store mappings between virtual addresses and physical addresses. Virtual addresses are used by the program executed by the accessing process, while physical address ...
in a 512-entry page table for each of the four paging levels. This makes it possible to use bits 0 through 47 in the virtual address, for a total of 256 TiB. 5-level paging adds another 9 bit page table descriptor, making it possible to use bits 0 through 56. This multiplies the address space by 512 and increases the limit to 128 PiB. With 5-level paging enabled, bits 57 through 63 must be copies of bit 56. This is the same as with 4-level paging, where the high-order bits of a virtual address that do not participate in address translation must be the same as the most significant implemented bit. The 5-level paging is enabled by setting bit 12 of the CR4 register (known as LA57). This is only used when the processor is operating in 64 bit mode, and only may be modified when it is not. If the bit is not set, or the 5-level paging feature is not supported, the processor uses the 4-level page table structure when operating in 64-bit mode. This is similar to
Physical Address Extension In computing, Physical Address Extension (PAE), sometimes referred to as Page Address Extension, is a memory management feature for the x86 architecture. PAE was first introduced by Intel in the Pentium Pro, and later by AMD in the Athlon process ...
(PAE), where the third level of paging tables to allow 36-bit addressing was enabled by setting a bit in the CR4 register. Future processors may allow full 64-bit virtual address space by extending the size of page table descriptors to 12 bits (4096 page table entries) and memory offset to 16 bits (64 KiB page size) in the 4-level paging scheme or 21 bits (2 MiB page size) in the 5-level scheme. Extending page table entry size from 64 to 128 bits would allow arbitrary page sizes, as additional hardware flags would change the size and operation of descriptors on lower paging levels.


Drawbacks

Adding another level of indirection makes
page table A page table is a data structure used by a virtual memory system in a computer to store mappings between virtual addresses and physical addresses. Virtual addresses are used by the program executed by the accessing process, while physical addr ...
"walks" longer. A page table walk occurs when either the processor's
memory management unit A memory management unit (MMU), sometimes called paged memory management unit (PMMU), is a computer hardware unit that examines all references to computer memory, memory, and translates the memory addresses being referenced, known as virtual mem ...
or the memory management code in the operating system navigates the tree of page tables to find the
page table entry A page table is a data structure used by a virtual memory system in a computer to store mappings between virtual addresses and physical addresses. Virtual addresses are used by the program executed by the accessing process, while physical address ...
corresponding to a virtual address. This means that, in the worst case, the processor or the memory manager has to access physical memory six times for a single virtual memory access, rather than five for the previous iteration of x86-64 processors. This results in slightly reduced memory access speed. In practice this cost is greatly mitigated by caches such as the
translation lookaside buffer A translation lookaside buffer (TLB) is a memory CPU cache, cache that stores the recent translations of virtual memory address to a physical memory Memory_address, location. It is used to reduce the time taken to access a user memory location. It ...
(TLB). Future extensions may reduce page walks by limiting virtual address space per application, with dedicated hardware flags in an extended 128 bit page table entry, and allowing a larger 64 KiB or 2 MiB
page size A page, memory page, or virtual page is a fixed-length contiguous block of virtual memory, described by a single entry in a page table. It is the smallest unit of data for memory management in an operating system that uses virtual memory. Simil ...
s and backward compatibility with 4 KiB page operations.


Implementation

5-level paging is implemented by the Ice Lake
microarchitecture In electronics, computer science and computer engineering, microarchitecture, also called computer organization and sometimes abbreviated as μarch or uarch, is the way a given instruction set architecture (ISA) is implemented in a particular ...
, EPYC 9004 and 8004 Series Processors and
Storm peak The Marshall Mountains () are a group of mountains overlooking Beardmore Glacier in the Queen Alexandra Range, Antarctica. They are bounded on the north by Berwick Glacier, and on the south by Swinford Glacier. Exploration and name The Marshall ...
Ryzen Threadripper Threadripper, or Ryzen Threadripper, is a brand of HEDT (high-end desktop) and workstation multi-core x86-64 microprocessors designed and marketed by Advanced Micro Devices (AMD), and based on the Zen microarchitecture. It consists of central pro ...
PRO 7900WX series. The 4.14
Linux kernel The Linux kernel is a Free and open-source software, free and open source Unix-like kernel (operating system), kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the k ...
adds support for it. Support for the extension was submitted as a set of patches to the
Linux kernel The Linux kernel is a Free and open-source software, free and open source Unix-like kernel (operating system), kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the k ...
on 8 December 2016. As was reported on the
Linux kernel mailing list The Linux kernel mailing list (LKML) is the main electronic mailing list for Linux kernel development, where the majority of the announcements, discussions, debates, and flame wars over the kernel take place. Many other mailing lists exist to d ...
, it consisted of extending the Linux memory model to use five levels rather than four. This is because, although Linux
abstracts An abstract is a brief summary of a research article, thesis, review, conference proceeding, or any in-depth analysis of a particular subject and is often used to help the reader quickly ascertain the paper's purpose. When used, an abstract always ...
the details of the page tables, it still depends on having a number of levels in its own representation. When an
architecture Architecture is the art and technique of designing and building, as distinguished from the skills associated with construction. It is both the process and the product of sketching, conceiving, planning, designing, and construction, constructi ...
supports fewer levels, Linux emulates extra levels that do nothing. A similar change was previously made to extend from three levels to four. Windows 10 and 11 with server versions also support this extension in their latest updates, where it is provided by a separate kernel image called ntkrla57.exe.


References

{{reflist, refs= X86 architecture Virtual memory Memory management X86 memory management