diff options
Diffstat (limited to 'Documentation/arm64/memory.txt')
-rw-r--r-- | Documentation/arm64/memory.txt | 98 |
1 files changed, 15 insertions, 83 deletions
diff --git a/Documentation/arm64/memory.txt b/Documentation/arm64/memory.txt index 4c720d698e8e..8845d0847a66 100644 --- a/Documentation/arm64/memory.txt +++ b/Documentation/arm64/memory.txt | |||
@@ -2,19 +2,18 @@ | |||
2 | ============================== | 2 | ============================== |
3 | 3 | ||
4 | Author: Catalin Marinas <catalin.marinas@arm.com> | 4 | Author: Catalin Marinas <catalin.marinas@arm.com> |
5 | Date : 20 February 2012 | ||
6 | 5 | ||
7 | This document describes the virtual memory layout used by the AArch64 | 6 | This document describes the virtual memory layout used by the AArch64 |
8 | Linux kernel. The architecture allows up to 4 levels of translation | 7 | Linux kernel. The architecture allows up to 4 levels of translation |
9 | tables with a 4KB page size and up to 3 levels with a 64KB page size. | 8 | tables with a 4KB page size and up to 3 levels with a 64KB page size. |
10 | 9 | ||
11 | AArch64 Linux uses either 3 levels or 4 levels of translation tables with | 10 | AArch64 Linux uses either 3 levels or 4 levels of translation tables |
12 | the 4KB page configuration, allowing 39-bit (512GB) or 48-bit (256TB) | 11 | with the 4KB page configuration, allowing 39-bit (512GB) or 48-bit |
13 | virtual addresses, respectively, for both user and kernel. With 64KB | 12 | (256TB) virtual addresses, respectively, for both user and kernel. With |
14 | pages, only 2 levels of translation tables, allowing 42-bit (4TB) | 13 | 64KB pages, only 2 levels of translation tables, allowing 42-bit (4TB) |
15 | virtual address, are used but the memory layout is the same. | 14 | virtual address, are used but the memory layout is the same. |
16 | 15 | ||
17 | User addresses have bits 63:39 set to 0 while the kernel addresses have | 16 | User addresses have bits 63:48 set to 0 while the kernel addresses have |
18 | the same bits set to 1. TTBRx selection is given by bit 63 of the | 17 | the same bits set to 1. TTBRx selection is given by bit 63 of the |
19 | virtual address. The swapper_pg_dir contains only kernel (global) | 18 | virtual address. The swapper_pg_dir contains only kernel (global) |
20 | mappings while the user pgd contains only user (non-global) mappings. | 19 | mappings while the user pgd contains only user (non-global) mappings. |
@@ -27,26 +26,7 @@ AArch64 Linux memory layout with 4KB pages + 3 levels: | |||
27 | Start End Size Use | 26 | Start End Size Use |
28 | ----------------------------------------------------------------------- | 27 | ----------------------------------------------------------------------- |
29 | 0000000000000000 0000007fffffffff 512GB user | 28 | 0000000000000000 0000007fffffffff 512GB user |
30 | 29 | ffffff8000000000 ffffffffffffffff 512GB kernel | |
31 | ffffff8000000000 ffffffbbfffeffff ~240GB vmalloc | ||
32 | |||
33 | ffffffbbffff0000 ffffffbbffffffff 64KB [guard page] | ||
34 | |||
35 | ffffffbc00000000 ffffffbdffffffff 8GB vmemmap | ||
36 | |||
37 | ffffffbe00000000 ffffffbffbbfffff ~8GB [guard, future vmmemap] | ||
38 | |||
39 | ffffffbffa000000 ffffffbffaffffff 16MB PCI I/O space | ||
40 | |||
41 | ffffffbffb000000 ffffffbffbbfffff 12MB [guard] | ||
42 | |||
43 | ffffffbffbc00000 ffffffbffbdfffff 2MB fixed mappings | ||
44 | |||
45 | ffffffbffbe00000 ffffffbffbffffff 2MB [guard] | ||
46 | |||
47 | ffffffbffc000000 ffffffbfffffffff 64MB modules | ||
48 | |||
49 | ffffffc000000000 ffffffffffffffff 256GB kernel logical memory map | ||
50 | 30 | ||
51 | 31 | ||
52 | AArch64 Linux memory layout with 4KB pages + 4 levels: | 32 | AArch64 Linux memory layout with 4KB pages + 4 levels: |
@@ -54,26 +34,7 @@ AArch64 Linux memory layout with 4KB pages + 4 levels: | |||
54 | Start End Size Use | 34 | Start End Size Use |
55 | ----------------------------------------------------------------------- | 35 | ----------------------------------------------------------------------- |
56 | 0000000000000000 0000ffffffffffff 256TB user | 36 | 0000000000000000 0000ffffffffffff 256TB user |
57 | 37 | ffff000000000000 ffffffffffffffff 256TB kernel | |
58 | ffff000000000000 ffff7bfffffeffff ~124TB vmalloc | ||
59 | |||
60 | ffff7bffffff0000 ffff7bffffffffff 64KB [guard page] | ||
61 | |||
62 | ffff7c0000000000 ffff7dffffffffff 2TB vmemmap | ||
63 | |||
64 | ffff7e0000000000 ffff7ffffbbfffff ~2TB [guard, future vmmemap] | ||
65 | |||
66 | ffff7ffffa000000 ffff7ffffaffffff 16MB PCI I/O space | ||
67 | |||
68 | ffff7ffffb000000 ffff7ffffbbfffff 12MB [guard] | ||
69 | |||
70 | ffff7ffffbc00000 ffff7ffffbdfffff 2MB fixed mappings | ||
71 | |||
72 | ffff7ffffbe00000 ffff7ffffbffffff 2MB [guard] | ||
73 | |||
74 | ffff7ffffc000000 ffff7fffffffffff 64MB modules | ||
75 | |||
76 | ffff800000000000 ffffffffffffffff 128TB kernel logical memory map | ||
77 | 38 | ||
78 | 39 | ||
79 | AArch64 Linux memory layout with 64KB pages + 2 levels: | 40 | AArch64 Linux memory layout with 64KB pages + 2 levels: |
@@ -81,44 +42,14 @@ AArch64 Linux memory layout with 64KB pages + 2 levels: | |||
81 | Start End Size Use | 42 | Start End Size Use |
82 | ----------------------------------------------------------------------- | 43 | ----------------------------------------------------------------------- |
83 | 0000000000000000 000003ffffffffff 4TB user | 44 | 0000000000000000 000003ffffffffff 4TB user |
45 | fffffc0000000000 ffffffffffffffff 4TB kernel | ||
84 | 46 | ||
85 | fffffc0000000000 fffffdfbfffeffff ~2TB vmalloc | ||
86 | |||
87 | fffffdfbffff0000 fffffdfbffffffff 64KB [guard page] | ||
88 | 47 | ||
89 | fffffdfc00000000 fffffdfdffffffff 8GB vmemmap | 48 | For details of the virtual kernel memory layout please see the kernel |
49 | booting log. | ||
90 | 50 | ||
91 | fffffdfe00000000 fffffdfffbbfffff ~8GB [guard, future vmmemap] | ||
92 | 51 | ||
93 | fffffdfffa000000 fffffdfffaffffff 16MB PCI I/O space | 52 | Translation table lookup with 4KB pages: |
94 | |||
95 | fffffdfffb000000 fffffdfffbbfffff 12MB [guard] | ||
96 | |||
97 | fffffdfffbc00000 fffffdfffbdfffff 2MB fixed mappings | ||
98 | |||
99 | fffffdfffbe00000 fffffdfffbffffff 2MB [guard] | ||
100 | |||
101 | fffffdfffc000000 fffffdffffffffff 64MB modules | ||
102 | |||
103 | fffffe0000000000 ffffffffffffffff 2TB kernel logical memory map | ||
104 | |||
105 | |||
106 | Translation table lookup with 4KB pages + 3 levels: | ||
107 | |||
108 | +--------+--------+--------+--------+--------+--------+--------+--------+ | ||
109 | |63 56|55 48|47 40|39 32|31 24|23 16|15 8|7 0| | ||
110 | +--------+--------+--------+--------+--------+--------+--------+--------+ | ||
111 | | | | | | | | ||
112 | | | | | | v | ||
113 | | | | | | [11:0] in-page offset | ||
114 | | | | | +-> [20:12] L3 index | ||
115 | | | | +-----------> [29:21] L2 index | ||
116 | | | +---------------------> [38:30] L1 index | ||
117 | | +-------------------------------> [47:39] L0 index (not used) | ||
118 | +-------------------------------------------------> [63] TTBR0/1 | ||
119 | |||
120 | |||
121 | Translation table lookup with 4KB pages + 4 levels: | ||
122 | 53 | ||
123 | +--------+--------+--------+--------+--------+--------+--------+--------+ | 54 | +--------+--------+--------+--------+--------+--------+--------+--------+ |
124 | |63 56|55 48|47 40|39 32|31 24|23 16|15 8|7 0| | 55 | |63 56|55 48|47 40|39 32|31 24|23 16|15 8|7 0| |
@@ -133,7 +64,7 @@ Translation table lookup with 4KB pages + 4 levels: | |||
133 | +-------------------------------------------------> [63] TTBR0/1 | 64 | +-------------------------------------------------> [63] TTBR0/1 |
134 | 65 | ||
135 | 66 | ||
136 | Translation table lookup with 64KB pages + 2 levels: | 67 | Translation table lookup with 64KB pages: |
137 | 68 | ||
138 | +--------+--------+--------+--------+--------+--------+--------+--------+ | 69 | +--------+--------+--------+--------+--------+--------+--------+--------+ |
139 | |63 56|55 48|47 40|39 32|31 24|23 16|15 8|7 0| | 70 | |63 56|55 48|47 40|39 32|31 24|23 16|15 8|7 0| |
@@ -142,10 +73,11 @@ Translation table lookup with 64KB pages + 2 levels: | |||
142 | | | | | v | 73 | | | | | v |
143 | | | | | [15:0] in-page offset | 74 | | | | | [15:0] in-page offset |
144 | | | | +----------> [28:16] L3 index | 75 | | | | +----------> [28:16] L3 index |
145 | | | +--------------------------> [41:29] L2 index (only 38:29 used) | 76 | | | +--------------------------> [41:29] L2 index |
146 | | +-------------------------------> [47:42] L1 index (not used) | 77 | | +-------------------------------> [47:42] L1 index |
147 | +-------------------------------------------------> [63] TTBR0/1 | 78 | +-------------------------------------------------> [63] TTBR0/1 |
148 | 79 | ||
80 | |||
149 | When using KVM, the hypervisor maps kernel pages in EL2, at a fixed | 81 | When using KVM, the hypervisor maps kernel pages in EL2, at a fixed |
150 | offset from the kernel VA (top 24bits of the kernel VA set to zero): | 82 | offset from the kernel VA (top 24bits of the kernel VA set to zero): |
151 | 83 | ||