brintos

brintos / linux-shallow public Read only

0
0
Text · 5.3 KiB · c6962e9 Raw
115 lines · plain
1Chinese translated version of Documentation/arch/arm64/memory.rst2 3If you have any comment or update to the content, please contact the4original document maintainer directly.  However, if you have a problem5communicating in English you can also ask the Chinese maintainer for6help.  Contact the Chinese maintainer if this translation is outdated7or if there is a problem with the translation.8 9Maintainer: Catalin Marinas <catalin.marinas@arm.com>10Chinese maintainer: Fu Wei <wefu@redhat.com>11---------------------------------------------------------------------12Documentation/arch/arm64/memory.rst 的中文翻译13 14如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文15交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻16译存在问题,请联系中文版维护者。17 18本文翻译提交时的 Git 检出点为: bc465aa9d045feb0e13b4a8f32cc33c1943f62d619 20英文版维护者: Catalin Marinas <catalin.marinas@arm.com>21中文版维护者: 傅炜  Fu Wei <wefu@redhat.com>22中文版翻译者: 傅炜  Fu Wei <wefu@redhat.com>23中文版校译者: 傅炜  Fu Wei <wefu@redhat.com>24 25以下为正文26---------------------------------------------------------------------27		     Linux 在 AArch64 中的内存布局28		     ===========================29 30作者: Catalin Marinas <catalin.marinas@arm.com>31 32本文档描述 AArch64 Linux 内核所使用的虚拟内存布局。此构架可以实现33页大小为 4KB 的 4 级转换表和页大小为 64KB 的 3 级转换表。34 35AArch64 Linux 使用 3 级或 4 级转换表,其页大小配置为 4KB,对于用户和内核36分别都有 39-bit (512GB) 或 48-bit (256TB) 的虚拟地址空间。37对于页大小为 64KB的配置,仅使用 2 级转换表,有 42-bit (4TB) 的虚拟地址空间,但内存布局相同。38 39用户地址空间的 63:48 位为 0,而内核地址空间的相应位为 1。TTBRx 的40选择由虚拟地址的 63 位给出。swapper_pg_dir 仅包含内核(全局)映射,41而用户 pgd 仅包含用户(非全局)映射。swapper_pg_dir 地址被写入42TTBR1 中,且从不写入 TTBR0。43 44 45AArch64 Linux 在页大小为 4KB,并使用 3 级转换表时的内存布局:46 47起始地址			结束地址			大小		用途48-----------------------------------------------------------------------490000000000000000	0000007fffffffff	 512GB		用户空间50ffffff8000000000	ffffffffffffffff	 512GB		内核空间51 52 53AArch64 Linux 在页大小为 4KB,并使用 4 级转换表时的内存布局:54 55起始地址			结束地址			大小		用途56-----------------------------------------------------------------------570000000000000000	0000ffffffffffff	 256TB		用户空间58ffff000000000000	ffffffffffffffff	 256TB		内核空间59 60 61AArch64 Linux 在页大小为 64KB,并使用 2 级转换表时的内存布局:62 63起始地址			结束地址			大小		用途64-----------------------------------------------------------------------650000000000000000	000003ffffffffff	   4TB		用户空间66fffffc0000000000	ffffffffffffffff	   4TB		内核空间67 68 69AArch64 Linux 在页大小为 64KB,并使用 3 级转换表时的内存布局:70 71起始地址			结束地址			大小		用途72-----------------------------------------------------------------------730000000000000000	0000ffffffffffff	 256TB		用户空间74ffff000000000000	ffffffffffffffff	 256TB		内核空间75 76 77更详细的内核虚拟内存布局,请参阅内核启动信息。78 79 804KB 页大小的转换表查找:81 82+--------+--------+--------+--------+--------+--------+--------+--------+83|63    56|55    48|47    40|39    32|31    24|23    16|15     8|7      0|84+--------+--------+--------+--------+--------+--------+--------+--------+85 |                 |         |         |         |         |86 |                 |         |         |         |         v87 |                 |         |         |         |   [11:0]  页内偏移88 |                 |         |         |         +-> [20:12] L3 索引89 |                 |         |         +-----------> [29:21] L2 索引90 |                 |         +---------------------> [38:30] L1 索引91 |                 +-------------------------------> [47:39] L0 索引92 +-------------------------------------------------> [63] TTBR0/193 94 9564KB 页大小的转换表查找:96 97+--------+--------+--------+--------+--------+--------+--------+--------+98|63    56|55    48|47    40|39    32|31    24|23    16|15     8|7      0|99+--------+--------+--------+--------+--------+--------+--------+--------+100 |                 |    |               |              |101 |                 |    |               |              v102 |                 |    |               |            [15:0]  页内偏移103 |                 |    |               +----------> [28:16] L3 索引104 |                 |    +--------------------------> [41:29] L2 索引105 |                 +-------------------------------> [47:42] L1 索引106 +-------------------------------------------------> [63] TTBR0/1107 108 109当使用 KVM 时, 管理程序(hypervisor)在 EL2 中通过相对内核虚拟地址的110一个固定偏移来映射内核页(内核虚拟地址的高 24 位设为零):111 112起始地址			结束地址			大小		用途113-----------------------------------------------------------------------1140000004000000000	0000007fffffffff	 256GB		在 HYP 中映射的内核对象115