summaryrefslogtreecommitdiff
path: root/arch/s390/boot/startup.c
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2023-03-31 15:03:22 +0200
committerVasily Gorbik <gor@linux.ibm.com>2023-04-13 17:36:25 +0200
commitbb87190c9d46c4285696e071d5972a534bb107cc (patch)
tree0e260e3dbbc87443854a8eadd665db921db8f516 /arch/s390/boot/startup.c
parent11018ef90ce73d9de8ac6e565c00cc8631b46328 (diff)
s390/kaslr: provide kaslr_enabled() function
Just like other architectures provide a kaslr_enabled() function, instead of directly accessing a global variable. Also pass the renamed __kaslr_enabled variable from the decompressor to the kernel, so that kalsr_enabled() is available there too. This will be used by a subsequent patch which randomizes the module base load address. Reviewed-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/boot/startup.c')
-rw-r--r--arch/s390/boot/startup.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c
index bdf305a93987..cc0ca7e0cd6d 100644
--- a/arch/s390/boot/startup.c
+++ b/arch/s390/boot/startup.c
@@ -160,10 +160,10 @@ static void setup_ident_map_size(unsigned long max_physmem_end)
#ifdef CONFIG_CRASH_DUMP
if (oldmem_data.start) {
- kaslr_enabled = 0;
+ __kaslr_enabled = 0;
ident_map_size = min(ident_map_size, oldmem_data.size);
} else if (ipl_block_valid && is_ipl_block_dump()) {
- kaslr_enabled = 0;
+ __kaslr_enabled = 0;
if (!sclp_early_get_hsa_size(&hsa_size) && hsa_size)
ident_map_size = min(ident_map_size, hsa_size);
}
@@ -315,7 +315,7 @@ void startup_kernel(void)
save_ipl_cert_comp_list();
rescue_initrd(safe_addr, ident_map_size);
- if (IS_ENABLED(CONFIG_RANDOMIZE_BASE) && kaslr_enabled) {
+ if (kaslr_enabled()) {
random_lma = get_random_base();
if (random_lma) {
__kaslr_offset = random_lma - vmlinux.default_lma;