Tekkaman Ninja | bf34be0 | 2012-10-25 00:02:53 +0800 | [diff] [blame] | 1 | Chinese translated version of Documentation/arm64/memory.txt |
| 2 | |
| 3 | If you have any comment or update to the content, please contact the |
| 4 | original document maintainer directly. However, if you have a problem |
| 5 | communicating in English you can also ask the Chinese maintainer for |
| 6 | help. Contact the Chinese maintainer if this translation is outdated |
| 7 | or if there is a problem with the translation. |
| 8 | |
| 9 | Maintainer: Catalin Marinas <catalin.marinas@arm.com> |
Fu Wei | d0f2a80 | 2014-01-28 20:14:29 +0800 | [diff] [blame] | 10 | Chinese maintainer: Fu Wei <wefu@redhat.com> |
Tekkaman Ninja | bf34be0 | 2012-10-25 00:02:53 +0800 | [diff] [blame] | 11 | --------------------------------------------------------------------- |
| 12 | Documentation/arm64/memory.txt 的中文翻译 |
| 13 | |
| 14 | 如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文 |
| 15 | 交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻 |
| 16 | 译存在问题,请联系中文版维护者。 |
| 17 | |
| 18 | 英文版维护者: Catalin Marinas <catalin.marinas@arm.com> |
Fu Wei | d0f2a80 | 2014-01-28 20:14:29 +0800 | [diff] [blame] | 19 | 中文版维护者: 傅炜 Fu Wei <wefu@redhat.com> |
| 20 | 中文版翻译者: 傅炜 Fu Wei <wefu@redhat.com> |
| 21 | 中文版校译者: 傅炜 Fu Wei <wefu@redhat.com> |
Tekkaman Ninja | bf34be0 | 2012-10-25 00:02:53 +0800 | [diff] [blame] | 22 | |
| 23 | 以下为正文 |
| 24 | --------------------------------------------------------------------- |
| 25 | Linux 在 AArch64 中的内存布局 |
| 26 | =========================== |
| 27 | |
| 28 | 作者: Catalin Marinas <catalin.marinas@arm.com> |
| 29 | 日期: 2012 年 02 月 20 日 |
| 30 | |
| 31 | 本文档描述 AArch64 Linux 内核所使用的虚拟内存布局。此构架可以实现 |
| 32 | 页大小为 4KB 的 4 级转换表和页大小为 64KB 的 3 级转换表。 |
| 33 | |
| 34 | AArch64 Linux 使用页大小为 4KB 的 3 级转换表配置,对于用户和内核 |
| 35 | 都有 39-bit (512GB) 的虚拟地址空间。对于页大小为 64KB的配置,仅 |
| 36 | 使用 2 级转换表,但内存布局相同。 |
| 37 | |
| 38 | 用户地址空间的 63:39 位为 0,而内核地址空间的相应位为 1。TTBRx 的 |
| 39 | 选择由虚拟地址的 63 位给出。swapper_pg_dir 仅包含内核(全局)映射, |
| 40 | 而用户 pgd 仅包含用户(非全局)映射。swapper_pgd_dir 地址被写入 |
| 41 | TTBR1 中,且从不写入 TTBR0。 |
| 42 | |
| 43 | |
Fu Wei | d0f2a80 | 2014-01-28 20:14:29 +0800 | [diff] [blame] | 44 | AArch64 Linux 在页大小为 4KB 时的内存布局: |
Tekkaman Ninja | bf34be0 | 2012-10-25 00:02:53 +0800 | [diff] [blame] | 45 | |
| 46 | 起始地址 结束地址 大小 用途 |
| 47 | ----------------------------------------------------------------------- |
| 48 | 0000000000000000 0000007fffffffff 512GB 用户空间 |
| 49 | |
Fu Wei | a550e56 | 2012-11-18 18:02:21 +0800 | [diff] [blame] | 50 | ffffff8000000000 ffffffbbfffeffff ~240GB vmalloc |
Tekkaman Ninja | bf34be0 | 2012-10-25 00:02:53 +0800 | [diff] [blame] | 51 | |
Fu Wei | a550e56 | 2012-11-18 18:02:21 +0800 | [diff] [blame] | 52 | ffffffbbffff0000 ffffffbbffffffff 64KB [防护页] |
Tekkaman Ninja | bf34be0 | 2012-10-25 00:02:53 +0800 | [diff] [blame] | 53 | |
| 54 | ffffffbc00000000 ffffffbdffffffff 8GB vmemmap |
| 55 | |
Fu Wei | a550e56 | 2012-11-18 18:02:21 +0800 | [diff] [blame] | 56 | ffffffbe00000000 ffffffbffbbfffff ~8GB [防护页,未来用于 vmmemap] |
| 57 | |
Fu Wei | d0f2a80 | 2014-01-28 20:14:29 +0800 | [diff] [blame] | 58 | ffffffbffbc00000 ffffffbffbdfffff 2MB earlyprintk 设备 |
| 59 | |
Fu Wei | a550e56 | 2012-11-18 18:02:21 +0800 | [diff] [blame] | 60 | ffffffbffbe00000 ffffffbffbe0ffff 64KB PCI I/O 空间 |
| 61 | |
Fu Wei | d0f2a80 | 2014-01-28 20:14:29 +0800 | [diff] [blame] | 62 | ffffffbffbe10000 ffffffbcffffffff ~2MB [防护页] |
Tekkaman Ninja | bf34be0 | 2012-10-25 00:02:53 +0800 | [diff] [blame] | 63 | |
| 64 | ffffffbffc000000 ffffffbfffffffff 64MB 模块 |
| 65 | |
Tekkaman Ninja | bb3215e | 2012-10-28 11:17:59 +0800 | [diff] [blame] | 66 | ffffffc000000000 ffffffffffffffff 256GB 内核逻辑内存映射 |
Tekkaman Ninja | bf34be0 | 2012-10-25 00:02:53 +0800 | [diff] [blame] | 67 | |
| 68 | |
Fu Wei | d0f2a80 | 2014-01-28 20:14:29 +0800 | [diff] [blame] | 69 | AArch64 Linux 在页大小为 64KB 时的内存布局: |
| 70 | |
| 71 | 起始地址 结束地址 大小 用途 |
| 72 | ----------------------------------------------------------------------- |
| 73 | 0000000000000000 000003ffffffffff 4TB 用户空间 |
| 74 | |
| 75 | fffffc0000000000 fffffdfbfffeffff ~2TB vmalloc |
| 76 | |
| 77 | fffffdfbffff0000 fffffdfbffffffff 64KB [防护页] |
| 78 | |
| 79 | fffffdfc00000000 fffffdfdffffffff 8GB vmemmap |
| 80 | |
| 81 | fffffdfe00000000 fffffdfffbbfffff ~8GB [防护页,未来用于 vmmemap] |
| 82 | |
| 83 | fffffdfffbc00000 fffffdfffbdfffff 2MB earlyprintk 设备 |
| 84 | |
| 85 | fffffdfffbe00000 fffffdfffbe0ffff 64KB PCI I/O 空间 |
| 86 | |
| 87 | fffffdfffbe10000 fffffdfffbffffff ~2MB [防护页] |
| 88 | |
| 89 | fffffdfffc000000 fffffdffffffffff 64MB 模块 |
| 90 | |
| 91 | fffffe0000000000 ffffffffffffffff 2TB 内核逻辑内存映射 |
| 92 | |
| 93 | |
Tekkaman Ninja | bf34be0 | 2012-10-25 00:02:53 +0800 | [diff] [blame] | 94 | 4KB 页大小的转换表查找: |
| 95 | |
| 96 | +--------+--------+--------+--------+--------+--------+--------+--------+ |
| 97 | |63 56|55 48|47 40|39 32|31 24|23 16|15 8|7 0| |
| 98 | +--------+--------+--------+--------+--------+--------+--------+--------+ |
| 99 | | | | | | | |
| 100 | | | | | | v |
| 101 | | | | | | [11:0] 页内偏移 |
| 102 | | | | | +-> [20:12] L3 索引 |
| 103 | | | | +-----------> [29:21] L2 索引 |
| 104 | | | +---------------------> [38:30] L1 索引 |
| 105 | | +-------------------------------> [47:39] L0 索引 (未使用) |
| 106 | +-------------------------------------------------> [63] TTBR0/1 |
| 107 | |
| 108 | |
| 109 | 64KB 页大小的转换表查找: |
| 110 | |
| 111 | +--------+--------+--------+--------+--------+--------+--------+--------+ |
| 112 | |63 56|55 48|47 40|39 32|31 24|23 16|15 8|7 0| |
| 113 | +--------+--------+--------+--------+--------+--------+--------+--------+ |
| 114 | | | | | | |
| 115 | | | | | v |
| 116 | | | | | [15:0] 页内偏移 |
| 117 | | | | +----------> [28:16] L3 索引 |
| 118 | | | +--------------------------> [41:29] L2 索引 (仅使用 38:29 ) |
| 119 | | +-------------------------------> [47:42] L1 索引 (未使用) |
| 120 | +-------------------------------------------------> [63] TTBR0/1 |
Fu Wei | d0f2a80 | 2014-01-28 20:14:29 +0800 | [diff] [blame] | 121 | |
| 122 | 当使用 KVM 时, 管理程序(hypervisor)在 EL2 中通过相对内核虚拟地址的 |
| 123 | 一个固定偏移来映射内核页(内核虚拟地址的高 24 位设为零): |
| 124 | |
| 125 | 起始地址 结束地址 大小 用途 |
| 126 | ----------------------------------------------------------------------- |
| 127 | 0000004000000000 0000007fffffffff 256GB 在 HYP 中映射的内核对象 |