summaryrefslogtreecommitdiffstats
path: root/arch/s390/Kconfig
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@linux.ibm.com>2023-09-26 15:58:51 +0200
committerAlexander Gordeev <agordeev@linux.ibm.com>2024-04-17 13:38:02 +0200
commit54f2ecc3188f78723267826f634e0747169f8685 (patch)
tree8359599359b4c4730842f3f1dd5ef33e87cb55fa /arch/s390/Kconfig
parentc98d2ecae08f02bd2dccd24e7e485e9f0211db65 (diff)
downloadlinux-stable-54f2ecc3188f78723267826f634e0747169f8685.tar.gz
linux-stable-54f2ecc3188f78723267826f634e0747169f8685.tar.bz2
linux-stable-54f2ecc3188f78723267826f634e0747169f8685.zip
s390: Map kernel at fixed location when KASLR is disabled
Since kernel virtual and physical address spaces are uncoupled the kernel is mapped at the top of the virtual address space in case KASLR is disabled. That does not pose any issue with regard to the kernel booting and operation, but makes it difficult to use a generated vmlinux with some debugging tools (e.g. gdb), because the exact location of the kernel image in virtual memory is unknown. Make that location known and introduce CONFIG_KERNEL_IMAGE_BASE configuration option. A custom CONFIG_KERNEL_IMAGE_BASE value that would break the virtual memory layout leads to a build error. The kernel image size is defined by KERNEL_IMAGE_SIZE macro and set to 512 MB, by analogy with x86. Suggested-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'arch/s390/Kconfig')
-rw-r--r--arch/s390/Kconfig19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 9515d4bf1683..df6b371ed214 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -614,6 +614,25 @@ config RANDOMIZE_BASE
as a security feature that deters exploit attempts relying on
knowledge of the location of kernel internals.
+config KERNEL_IMAGE_BASE
+ hex "Kernel image base address"
+ range 0x100000 0x1FFFFFE0000000 if !KASAN
+ range 0x100000 0x1BFFFFE0000000 if KASAN
+ default 0x3FFE0000000 if !KASAN
+ default 0x7FFFE0000000 if KASAN
+ help
+ This is the address at which the kernel image is loaded in case
+ Kernel Address Space Layout Randomization (KASLR) is disabled.
+
+ In case the Protected virtualization guest support is enabled the
+ Ultravisor imposes a virtual address limit. If the value of this
+ option leads to the kernel image exceeding the Ultravisor limit,
+ this option is ignored and the image is loaded below the limit.
+
+ If the value of this option leads to the kernel image overlapping
+ the virtual memory where other data structures are located, this
+ option is ignored and the image is loaded above the structures.
+
endmenu
menu "Memory setup"