* + panic-introduce-arch_do_panic.patch added to mm-nonmm-unstable branch
@ 2026-09-01 0:19 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-09-01 0:19 UTC (permalink / raw)
To: mm-commits, svens, pmladek, include, hca, gor, davem, borntraeger,
andreas, akpm, agordeev, meted, akpm
The patch titled
Subject: panic: introduce arch_do_panic
has been added to the -mm mm-nonmm-unstable branch. Its filename is
panic-introduce-arch_do_panic.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/panic-introduce-arch_do_panic.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Mete Durlu <meted@linux.ibm.com>
Subject: panic: introduce arch_do_panic
Date: Mon, 31 Aug 2026 11:57:15 +0200
Patch series "Introduce arch_do_panic", v6.
Replace architecture-specific ifdef sections in vpanic() with a clean
arch_do_panic() hook. Currently s390 and sparc embed their panic handlers
directly in vpanic() using preprocessor conditionals, making the common
code path harder to maintain.
Introduce arch_do_panic() as an architecture extension point called at the
end of vpanic(). Architectures can use this hook to implement their
specific panic handling without polluting the generic panic code.
Remove s390s ifdef block in vpanic() and move the corresponding code block
to s390s own arch_do_panic() implementation in architecture specific code.
Move sparc panic handling from ifdef blocks to arch_do_panic(). Remove
the preprocessor conditionals from vpanic() and place the Stop-A
enablement code in architecture-specific files where it belongs. Stop-A
enablement markers are now printed after "end Kernel panic" line. To me,
there are no better alternatives other than setup.c to put sparc's
arch_do_panic() implementation. The other files under arch/sparc/kernel
are either divided to *_32.c and *_64.c variants, which mean code
duplication, or unrelated.
The cleanup reduces vpanic() complexity and establishes a pattern for
other architectures needing custom panic behavior. No functional changes,
only minor print order changes.
This patch (of 3):
Introduce a hook for architectures to put their specific panic handlers.
s390 and sparc already have ifdef preprocessor checks to execute
architecture specific code. Pave the way for vpanic() cleanup.
Link: https://lore.kernel.org/20260831-arch_do_panic-v6-1-a1e170a9e7fd@linux.ibm.com
Link: https://lore.kernel.org/all/20260730-arch_do_panic-v3-0-d5401e683cdb@linux.ibm.com/ [1]
Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Reviewed-by: Bradley Morgan <include@grrlz.net>
Suggested-by: Sven Schnelle <svens@linux.ibm.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/panic.h | 2 ++
kernel/panic.c | 3 +++
2 files changed, 5 insertions(+)
--- a/include/linux/panic.h~panic-introduce-arch_do_panic
+++ a/include/linux/panic.h
@@ -110,4 +110,6 @@ extern void add_taint(unsigned flag, enu
extern int test_taint(unsigned flag);
extern unsigned long get_taint(void);
+void arch_do_panic(void);
+
#endif /* _LINUX_PANIC_H */
--- a/kernel/panic.c~panic-introduce-arch_do_panic
+++ a/kernel/panic.c
@@ -567,6 +567,8 @@ static void panic_other_cpus_shutdown(bo
crash_smp_send_stop();
}
+void __weak arch_do_panic(void) {}
+
/**
* vpanic - halt the system
* @fmt: The text string to print
@@ -756,6 +758,7 @@ void vpanic(const char *fmt, va_list arg
#endif
pr_emerg("---[ end Kernel panic - not syncing: %s ]---\n", buf);
+ arch_do_panic();
/* Do not scroll important messages printed above */
suppress_printk = 1;
_
Patches currently in -mm which might be from meted@linux.ibm.com are
panic-introduce-arch_do_panic.patch
s390-implement-arch_do_panic.patch
sparc-implement-arch_do_panic.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-01 0:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01 0:19 + panic-introduce-arch_do_panic.patch added to mm-nonmm-unstable branch Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox