Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PAE in x86-64 bit processors - Linux kernel

I have noticed that the PAE bit in the CR4 register is turned on my Linux (3.19) x86-64 machine. The PAE feature allows physical addresses up to 64gb to be accessed but I do not understand why it is needed when long-mode is enabled. I have looked it up for a while but haven't found any satisfying answer.

Any suggestions?

like image 528
Rouki Avatar asked Jan 15 '17 10:01

Rouki


People also ask

What is PAE kernel in Linux?

February 2, 2014 by golinuxhub. The Physical Address Extension (PAE) is a feature implemented in modern x86 processors. PAE extends memory addressing capabilities, allowing more than 4 GB of random access memory (RAM) to be used. NOTE: All the Linux machine with kernel version above 2.3.

What is x86_64 Linux?

Linux x86_64 (64-bit) is a Unix-like and mostly POSIX-compliant computer operating system (OS) assembled under the model of free and open-source software development and distribution. Using host OS (Mac OS X or Linux 64-bit) you can build native application for Linux x86_64 platform.

Does Pentium 4 support PAE?

PAE is supported by the Pentium Pro, Pentium II, Pentium III, and Pentium 4 processors. The first Pentium M family processors ("Banias") introduced in 2003 also support PAE; however, they do not show the PAE support flag in their CPUID information.

What is non PAE?

Here's a very simple explanation: in non-PAE mode, a 32-bit CPU must lookup (access) two tables to access a physical memory address; in PAE-mode, it must lookup three tables to do so.


1 Answers

It is using IA-32e paging.

A logical processor uses IA-32e paging if CR0.PG = 1, CR4.PAE = 1, and IA32_EFER.LME = 1.
With IA-32e paging, linear address are translated using a hierarchy of in-memory paging structures located using the contents of CR3.
IA-32e paging translates 48-bit linear addresses to 52-bit physical addresses.
Although 52 bits corresponds to 4 PBytes, linear addresses are limited to 48 bits; at most 256 TBytes of linear-address space may be accessed at any given time.


x86 processors supports three paging modes:

  1. 32-bit paging (CR0.PG = 1 and CR4.PAE = 0)
  2. PAE paging (CR0.PG = 1, CR4.PAE = 1, and IA32_EFER.LME = 0)
  3. IA-32e paging (CR0.PG = 1, CR4.PAE = 1, and IA32_EFER.LME = 1)

A table summarising the differences is reported here (as image, unfortunately)

Differences between the three paging modes on x86

like image 178
Margaret Bloom Avatar answered Sep 27 '22 21:09

Margaret Bloom