s390/startup: add kaslr_offset to pgm check info print
authorVasily Gorbik <gor@linux.ibm.com>
Sun, 11 Aug 2019 18:23:56 +0000 (20:23 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 30 Sep 2020 10:09:54 +0000 (12:09 +0200)
startup pgm check handler is active since the very beginning of kernel
code execution until uncompressed kernel sets up s390_base_pgm_handler.

It is useful not just for the decompressor debugging itself, but also for
early code of uncompressed kernel, in particular Kasan initialization. But
since there is no stack trace or symbolic representation of failing psw
address it is impossible to figure out faulty code location without
knowing Kaslr kernel base. So, let's add it to the startup pgm check
info printed as well.

Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/boot/pgm_check_info.c

index 83b5b79..d3ab20e 100644 (file)
@@ -2,6 +2,7 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <asm/lowcore.h>
+#include <asm/setup.h>
 #include <asm/sclp.h>
 #include "boot.h"
 
@@ -42,6 +43,13 @@ void print_pgm_check_info(void)
        add_str(p, "\n");
        sclp_early_printk(buf);
 
+       if (kaslr_enabled) {
+               p = add_str(buf, "Kernel random base: ");
+               p = add_val_as_hex(p, __kaslr_offset);
+               add_str(p, "\n");
+               sclp_early_printk(buf);
+       }
+
        p = add_str(buf, "PSW : ");
        p = add_val_as_hex(p, S390_lowcore.psw_save_area.mask);
        p = add_str(p, " ");