1. 简介
虽然x86_64的物理地址范围为64bit,但是因为地址空间太大目前不可能完全用完,当前支持57bit和48bit两种虚拟地址模式。
地址模式 |
单个空间 |
用户地址空间 |
内核地址空间 |
32位 |
2G |
0x00000000 - 0x7FFFFFFF |
0x80000000 - 0xFFFFFFFF |
64位(48bit) |
128T |
0x00000000 00000000 - 0x00007FFF FFFFFFFF |
0xFFFF8000 00000000 - 0xFFFFFFFF FFFFFFFF |
64位(57bit) |
64P |
0x00000000 00000000 - 0x00FFFFFF FFFFFFFF |
0xFF000000 00000000 - 0xFFFFFFFF FFFFFFFF |
48bit模式的地址空间布局(4级页表)
Start addr |
Offset |
End addr |
Size |
VM area description |
描述 |
0000000000000000 |
0 |
00007fffffffffff |
128 TB |
user-space virtual memory, different per mm |
用户地址空间,每个进程mm指向的都不同 |
0000800000000000 |
+128 TB |
ffff7fffffffffff |
~16M TB |
… huge, almost 64 bits wide hole of non-canonical virtual memory addresses up to the -128 TB starting offset of kernel mappings. |
巨大空洞 |
- |
- |
- |
- |
Kernel-space virtual memory, shared between all processes: |
以下为内核地址空间: |
ffff800000000000 |
-128 TB |
ffff87ffffffffff |
8 TB |
… guard hole, also reserved for hypervisor |
- |
ffff880000000000 |
-120 TB |
ffff887fffffffff |
0.5 TB |
LDT remap for PTI |
LDT(Local Descriptor Table):局部描述符表KPTI(Kernel page-table isolation):内核页表隔离 |
ffff888000000000 |
-119.5 TB |
ffffc87fffffffff |
64 TB |
direct mapping of all physical memory (page_offset_base) |
线性映射的区域 |
ffffc88000000000 |
-55.5 TB |
ffffc8ffffffffff |
0.5 TB |
… unused hole |
- |
ffffc90000000000 |
-55 TB |
ffffe8ffffffffff |
32 TB |
vmalloc/ioremap space (vmalloc_base) |
vmalloc和ioremap空间 |
ffffe90000000000 |
-23 TB |
ffffe9ffffffffff |
1 TB |
… unused hole |
- |
ffffea0000000000 |
-22 TB |
ffffeaffffffffff |
1 TB |
virtual memory map (vmemmap_base) |
page结构存储的位置 |
ffffeb0000000000 |
-21 TB |
ffffebffffffffff |
1 TB |
… unused hole |
- |
ffffec0000000000 |
-20 TB |
fffffbffffffffff |
16 TB |
KASAN shadow memory |
KASAN影子内存 |
- |
- |
- |
- |
Identical layout to the 56-bit one from here on: |
从这里开始,与56-bit布局相同: |
fffffc0000000000 |
-4 TB |
fffffdffffffffff |
2 TB |
… unused hole |
- |
- |
- |
- |
- |
vaddr_end for KASLR |
- |
fffffe0000000000 |
-2 TB |
fffffe7fffffffff |
0.5 TB |
cpu_entry_area mapping |
- |
fffffe8000000000 |
-1.5 TB |
fffffeffffffffff |
0.5 TB |
… unused hole |
- |
ffffff0000000000 |
-1 TB |
ffffff7fffffffff |
0.5 TB |