cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

vm-layout.rst (3629B)


      1.. SPDX-License-Identifier: GPL-2.0
      2.. include:: ../disclaimer-zh_CN.rst
      3
      4:Original: Documentation/riscv/vm-layout.rst
      5
      6:翻译:
      7
      8 司延腾 Yanteng Si <siyanteng@loongson.cn>
      9
     10============================
     11RISC-V Linux上的虚拟内存布局
     12============================
     13
     14:作者: Alexandre Ghiti <alex@ghiti.fr>
     15:日期: 12 February 2021
     16
     17这份文件描述了RISC-V Linux内核使用的虚拟内存布局。
     18
     1932位 RISC-V Linux 内核
     20======================
     21
     22RISC-V Linux Kernel SV32
     23------------------------
     24
     25TODO
     26
     2764位 RISC-V Linux 内核
     28======================
     29
     30RISC-V特权架构文档指出,64位地址 "必须使第63-48位值都等于第47位,否则将发生缺页异常。":这将虚
     31拟地址空间分成两半,中间有一个非常大的洞,下半部分是用户空间所在的地方,上半部分是RISC-V Linux
     32内核所在的地方。
     33
     34RISC-V Linux Kernel SV39
     35------------------------
     36
     37::
     38
     39  ========================================================================================================================
     40      开始地址       |   偏移      |     结束地址      |  大小    | 虚拟内存区域描述
     41  ========================================================================================================================
     42                    |            |                  |         |
     43   0000000000000000 |    0       | 0000003fffffffff |  256 GB | 用户空间虚拟内存,每个内存管理器不同
     44  __________________|____________|__________________|_________|___________________________________________________________
     45                    |            |                  |         |
     46   0000004000000000 | +256    GB | ffffffbfffffffff | ~16M TB | ... 巨大的、几乎64位宽的直到内核映射的-256GB地方
     47                    |            |                  |         |     开始偏移的非经典虚拟内存地址空洞。
     48                    |            |                  |         |
     49  __________________|____________|__________________|_________|___________________________________________________________
     50                                                              |
     51                                                              | 内核空间的虚拟内存,在所有进程之间共享:
     52  ____________________________________________________________|___________________________________________________________
     53                    |            |                  |         |
     54   ffffffc6fee00000 | -228    GB | ffffffc6feffffff |    2 MB | fixmap
     55   ffffffc6ff000000 | -228    GB | ffffffc6ffffffff |   16 MB | PCI io
     56   ffffffc700000000 | -228    GB | ffffffc7ffffffff |    4 GB | vmemmap
     57   ffffffc800000000 | -224    GB | ffffffd7ffffffff |   64 GB | vmalloc/ioremap space
     58   ffffffd800000000 | -160    GB | fffffff6ffffffff |  124 GB | 直接映射所有物理内存
     59   fffffff700000000 |  -36    GB | fffffffeffffffff |   32 GB | kasan
     60  __________________|____________|__________________|_________|____________________________________________________________
     61                                                              |
     62                                                              |
     63  ____________________________________________________________|____________________________________________________________
     64                    |            |                  |         |
     65   ffffffff00000000 |   -4    GB | ffffffff7fffffff |    2 GB | modules, BPF
     66   ffffffff80000000 |   -2    GB | ffffffffffffffff |    2 GB | kernel
     67  __________________|____________|__________________|_________|____________________________________________________________