Jump to content

Physical Address Extension: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
DumZiBoT (talk | contribs)
Faalagorn (talk | contribs)
m Unified bytes measurements, I hope that I didn’t messed anything +wikEd blanks & empty lines fix
Line 1: Line 1:
In [[computing]], '''Physical Address Extension''' ('''PAE''') refers to a feature of [[x86]] and [[x86-64]] processors that allows more than 4 [[gigabyte]]s ([[GB]]) of [[physical memory]] to be used in [[32-bit]] systems, given appropriate [[operating system]] support<ref>1 GB = 1024 [[megabyte|MB]] ; 1 MB = 1024 [[kilobyte|KB]] ; 1 KB = 1024 [[byte|B]]</ref> PAE is provided by [[Intel]] [[Pentium Pro]] and above [[Central processing unit|CPUs]] (including all later Pentium-series processors except the 400 MHz bus versions of the [[Pentium M]]), as well as by some compatible processors such as [[Athlon]] and later models from [[AMD]].
In [[computing]], '''Physical Address Extension''' ('''PAE''') refers to a feature of [[x86]] and [[x86-64]] processors that allows more than 4 [[gigabyte]]s ([[GiB]]) of [[physical memory]] to be used in [[32-bit]] systems, given appropriate [[operating system]] support PAE is provided by [[Intel]] [[Pentium Pro]] and above [[Central processing unit|CPUs]] (including all later Pentium-series processors except the 400 MHz bus versions of the [[Pentium M]]), as well as by some compatible processors such as [[Athlon]] and later models from [[AMD]].


The x86 processor hardware is augmented with additional address lines used to select the additional memory, so physical address size is increased from 32 bits to 36 bits. This increases maximum physical memory size from 4 GB to 64 GB.
The x86 processor hardware is augmented with additional address lines used to select the additional memory, so physical address size is increased from 32 bits to 36 bits. This increases maximum physical memory size from 4 GiB to 64 GiB.
The 32-bit size of 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 (GB). The operating system uses [[page table]]s to map this 4 GB address space onto the 64 GB of total memory, and the map is usually different for each [[Process (computing)|process]]. In this way the extra memory is useful even though no single regular application can access it all simultaneously.
The 32-bit size of 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 (GiB). The operating system uses [[page table]]s to map this 4 GiB address space onto the 64 GiB of total memory, and the map is usually different for each [[Process (computing)|process]]. In this way the extra memory is useful even though no single regular application can access it all simultaneously.


For application software which needs access to more than 4 GB of memory, some special mechanism may be provided by the operating system in addition to the regular PAE support. On [[Microsoft Windows]] this mechanism is called [[Address Windowing Extensions]] (AWE), while on [[Unix-like]] systems a variety of tricks are used, such as using <tt>[[mmap|mmap()]]</tt> to map regions of a file into and out of the address space as needed, none having been blessed as a standard.
For application software which needs access to more than 4 GiB of memory, some special mechanism may be provided by the operating system in addition to the regular PAE support. On [[Microsoft Windows]] this mechanism is called [[Address Windowing Extensions]] (AWE), while on [[Unix-like]] systems a variety of tricks are used, such as using <tt>[[mmap|mmap()]]</tt> to map regions of a file into and out of the address space as needed, none having been blessed as a standard.


==Page table structures==
== Page table structures ==


In traditional 32-bit [[protected mode]], x86 processors use a two-level page translation scheme, where the [[control register]] <code>CR3</code> points to a single 4 KB long ''page directory'', which is divided into 1024 x 4 byte entries that point to 4 KB long [[page table]]s, similarly consisting of 1024 x 4 byte entries pointing to 4 KB long [[page (computing)|pages]].<ref> 1 KB = 1024 [[byte|B]]</ref>
In traditional 32-bit [[protected mode]], x86 processors use a two-level page translation scheme, where the [[control register]] <code>CR3</code> points to a single 4 KiB long ''page directory'', which is divided into 1024 x 4 byte entries that point to 4 KiB long [[page table]]s, similarly consisting of 1024 x 4 byte entries pointing to 4 KiB long [[page (computing)|pages]].


Enabling PAE (by setting bit 5, ''PAE'', of the system register <code>CR4</code>) 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 is extended 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.
Enabling PAE (by setting bit 5, ''PAE'', of the system register <code>CR4</code>) 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 is extended 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 <code>PS</code> (for ''Page Size''). If this bit is set to 1, the page directory entry does not point to a page table, but to a single large 2 MB page.<ref>1 MB = 1024 [[kilobyte|KB]] ; 1 KB = 1024 [[byte|B]]</ref> The [[NX bit]] is another flag in the page directory, in bit 63, to mark pages as "No eXecute". Because the 12 most significant bits of page table entry's 64 bits are either such flags or are available for OS-specific data, a maximum of 52 bits can be potentially utilized in future to address 2<sup>52</sup>&nbsp;bytes, or 4&nbsp;[[petabyte]]s, of physical memory.<ref> 1 PB = 2<sup>50</sup>&nbsp;[[byte|B]]</ref>
The entries in the page directory have an additional flag, in bit 7, named <code>PS</code> (for ''Page Size''). If this bit is set 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 most significant bits of page table entry's 64 bits are either such flags or are available for OS-specific data, a maximum of 52 bits can be potentially utilized in future to address 2<sup>52</sup> bytes, or 4 [[petabyte]]s, of physical memory.


The [[x86 architecture]] presently uses only 36 bits out of 52 bits possible. On [[x86-64]] processors, PAE is obligatory in native [[long mode]]; presently 40 bits are used out of 52 bits possible.<ref>{{cite web
The [[x86 architecture]] presently uses only 36 bits out of 52 bits possible. On [[x86-64]] processors, PAE is obligatory in native [[long mode]]; presently 40 bits are used out of 52 bits possible.<ref>{{cite web
| title = Intel 64 and IA-32 Software Developer's Manual - Volume 3A
| title = Intel 64 and IA-32 Software Developer's Manual - Volume 3A
| publisher = [[Intel]]
| publisher = [[Intel]]
| url = http://developer.intel.com/design/processor/manuals/253668.pdf
| url = http://developer.intel.com/design/processor/manuals/253668.pdf
| accessdate = 2007-11-16 }} Page 3.42.</ref>
| accessdate = 2007-11-16 }} Page 3.42.</ref>


CPU support of PAE mode can be identified via the [[CPUID]] flag ''PAE''.
CPU support of PAE mode can be identified via the [[CPUID]] flag ''PAE''.


<gallery caption="Page table structures" widths="400px" heights="300px" perrow="2">
<gallery caption="Page table structures" widths="400px" heights="300px" perrow="2">
Image:X86 Paging 4K.svg|No PAE, 4 KB pages
Image:X86 Paging 4K.svg|No PAE, 4 KiB pages
Image:X86 Paging 4M.svg|No PAE, 4 MB pages
Image:X86 Paging 4M.svg|No PAE, 4 MiB pages
Image:X86 Paging PAE 4K.svg|PAE with 4 KB pages
Image:X86 Paging PAE 4K.svg|PAE with 4 KiB pages
Image:X86 Paging PAE 2M.svg|PAE with 2 MB pages
Image:X86 Paging PAE 2M.svg|PAE with 2 MiB pages
</gallery>
</gallery>


==Operating system support==
== Operating system support ==

===FreeBSD===
=== 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. The kernel '''PAE''' configuration option is required. [[Loadable kernel module]]s 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.<ref>{{cite web

[[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. The kernel '''PAE''' configuration option is required. [[Loadable kernel module]]s 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 GiB of physical memory; those drivers won't work correctly on a system with PAE.<ref>{{cite web
| title = FreeBSD PAE(4) man page
| title = FreeBSD PAE(4) man page
| date = 2003-04-08
| date = 2003-04-08
Line 37: Line 39:
| accessdate = 2007-11-26}}</ref>
| accessdate = 2007-11-26}}</ref>


===Linux===
=== Linux ===

The [[Linux kernel]] includes full PAE support starting with version 2.6.<ref>{{cite web
The [[Linux kernel]] includes full PAE support starting with version 2.6.<ref>{{cite web
| title = Wonderful World of Linux 2.6
| title = Wonderful World of Linux 2.6
| url = http://kniggit.net/wwol26.html }}</ref> The 2.6 version of the kernel fully supports PAE, 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.
| url = http://kniggit.net/wwol26.html }}</ref> The 2.6 version of the kernel fully supports PAE, enabling access of up to 64 GiB of memory on 32-bit machines. A PAE-enabled Linux-kernel requires that the CPU also support PAE.


===Solaris===
=== Solaris ===

[[Solaris (operating system)|Solaris]] supports PAE beginning with Solaris version 7. However, third-party drivers used with version 7 and not specifically written to include PAE support may operate erratically or fail outright on a system with PAE.<ref>{{cite web
[[Solaris (operating system)|Solaris]] supports PAE beginning with Solaris version 7. However, third-party drivers used with version 7 and not specifically written to include PAE support may operate erratically or fail outright on a system with PAE.<ref>{{cite web
| title=Solaris 7 5/99 Release Notes (Intel Platform Edition), Appendix B: Hardware Compatibility List and Device Configuration Guide (Intel Platform Edition) 5/99
| title=Solaris 7 5/99 Release Notes (Intel Platform Edition), Appendix B: Hardware Compatibility List and Device Configuration Guide (Intel Platform Edition) 5/99
| year = 1999
| year = 1999
Line 49: Line 53:
| accessdate = 2007-11-26}}</ref>
| accessdate = 2007-11-26}}</ref>


===Windows===
=== Windows ===

PAE is supported in the following versions of 32-bit Windows:<ref>{{cite web
PAE is supported in the following versions of 32-bit Windows:<ref>{{cite web
| title = Memory Limits for Windows releases
| title = Memory Limits for Windows releases
Line 61: Line 66:
| url = http://support.microsoft.com/kb/268363/
| url = http://support.microsoft.com/kb/268363/
| accessdate = 2007-12-29 }}</ref>
| accessdate = 2007-12-29 }}</ref>

{| class="wikitable"
{| class="wikitable"
! Version
! Version
Line 66: Line 72:
|-
|-
| [[Windows 2000 Advanced Server]]
| [[Windows 2000 Advanced Server]]
| align="center" | 8 GB
| align="center" | 8 GiB
|-
|-
| [[Windows 2000 Datacenter Server]]
| [[Windows 2000 Datacenter Server]]
| align="center" | 32 GB
| align="center" | 32 GiB
|-
|-
| [[Windows_XP|Windows XP]] <ref>{{cite web
| [[Windows XP|Windows XP]] <ref>{{cite web
| title = Physical Address Extension
| title = Physical Address Extension
| publisher = [[Microsoft]]
| publisher = [[Microsoft]]
| url = http://msdn2.microsoft.com/en-us/library/aa366796(VS.85).aspx}}</ref>
| url = http://msdn2.microsoft.com/en-us/library/aa366796(VS.85).aspx}}</ref>
| align="center" | 4 GB
| align="center" | 4 GiB
|-
|-
| [[Windows Server 2003]] Enterprise Edition
| [[Windows Server 2003]] Enterprise Edition
| align="center" | 32 GB
| align="center" | 32 GiB
|-
|-
| [[Windows Server 2003]] R2 (or SP1) Enterprise Edition
| [[Windows Server 2003]] R2 (or SP1) Enterprise Edition
| align="center" | 64 GB
| align="center" | 64 GiB
|-
|-
| [[Windows Server 2003]] Datacenter Edition <ref>{{cite web
| [[Windows Server 2003]] Datacenter Edition <ref>{{cite web
Line 89: Line 95:
| accessdate = 2008-03-22}}</ref>
| accessdate = 2008-03-22}}</ref>


| align="center" | 64 GB <!-- above sources say 128 here... expert needed -->
| align="center" | 64 GiB <!-- above sources say 128 here... expert needed -->
|-
|-
| [[Windows Server 2003]] Standard Edition
| [[Windows Server 2003]] Standard Edition
| align="center" | 4 GB
| align="center" | 4 GiB
|-
|-
| [[Windows Vista]]
| [[Windows Vista]]
| align="center" | 4 GB
| align="center" | 4 GiB
|-
|-
| [[Windows Server 2008]] Enterprise or Datacenter Edition
| [[Windows Server 2008]] Enterprise or Datacenter Edition
| align="center" | 64 GB
| align="center" | 64 GiB
|-
|-
| [[Windows Server 2008]] other editions
| [[Windows Server 2008]] other editions
| align="center" | 4 GB
| align="center" | 4 GiB
|}
|}


Windows XP SP2 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. The NX (or XD) bit resides in bit 63 of the page table entry, and without PAE, page table entries only have 32 bits; therefore PAE mode is required if the NX feature is to be exploited. However, desktop versions of Windows (Windows XP, Windows Vista) limit physical address space to 4 GB for driver compatibility reasons.
Windows XP SP2 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. The NX (or XD) bit resides in bit 63 of the page table entry, and without PAE, page table entries only have 32 bits; therefore PAE mode is required if the NX feature is to be exploited. However, desktop versions of Windows (Windows XP, Windows Vista) limit physical address space to 4 GiB for driver compatibility reasons.

== See also ==


==See also==
* [[PSE-36]]: an alternative to Physical Address Extension
* [[PSE-36]]: an alternative to Physical Address Extension
* [[Page Size Extension]]
* [[Page Size Extension]]
* [[Architecture of Windows NT]]
* [[Architecture of Windows NT]]


==References==
== References ==
{{Reflist}}
{{Reflist}}


==External links==
== External links ==

* [http://msdn2.microsoft.com/en-us/library/aa366796.aspx Windows PAE entry on MSDN Library]
* [http://msdn2.microsoft.com/en-us/library/aa366796.aspx Windows PAE entry on MSDN Library]
* [http://support.microsoft.com/?kbid=291988 Windows PAE entry on Microsoft knowledge base]
* [http://support.microsoft.com/?kbid=291988 Windows PAE entry on Microsoft knowledge base]

Revision as of 16:08, 17 June 2008

In computing, Physical Address Extension (PAE) refers to a feature of x86 and x86-64 processors that allows more than 4 gigabytes (GiB) of physical memory to be used in 32-bit systems, given appropriate operating system support 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 some compatible processors such as Athlon and later models from AMD.

The x86 processor hardware is augmented with additional address lines used to select the additional memory, so physical address size is increased from 32 bits to 36 bits. This increases maximum physical memory size from 4 GiB to 64 GiB. The 32-bit size of 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 (GiB). The operating system uses page tables to map this 4 GiB address space onto the 64 GiB of total memory, and the map is usually different for each process. In this way the extra memory is useful even though no single regular application can access it all simultaneously.

For application software which needs access to more than 4 GiB of memory, some special mechanism may be provided by the operating system in addition to the regular PAE support. On Microsoft Windows this mechanism is called Address Windowing Extensions (AWE), while on Unix-like systems a variety of tricks are used, such as using mmap() to map regions of a file into and out of the address space as needed, none having been blessed as a standard.

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, which is divided into 1024 x 4 byte entries that point to 4 KiB long page tables, similarly consisting of 1024 x 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 is extended 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 this bit is set 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 most significant bits of page table entry's 64 bits are either such flags or are available for OS-specific data, a maximum of 52 bits can be potentially utilized in future to address 252 bytes, or 4 petabytes, of physical memory.

The x86 architecture presently uses only 36 bits out of 52 bits possible. On x86-64 processors, PAE is obligatory in native long mode; presently 40 bits are used out of 52 bits possible.[1]

CPU support of PAE mode can be identified via the CPUID flag PAE.

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. The kernel PAE configuration option is required. 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 GiB of physical memory; those drivers won't work correctly on a system with PAE.[2]

Linux

The Linux kernel includes full PAE support starting with version 2.6.[3] The 2.6 version of the kernel fully supports PAE, enabling access of up to 64 GiB of memory on 32-bit machines. A PAE-enabled Linux-kernel requires that the CPU also support PAE.

Solaris

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

Windows

PAE is supported in the following versions of 32-bit Windows:[5][6]

Version Maximum Physical Memory
Windows 2000 Advanced Server 8 GiB
Windows 2000 Datacenter Server 32 GiB
Windows XP [7] 4 GiB
Windows Server 2003 Enterprise Edition 32 GiB
Windows Server 2003 R2 (or SP1) Enterprise Edition 64 GiB
Windows Server 2003 Datacenter Edition [8] 64 GiB
Windows Server 2003 Standard Edition 4 GiB
Windows Vista 4 GiB
Windows Server 2008 Enterprise or Datacenter Edition 64 GiB
Windows Server 2008 other editions 4 GiB

Windows XP SP2 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. The NX (or XD) bit resides in bit 63 of the page table entry, and without PAE, page table entries only have 32 bits; therefore PAE mode is required if the NX feature is to be exploited. However, desktop versions of Windows (Windows XP, Windows Vista) limit physical address space to 4 GiB for driver compatibility reasons.

See also

References

  1. ^ "Intel 64 and IA-32 Software Developer's Manual - Volume 3A" (PDF). Intel. Retrieved 2007-11-16. Page 3.42.
  2. ^ "FreeBSD PAE(4) man page". 2003-04-08. Retrieved 2007-11-26.
  3. ^ "Wonderful World of Linux 2.6".
  4. ^ "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.
  5. ^ "Memory Limits for Windows releases". Microsoft. December 5, 2007. Retrieved 2007-12-10.
  6. ^ "Intel Physical Addressing Extensions (PAE) in Windows 2000". Microsoft. October 26, 2007. Retrieved 2007-12-29.
  7. ^ "Physical Address Extension". Microsoft.
  8. ^ "Memory Support and Windows Operating Systems". 2007. Retrieved 2008-03-22.