Documentation / arch / s390 / mm.rst


Based on kernel version 6.11. Page generated on 2024-09-24 08:21 EST.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
.. SPDX-License-Identifier: GPL-2.0

=================
Memory Management
=================

Virtual memory layout
=====================

.. note::

 - Some aspects of the virtual memory layout setup are not
   clarified (number of page levels, alignment, DMA memory).

 - Unused gaps in the virtual memory layout could be present
   or not - depending on how partucular system is configured.
   No page tables are created for the unused gaps.

 - The virtual memory regions are tracked or untracked by KASAN
   instrumentation, as well as the KASAN shadow memory itself is
   created only when CONFIG_KASAN configuration option is enabled.

::

  =============================================================================
  |    Physical      |	  Virtual	| VM area description
  =============================================================================
  +- 0 --------------+- 0 --------------+
  |		     | S390_lowcore	| Low-address memory
  |		     +- 8 KB -----------+
  |		     |			|
  |		     |			|
  |		     | ... unused gap	| KASAN untracked
  |		     |			|
  +- AMODE31_START --+- AMODE31_START --+ .amode31 rand. phys/virt start
  |.amode31 text/data|.amode31 text/data| KASAN untracked
  +- AMODE31_END ----+- AMODE31_END ----+ .amode31 rand. phys/virt end (<2GB)
  |		     |			|
  |		     |			|
  +- __kaslr_offset_phys		| kernel rand. phys start
  |		     |			|
  | kernel text/data |			|
  |		     |			|
  +------------------+			| kernel phys end
  |		     |			|
  |		     |			|
  |		     |			|
  |		     |			|
  +- ident_map_size -+			|
		     |			|
		     |	... unused gap	| KASAN untracked
		     |			|
		     +- __identity_base + identity mapping start (>= 2GB)
		     |			|
		     | identity		| phys == virt - __identity_base
		     | mapping		| virt == phys + __identity_base
		     |			|
		     |			| KASAN tracked
		     |			|
		     |			|
		     |			|
		     |			|
		     |			|
		     |			|
		     |			|
		     |			|
		     |			|
		     |			|
		     |			|
		     |			|
		     |			|
		     |			|
		     |			|
		     +---- vmemmap -----+ 'struct page' array start
		     |			|
		     | virtually mapped |
		     | memory map	| KASAN untracked
		     |			|
		     +- __abs_lowcore --+
		     |			|
		     | Absolute Lowcore | KASAN untracked
		     |			|
		     +- __memcpy_real_area
		     |			|
		     |	Real Memory Copy| KASAN untracked
		     |			|
		     +- VMALLOC_START --+ vmalloc area start
		     |			| KASAN untracked or
		     |	vmalloc area	| KASAN shallowly populated in case
		     |			|	CONFIG_KASAN_VMALLOC=y
		     +- MODULES_VADDR --+ modules area start
		     |			| KASAN allocated per module or
		     |	modules area	| KASAN shallowly populated in case
		     |			|	CONFIG_KASAN_VMALLOC=y
		     +- __kaslr_offset -+ kernel rand. virt start
		     |			| KASAN tracked
		     | kernel text/data | phys == (kvirt - __kaslr_offset) +
		     |			|	  __kaslr_offset_phys
		     +- kernel .bss end + kernel rand. virt end
		     |			|
		     |	... unused gap	| KASAN untracked
		     |			|
		     +------------------+ UltraVisor Secure Storage limit
		     |			|
		     |	... unused gap	| KASAN untracked
		     |			|
		     +KASAN_SHADOW_START+ KASAN shadow memory start
		     |			|
		     |	 KASAN shadow	| KASAN untracked
		     |			|
		     +------------------+ ASCE limit