Second Level Address Translation
Second Level Address Translation (SLAT), also known as nested paging, is a hardware-assisted virtualization technology which makes it possible to avoid the overhead associated with software-managed shadow page tables.
Intel's implementation of SLAT, known as Extended Page Table (EPT), was introduced in the Nehalem microarchitecture found in certain Core i7, Core i5, and Core i3 processors. AMD supports SLAT through the Rapid Virtualization Indexing (RVI) technology since the introduction of its third-generation Opteron processors (code name Barcelona).
ARM's virtualization extensions support SLAT, known as Stage-2 page-tables provided by a Stage-2 MMU. The guest uses the Stage-1 MMU. Support was added as optional in the ARMv7ve architecture and is also supported in the ARMv8 (32-bit and 64-bit) architectures.
Contents
Overview
Lua error in package.lua at line 80: module 'strict' not found.
Modern processors use the concepts of physical memory and virtual memory; running processes use virtual addresses and when an instruction requests access to memory, the processor translates the virtual address to a physical address using a page table or TLB. When running a virtual system, it has allocated virtual memory of the host system that serves as a physical memory for the guest system, and the same process of address translation goes on also within the guest system. This increases the cost of memory access since the address translation needs to be performed twice – once inside the guest system (using software-emulated shadow page table), and once inside the host system (using hardware page table).
In order to make this translation more efficient, processor vendors implemented technologies commonly called SLAT. By treating each guest-physical address as a host-virtual address, a slight extension of the hardware used to walk a non-virtualized page table (now the guest page table) can walk the host page table. With multilevel page tables the host page table can be viewed conceptually as nested within the guest page table. A hardware page table walker can treat the additional translation layer almost like adding levels to the page table.
Using SLAT and multilevel page tables, the number of levels needed to be walked to find the translation doubles when the guest-physical address is the same size as the guest-virtual address and the same size pages are used. This increases the importance of caching values from intermediate levels of the host and guest page tables. It is also helpful to use large pages in the host page tables to reduce the number of levels (e.g., in x86-64, using 2 MB pages removes one level in the page table). Since memory is typically allocated to virtual machines at coarse granularity, using large pages for guest-physical translation is an obvious optimization, reducing the depth of look-ups and the memory required for host page tables.
Implementations
Extended Page Tables
Extended Page Tables (EPT) is an Intel second-generation x86 virtualization technology for the memory management unit (MMU). EPT support is found in Intel's Core i3, Core i5 and Core i7 CPUs, among others.[1]
EPT is required in order to launch a logical processor directly in real mode, a feature called "unrestricted guest" in Intel's jargon, and introduced in the Westmere microarchitecture.[2][3]
According to a VMware evaluation paper: "EPT provides performance gains of up to 48% for MMU-intensive benchmarks and up to 600% for MMU-intensive microbenchmarks", although it can actually cause code to run slower than a software implementation in some corner cases.[4]
Rapid Virtualization Indexing
Rapid Virtualization Indexing (RVI), known as Nested Page Tables (NPT) during its development, is an AMD second generation hardware-assisted virtualization technology for the processor memory management unit (MMU).[5][6]
A VMware research paper found that RVI offers up to 42% gains in performance compared with software-only (shadow page table) implementation.[7] Tests conducted by Red Hat showed a doubling in performance for OLTP benchmarks.[8]
RVI was introduced in the third generation of Opteron processors, code name Barcelona.[9]
Support in software
Hypervisors that support Intel's EPT implementation include the following:
- Hyper-V for Windows Server 2008 R2, Windows 8 and later.[10] The Windows 8 Hyper-V actually requires SLAT.[11][12]
- KVM, since version 2.6.26 of the Linux kernel mainline[13][14]
- Parallels Desktop for Mac, since version 5[15]
- VirtualBox, since version 2.0.0[16]
- VMware ESX, since version 3.5[7]
- Xen, since version 3.2.0[17]
- bhyve[18][19]
- vmm for OpenBSD 5.9 and later[20][21]
Some of the above hypervisors actually require EPT in order to work at all (not just faster) as they do not implement a software shadow page table; the list is not fully updated to reflect that.
See also
- AMD-V (codename Pacifica) – the first-generation AMD hardware virtualization support
- Page table
- VT-X
References
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ "Intel added unrestricted guest mode on Westmere micro-architecture and later Intel CPUs, it uses EPT to translate guest physical address access to host physical address. With this mode, VMEnter without enable paging is allowed."
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Performance Evaluation of Intel EPT Hardware Assist
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ 7.0 7.1 Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Implementation of a BIOS emulation support for BHyVe: A BSD Hypervisor
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Coming Soon to OpenBSD/amd64: A Native Hypervisor
- ↑ vmm(4) — virtual machine monitor