summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMete Durlu <meted@linux.ibm.com>2026-08-31 11:57:15 +0200
committerAndrew Morton <akpm@linux-foundation.org>2026-10-06 19:02:59 -0700
commit97c358198e73c4d3feff561ebf813e84cfb1ef5a (patch)
treead469223064ac53fd33a84ed0767d141a90bf1ec /include
parentaabe047f8b8055b66cf55a88c688c6660a3f6aca (diff)
downloadlinux-next-97c358198e73c4d3feff561ebf813e84cfb1ef5a.tar.gz
linux-next-97c358198e73c4d3feff561ebf813e84cfb1ef5a.zip
panic: introduce arch_do_panic
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> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> 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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/panic.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/panic.h b/include/linux/panic.h
index f1dd417e54b2..98dd7dfd27de 100644
--- a/include/linux/panic.h
+++ b/include/linux/panic.h
@@ -110,4 +110,6 @@ extern void add_taint(unsigned flag, enum lockdep_ok);
extern int test_taint(unsigned flag);
extern unsigned long get_taint(void);
+void arch_do_panic(void);
+
#endif /* _LINUX_PANIC_H */