mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-29 03:24:53 -04:00
Define CONFIG_ILLEGAL_POINTER_VALUE to the eye-catching non-zero value of 0xdead000000000000, consistent with other architectures. Assert at compile-time that the poison pointers that include/linux/poison.h defines based on this illegal pointer are beyond the largest useful virtual addresses. Also, assert at compile-time that the range of poison pointers per include/linux/poison.h (currently a range of less than 0x10000 addresses) does not overlap with the range used for address handles for s390's non-MIO PCI instructions. This enables s390 to track the DMA mappings by the network stack's page_pool that was introduced with [0]. Other functional changes are not intended. Other archictectures have introduced this for various other reasons with commit5c178472af("riscv: define ILLEGAL_POINTER_VALUE for 64bit") commitf6853eb561("powerpc/64: Define ILLEGAL_POINTER_VALUE for 64-bit") commitbf0c4e0473("arm64: kconfig: Move LIST_POISON to a safe value") commita29815a333("core, x86: make LIST_POISON less deadly") [0] https://lore.kernel.org/all/20250409-page-pool-track-dma-v9-0-6a9ef2e0cba8@redhat.com/ Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Gerd Bayer <gbayer@linux.ibm.com> Acked-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
116 lines
3.4 KiB
ReStructuredText
116 lines
3.4 KiB
ReStructuredText
.. 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
|
|
| |
|
|
| CONFIG_ILLEGAL_POINTER_VALUE causes memory access fault
|
|
| |
|
|
+------------------+
|