Jump to content

Physical Address Extension: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
→‎Microsoft Windows: correct one of the most glaring mistakes, this whole section needs checking though! It could probablly also do with restructuring to bring the text up front
Line 172: Line 172:


The highest possible values appear here.
The highest possible values appear here.

Windows NT4.0 32 bit Enterprise also supports PAE. There was also a 64 bit NT4.0 for DEC Alpha, but like Itanium, PAE has no meaning.


Windows XP Service Pack 2 and later, by default, on processors with the [[NX bit|no-execute (NX)]] or [[NX bit|execute-disable (XD)]] feature, runs in PAE mode in order to allow NX.<ref>{{cite web
Windows XP Service Pack 2 and later, by default, on processors with the [[NX bit|no-execute (NX)]] or [[NX bit|execute-disable (XD)]] feature, runs in PAE mode in order to allow NX.<ref>{{cite web

Revision as of 15:12, 12 May 2010

In computing, Physical Address Extension (PAE) is a feature (first implemented in the Intel Pentium Pro in 1995) to allow x86 processors to access a physical address space (including random access memory and memory mapped devices) Larger than 4 gigabytes. It was extended by AMD to add a level to the page table hierarchy, to allow it to handle up to 52-bit physical addresses, add NX bit functionality, and make it the mandatory memory paging model in long mode[1]. PAE is provided by Intel Pentium Pro (and above) CPUs - including all later Pentium-series processors except the 400 MHz bus versions of the Pentium M, as well as by other processors such as the AMD Athlon and later AMD processor models with similar or more advanced versions of the same architecture.

x86 processor hardware-architecture is augmented with additional address lines used to select the additional memory, so physical address size increases from 32 bits to 36 bits. This, theoretically, increases maximum physical memory size from 4 GB to 64 GB. The 32-bit size of the virtual address is not changed, so regular application software continues to use instructions with 32-bit addresses and (in a flat memory model) is limited to 4 gigabytes of virtual address space. The operating system uses page tables to map this 4-GB address space into the 64 GB of physical memory. The mapping is typically applied differently for each process. In this way, the extra memory is useful even though no single regular application can access it all simultaneously.

To use PAE operating system support is required. Intel versions of OS-X support PAE. The Linux kernel supports PAE as a build option and most major distributions provide a PAE kernel either as the default or as an option. FreeBSD also supports PAE as a kernel build option. Windows supports PAE but current 32-bit desktop editions limit the physical address space to 4GB even in PAE mode for driver compatibility reasons.

For application software which needs access to more than 4 GB of RAM, operating systems may provide some special mechanisms in addition to the regular PAE support. On Microsoft Windows this mechanism is called Address Windowing Extensions, while on Unix-like systems a variety of techniques are used, such as using mmap() to map regions of a file into and out of the address space as needed.

Page table structures

In traditional 32-bit protected mode, x86 processors use a two-level page translation scheme, where the control register CR3 points to a single 4 kiB long page directory divided 1024 × 4 byte entries that point to 4 kiB long page tables, similarly consisting of 1024 × 4 byte entries pointing to 4 KiB long pages.

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 kiB. Each entry in the page table and page directory grows to 64 bits (8 bytes) rather than 32 bits - to allow for additional address bits; however, the size of tables does not change, so both table and directory now have only 512 entries. Because this allows only half as many entries as the original scheme, an extra level of hierarchy has been added, so CR3 now points to the Page Directory Pointer Table, a short table which contains pointers to 4 page directories.

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 MiB page. The NX bit is another flag in the page directory, in bit 63, to mark pages as no execute. Because the 12 least significant bits of the page table entry's 64 bits are either similar flags or are available for OS-specific data, a maximum of 52 bits can be potentially used in the future to address 252 bytes, or 4 petabytes, of physical memory.

Software can identify via the CPUID flag PAE whether a CPU supports PAE mode.

On x86-64 processors in native long mode, the address translation scheme resembles PAE but with a fourth table, the page-map level 4 table; this and the Page Directory Pointer Table are 512 entries long. 36 bits of virtual page number are translated, giving a virtual address space of up to 256 TB. In the page table entries, in the original specification, 40 bits of physical page number are implemented out of 52 bits possible. Later x86-64 CPUs may implement more bits of physical page number.

Operating-system support

FreeBSD

FreeBSD supports PAE in the 4.x series starting with 4.9, in the 5.x series starting with 5.1, and in all 6.x and later releases. Support requires the kernel PAE configuration-option. Loadable kernel modules can only be loaded into a kernel with PAE enabled if the modules were built with PAE enabled; the binary modules in FreeBSD distributions are not built with PAE enabled, and thus cannot be loaded into PAE kernels. Not all drivers support more than 4 GB of physical memory; those drivers won't work correctly on a system with PAE.[2]

Linux

The Linux kernel includes full PAE mode support starting with version 2.3.23,[3] enabling access of up to 64 GB of memory on 32-bit machines. A PAE-enabled Linux-kernel requires that the CPU also support PAE. As of 2009[citation needed], many common Linux distributions have started to use a PAE-enabled kernel as the distribution-specific default[4] because it adds the NX bit [5].

Mac OS X

Mac OS X for Intel Macs supports PAE and the NX bit on all CPUs supported by Apple (from 10.4.4, the first Intel release, onwards). Mac Pro and Xserve systems can currently support 32 GB of RAM, even though the Mac OS X 10.5 Leopard kernel remains 32-bit. The Mac OS X 10.6 Snow Leopard kernel can optionally run in 64-bit on certain systems.[6]

Microsoft Windows

The following releases of Microsoft Windows support PAE:[7][8][9] Itanium versions of these operating systems (if they exist) do not use PAE because the Itanium does not need PAE.

Windows Versions (and their maximum addressable physical memory/RAM (GB))[10] 32-bit Editions 64-bit Editions
Windows 2000 Professional, Server 4 N/A
Windows 2000 Advanced Server 8 N/A
Windows 2000 Datacenter 32 N/A
Windows XP Starter 0.5 N/A
Windows XP Home & Media Center 4
Windows XP Professional 4 128
Windows Server 2003 Web 2 N/A
Windows Server 2003 Small Business, Home, Storage 4 N/A
Windows Server 2003 Enterprise Storage 8 N/A
Windows Server 2003 Standard (SP1/SP2/R2) 4 32
Windows Server 2003 Enterprise (SP2) 64 2048
Windows Server 2003 Datacenter (SP2) 128 2048
Windows Vista Starter 1 N/A
Windows Vista Home Basic 4 8
Windows Vista Home Premium 4 16
Windows Vista Business, Enterprise, Ultimate 4 128
Windows Server 2008 Standard, Web 4 32
Windows Server 2008 Enterprise, Datacenter 64 2048
Windows 7 Starter 2 N/A
Windows 7 Home Basic 4 8
Windows 7 Home Premium 4 16
Windows 7 Professional, Enterprise, Ultimate 4 192

Annotations: Values for Windows Server 2008 64-bit also apply to Windows Server 2008 R2 (which dropped 32-bit support). Values for Windows Server 2003 64-bit depend on:

  1. service pack level
  2. the release being R2 or not

The highest possible values appear here.

Windows NT4.0 32 bit Enterprise also supports PAE. There was also a 64 bit NT4.0 for DEC Alpha, but like Itanium, PAE has no meaning.

Windows XP Service Pack 2 and later, by default, on processors with the no-execute (NX) or execute-disable (XD) feature, runs in PAE mode in order to allow NX.[11] The no execute (NX, or XD for execution disable) bit resides in bit 63 of the page table entry and, without PAE, page table entries on 32-bit systems have only 32 bits; therefore PAE mode is required in order to exploit the NX feature. However, "client" versions of 32-bit Windows (Windows XP, Windows Vista, Windows 7) limit physical address space to the first 4 GB for driver compatibility [12] and licensing[13] reasons, even though these versions do run in PAE mode if NX support is enabled.

Solaris

Solaris supports PAE beginning with Solaris version 7. However, third-party drivers used with version 7 which do not specifically include PAE support may operate erratically or fail outright on a system with PAE.[14]

See also

References

  1. ^ "AMD64 Architecture Programmer's Manual Volume 2: System Programming" (PDF). AMD64 Architecture Programmer's Manual. Advanced Micro Devices. November 1, 2009. pp. 124–143. Retrieved February 3, 2010. Long-mode page translation requires the use of physical-address extensions (PAE). Before activating long mode, PAE must be enabled by setting CR4.PAE to 1. Activating long mode before enabling PAE causes a general-protection exception (#GP) to occur.
  2. ^ "FreeBSD PAE(4) man page". 2003-04-08. Retrieved 2007-11-26.
  3. ^ "2.3.23-pre4 x86 64GB RAM changes [HIGHMEM patch] explained a bit".
  4. ^ "x86 Specifics for Fedora 11".
  5. ^ "1% performance overhead of paravirt_ops on native kernels".
  6. ^ "Road to Mac OS X 10.6 Snow Leopard: 64-Bits". 2008-09-26. Retrieved 2008-09-26.
  7. ^ "Memory Limits for Windows releases". Microsoft. December 5, 2007. Retrieved 2007-12-10.
  8. ^ "Intel Physical Addressing Extensions (PAE) in Windows 2000". Microsoft. October 26, 2007. Retrieved 2007-12-29.
  9. ^ "Overview of Windows Server 2003 R2 Datacenter Edition". Microsoft. Unknown. Retrieved 2009-05-15. {{cite web}}: Check date values in: |date= (help)
  10. ^ "Memory Limits for Windows Releases". Microsoft. March 25, 2010. Retrieved 2010-04-05.
  11. ^ "The RAM reported by the System Properties dialog box and the System Information tool is less than you expect in Windows Vista or in Windows XP Service Pack 2 or later version (MSKB 888137)". Knowledge Base. Microsoft. Retrieved 2009-01-30.
  12. ^ http://blogs.technet.com/markrussinovich/archive/2008/07/21/3092070.aspx
  13. ^ http://www.geoffchappell.com/notes/windows/license/memory.htm
  14. ^ "Solaris 7 5/99 Release Notes (Intel Platform Edition), Appendix B: Hardware Compatibility List and Device Configuration Guide (Intel Platform Edition) 5/99". 1999. Retrieved 2007-11-26.