]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
s390/traps: Handle early warnings gracefully
authorHeiko Carstens <hca@linux.ibm.com>
Wed, 31 Jul 2024 13:26:01 +0000 (15:26 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 7 Aug 2024 18:52:53 +0000 (20:52 +0200)
Add missing warning handling to the early program check handler. This
way a warning is printed to the console as soon as the early console
is setup, and the kernel continues to boot.

Before this change a disabled wait psw was loaded instead and the
machine was silently stopped without giving an idea about what
happened.

Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/early.c

index ee051ad81c7119a345c9d5f44b249c6e82e8f642..0242fa78c918967d7e76ab489c5ea0db4f9b63cd 100644 (file)
@@ -177,8 +177,21 @@ static __init void setup_topology(void)
 
 void __do_early_pgm_check(struct pt_regs *regs)
 {
-       if (!fixup_exception(regs))
-               disabled_wait();
+       struct lowcore *lc = get_lowcore();
+       unsigned long ip;
+
+       regs->int_code = lc->pgm_int_code;
+       regs->int_parm_long = lc->trans_exc_code;
+       ip = __rewind_psw(regs->psw, regs->int_code >> 16);
+
+       /* Monitor Event? Might be a warning */
+       if ((regs->int_code & PGM_INT_CODE_MASK) == 0x40) {
+               if (report_bug(ip, regs) == BUG_TRAP_TYPE_WARN)
+                       return;
+       }
+       if (fixup_exception(regs))
+               return;
+       disabled_wait();
 }
 
 static noinline __init void setup_lowcore_early(void)