How is PAE implemented in Linux?

3

There are only 36 physical address lines but a page table entry is 64 bit long. How does the CPU check if the address is valid ? How does Linux OS map the same virtual address in different processes to different physical addresses?

Here is the wikipedia article about physical address extension(PAE). http://en.wikipedia.org/wiki/Physical_Address_Extension .

Jeff

Posted 2013-03-01T16:06:04.670

Reputation: 139

By adding different offsets to them, perhaps? – H2CO3 – 2013-03-01T16:08:07.133

2PT entries are 64-bit because they can only be 32 or 64 bits wide. There is no such thing as a 36-bit integer that a CPU can usually access (not any real CPU anyway, without shifting and masking). It doesn't matter, however. The OS will write 64-bit-sized 36-bit integers into the PT, and the application uses 32-bit integers as pointers which the PT translates to whatever the respective entries point to. Including several virtual addresses pointing to the same phyical one. Nobody cares, the hardware just maps what you tell it to what you tell it. – Damon – 2013-03-01T16:11:49.997

Answers

1

There are only 36 physical address lines but a page table entry is 64 bit long. How does the CPU check if the address is valid?

This is actually done by a piece of hardware called the memory management unit (MMU), which handles virtual-to-physical address translation. In terms of an address being "valid", each process has it's own unique address space (thus implementing a virtual memory scheme), so any address is technically valid. Remember, a process can allocate more memory than is physically available.

The MMU uses a translation lookaside buffer (TLB) to quickly decode the virtual address into a physical one, held within a page table.

How does Linux OS map the same virtual address in different processes to different physical addresses?

This is again due to each process having a unique virtual address space, which is fundamental for implementing virtual memory. A virtual address for a given process is mapped to some physical storage hardware (RAM, disk, etc...), but the mapping is done at run-time by the operating system & MMU.

Breakthrough

Posted 2013-03-01T16:06:04.670

Reputation: 32 927