Address Space Setup on AMD64

The address space setup on AMD64 systems is easier than for IA-32 in some respects, but unfortunately also harder in others. While having a 64-bit virtual address space allows for avoiding oddities like high memory, things are complicated by another factor: The address space spanned by 64 bits is so large that there are currently simply no applications that would require this. Current implementations therefore implement a smaller physical address space that is only 48 bits wide. This allows for simplifying and speeding up address translation without losing flexibility: 248 bits still allows addressing 256 TiB, or 256 x 1,024 GiB — which is plenty even for Firefox!

While the physical address space is restricted to 48 bits, addressing the virtual address space is still performed with 64-bit pointers, and the space therefore has to span 64 bits formally. This raises a problem, though: Some parts of the virtual address space cannot be addressed because effectively only 48 bits can be handled.

Since future hardware implementations might support larger physical address spaces, it is not possible to simply to remap the subset that is not addressable to a different subset of the address space. Suppose that any program would rely on pointers into the unimplemented address space to be remapped to some part of the regular address space. Next-generation processors that implement more physical address bits would lead to a different behavior and thus break all existing code.

Clearly, accessing the unimplemented regions must be hindered by the processor. One possibility to enforce this would be to forbid use of all virtual addresses larger than the physical address space. This, however, is not the approach chosen by the hardware designers. Their solution is based on a sign extension approach, which is illustrated in Figure 3-18.

Kernelspace

Userspace o

Higher half

Higher half

Lower half

Lower half o x FFFF FFFF FFFF FFFF

o x FFFF 8000 0000 0000 Non-canonical area o x 0000 7FFF FFFF FFFF

Continue reading here: Figure 318 Possible virtual versus implemented physical address space on AMD64 machines

Was this article helpful?

0 0