mm.rst 3.4 KB

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