Introduce arch_do_panic
Status from this message: [merged mm-nonmm-stable] sparc-implement-arch_do_panic.patch removed from -mm tree
Get series with b4
b4 am [email protected] change-id 20260724-arch_do_panic-a97f699aa332Versions newest first
- v6 Latest3 patches 2 repliesApplied 3/3
- v53 patches 3 repliesSuperseded
- v43 patches 2 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 3 patches | 4 replies | Superseded | |
| v2 | 3 patches | 11 replies | Superseded | |
| v1 | 3 patches | 1 reply | Superseded |
Changes in v6 from the cover letter
- Collect Reviewed-by's and Acked-by's (Bradley Morgan, Heiko Carstens)
- Rebase to 7.3
Patches in v6 All 3 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | panic: Introduce arch_do_panicinclude/ kernel/ | +5 | 0 replies | Applied |
| 2/3 | s390: Implement arch_do_panicarch/ kernel/ | +7 | 0 replies | Applied |
| 3/3 | sparc: Implement arch_do_panicarch/ kernel/ | +9 | 0 replies | Applied |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Heiko Carstens | Bradley Morgan | Andreas Larsson |
|---|---|---|---|
| Series | T-b A-b | ||
| 1/3 | R-b | ||
| 2/3 | A-b | R-b | |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v6 0/3] Introduce arch_do_panic
Changes in v6:
- Collect Reviewed-by's and Acked-by's (Bradley Morgan, Heiko Carstens)
- Rebase to 7.3
Changes in v5:
- Move s390 arch_do_panic() implementation to a more suitable file (Heiko Carstens)
Changes in v4:
- Remove s390 specific behavior changes and limit the series with cosmetic clean ups and introduction of arch_do_panic() (Heiko Carstens)
- Include linux/panic.h on files where arch_do_panic() is implemented (Sashiko)
- Remove extern "stop_a_enabled" definition from sparc's arch_do_panic() implementation as it is already visible by included asm/setup.h (Sashiko)
- Include "linux/printk.h" header on sparc/setup.c explicitly for pr_emerg() (Sashiko)
Changes in v3:
- Use __weak functions instead of symbol override via ifdef
- Patch 2: Better explain what is fixed (Bradley Morgan)
- Add statements about print order changes (Bradley Morgan)
- Patch 2: Add a pr_warn() to notify user about on_panic and panic_timeout relationship if they try to assign a trigger to on_panic action while panic_timeout is set to a value other than 0 (Bradley Morgan)
A note before coverletter:
On earlier versions [1] I attempted to move s390s panic handler into arch_do_panic() but the interaction between panic handler and kernel's panic_timeout had become implicit and suboptimal. After reading Heiko's comments I have decided to tackle that in a separate series and keep this one limited to a smaller set of changes.
-------
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.
[1] https://lore.kernel.org/all/[email protected]/
---
Mete Durlu (3):
panic: Introduce arch_do_panic
s390: Implement arch_do_panic
sparc: Implement arch_do_panic
arch/s390/kernel/traps.c | 7 +++++++ arch/sparc/kernel/setup.c | 9 +++++++++ include/linux/panic.h | 2 ++ kernel/panic.c | 15 +++------------ 4 files changed, 21 insertions(+), 12 deletions(-)
---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260724-arch_do_panic-a97f699aa332
Best regards,
Signature · 1 line
Mete Durlu <[email protected]>