[PATCH 02/32] s390/early: Fix early warning handling
From: Heiko Carstens
Date: Thu Oct 01 2026 - 06:34:20 EST
When adding support for __WARN_printf() the early program check handler was
not taken into account. Add the missing support to the early program check
handler. This avoids that the kernel crashes instead of printing a warning.
Fixes: 04dabb4261c3 ("s390/bug: Implement __WARN_printf()")
Fixes: 79996065cfa2 ("s390/bug: Skip __WARN_trap() in call traces")
Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
---
arch/s390/kernel/early.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index b27239c03d79..1fc153d8385b 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -153,16 +153,25 @@ static __init void setup_topology(void)
void __init __do_early_pgm_check(struct pt_regs *regs)
{
struct lowcore *lc = get_lowcore();
- unsigned long ip;
regs->int_code = lc->pgm_int_code;
regs->int_parm_long = lc->trans_exc_code;
regs->last_break = lc->pgm_last_break;
- ip = __rewind_psw(regs->psw, regs->int_code >> 16);
+ regs->monitor_code = lc->monitor_code;
/* Monitor Event? Might be a warning */
if ((regs->int_code & PGM_INT_CODE_MASK) == 0x40) {
- if (report_bug(ip, regs) == BUG_TRAP_TYPE_WARN)
+ enum bug_trap_type btt;
+ unsigned long ip;
+
+ if (regs->monitor_code == MONCODE_BUG_ARG) {
+ regs->psw.addr = regs->gprs[14];
+ btt = report_bug_entry((struct bug_entry *)regs->gprs[2], regs);
+ } else {
+ ip = __rewind_psw(regs->psw, regs->int_code >> 16);
+ btt = report_bug(ip, regs);
+ }
+ if (btt == BUG_TRAP_TYPE_WARN)
return;
}
if (fixup_exception(regs))
--
2.53.0