| 1 |
.. SPDX-License-Identifier: GPL-2.0 |
| 2 |
|
| 3 |
================= |
| 4 |
Memory Management |
| 5 |
================= |
| 6 |
|
| 7 |
Virtual memory layout |
| 8 |
===================== |
| 9 |
|
| 10 |
.. note:: |
| 11 |
|
| 12 |
- Some aspects of the virtual memory layout setup are not |
| 13 |
clarified (number of page levels, alignment, DMA memory). |
| 14 |
|
| 15 |
- Unused gaps in the virtual memory layout could be present |
| 16 |
or not - depending on how partucular system is configured. |
| 17 |
No page tables are created for the unused gaps. |
| 18 |
|
| 19 |
- The virtual memory regions are tracked or untracked by KASAN |
| 20 |
instrumentation, as well as the KASAN shadow memory itself is |
| 21 |
created only when CONFIG_KASAN configuration option is enabled. |
| 22 |
|
| 23 |
:: |
| 24 |
|
| 25 |
============================================================================= |
| 26 |
| Physical | Virtual | VM area description |
| 27 |
============================================================================= |
| 28 |
+- 0 --------------+- 0 --------------+ |
| 29 |
| | S390_lowcore | Low-address memory |
| 30 |
| +- 8 KB -----------+ |
| 31 |
| | | |
| 32 |
| | | |
| 33 |
| | ... unused gap | KASAN untracked |
| 34 |
| | | |
| 35 |
+- AMODE31_START --+- AMODE31_START --+ .amode31 rand. phys/virt start |
| 36 |
|.amode31 text/data|.amode31 text/data| KASAN untracked |
| 37 |
+- AMODE31_END ----+- AMODE31_END ----+ .amode31 rand. phys/virt end (<2GB) |
| 38 |
| | | |
| 39 |
| | | |
| 40 |
+- __kaslr_offset_phys | kernel rand. phys start |
| 41 |
| | | |
| 42 |
| kernel text/data | | |
| 43 |
| | | |
| 44 |
+------------------+ | kernel phys end |
| 45 |
| | | |
| 46 |
| | | |
| 47 |
| | | |
| 48 |
| | | |
| 49 |
+- ident_map_size -+ | |
| 50 |
| | |
| 51 |
| ... unused gap | KASAN untracked |
| 52 |
| | |
| 53 |
+- __identity_base + identity mapping start (>= 2GB) |
| 54 |
| | |
| 55 |
| identity | phys == virt - __identity_base |
| 56 |
| mapping | virt == phys + __identity_base |
| 57 |
| | |
| 58 |
| | KASAN tracked |
| 59 |
| | |
| 60 |
| | |
| 61 |
| | |
| 62 |
| | |
| 63 |
| | |
| 64 |
| | |
| 65 |
| | |
| 66 |
| | |
| 67 |
| | |
| 68 |
| | |
| 69 |
| | |
| 70 |
| | |
| 71 |
| | |
| 72 |
| | |
| 73 |
| | |
| 74 |
+---- vmemmap -----+ 'struct page' array start |
| 75 |
| | |
| 76 |
| virtually mapped | |
| 77 |
| memory map | KASAN untracked |
| 78 |
| | |
| 79 |
+- __abs_lowcore --+ |
| 80 |
| | |
| 81 |
| Absolute Lowcore | KASAN untracked |
| 82 |
| | |
| 83 |
+- __memcpy_real_area |
| 84 |
| | |
| 85 |
| Real Memory Copy| KASAN untracked |
| 86 |
| | |
| 87 |
+- VMALLOC_START --+ vmalloc area start |
| 88 |
| | KASAN untracked or |
| 89 |
| vmalloc area | KASAN shallowly populated in case |
| 90 |
| | CONFIG_KASAN_VMALLOC=y |
| 91 |
+- MODULES_VADDR --+ modules area start |
| 92 |
| | KASAN allocated per module or |
| 93 |
| modules area | KASAN shallowly populated in case |
| 94 |
| | CONFIG_KASAN_VMALLOC=y |
| 95 |
+- __kaslr_offset -+ kernel rand. virt start |
| 96 |
| | KASAN tracked |
| 97 |
| kernel text/data | phys == (kvirt - __kaslr_offset) + |
| 98 |
| | __kaslr_offset_phys |
| 99 |
+- kernel .bss end + kernel rand. virt end |
| 100 |
| | |
| 101 |
| ... unused gap | KASAN untracked |
| 102 |
| | |
| 103 |
+------------------+ UltraVisor Secure Storage limit |
| 104 |
| | |
| 105 |
| ... unused gap | KASAN untracked |
| 106 |
| | |
| 107 |
+KASAN_SHADOW_START+ KASAN shadow memory start |
| 108 |
| | |
| 109 |
| KASAN shadow | KASAN untracked |
| 110 |
| | |
| 111 |
+------------------+ ASCE limit |
| 112 |
| | |
| 113 |
| CONFIG_ILLEGAL_POINTER_VALUE causes memory access fault |
| 114 |
| | |
| 115 |
+------------------+ |