[PATCH v5 2/3] s390: Implement arch_do_panic()

From: Mete Durlu

Date: Mon Aug 10 2026 - 07:38:45 EST


Implement s390 specific arch_do_panic() instead of using s390 specific
ifdef sections in vpanic() code. disabled_wait() is now called after
"end Kernel panic" marker.
No functional changes.

Signed-off-by: Mete Durlu <meted@xxxxxxxxxxxxx>
---
arch/s390/kernel/traps.c | 7 +++++++
kernel/panic.c | 3 ---
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 564403496a7c..309d3d3e95fd 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -24,6 +24,7 @@
#include <linux/entry-common.h>
#include <linux/kmsan.h>
#include <linux/bug.h>
+#include <linux/panic.h>
#include <asm/entry-percpu.h>
#include <asm/asm-extable.h>
#include <asm/irqflags.h>
@@ -31,6 +32,7 @@
#include <asm/vtime.h>
#include <asm/fpu.h>
#include <asm/fault.h>
+#include <asm/processor.h>
#include "entry.h"

static inline void __user *get_trap_ip(struct pt_regs *regs)
@@ -275,6 +277,11 @@ static void monitor_event_exception(struct pt_regs *regs)
}
}

+void arch_do_panic(void)
+{
+ disabled_wait();
+}
+
void kernel_stack_invalid(struct pt_regs *regs)
{
/*
diff --git a/kernel/panic.c b/kernel/panic.c
index 726a97842232..ee6e3f9e3900 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -752,9 +752,6 @@ void vpanic(const char *fmt, va_list args)
pr_emerg("Press Stop-A (L1-A) from sun keyboard or send break\n"
"twice on console to return to the boot prom\n");
}
-#endif
-#if defined(CONFIG_S390)
- disabled_wait();
#endif
pr_emerg("---[ end Kernel panic - not syncing: %s ]---\n", buf);


--
2.55.0