Skip to content

kexec: crash_kexec_post_notifiers boot option related fixes

Hidehiro Kawai kexec linux-mips lkml xen-devel 5 versions – Applied

Status from this message: [merged] mips-panic-replace-smp_send_stop-with-kdump-friendly-version-in-panic-path.patch removed from -mm tree

Get series with b4
b4 am 20160810080946.11028.97686.stgit@sysi4-13.yrl.intra.hitachi.co.jp

Versions newest first · linked by author and title

  1. v4 Latest posting 2/22 patches 28 repliesApplied 2/4
  2. v4 posting 1/20 of 2 patches 0 repliesSuperseded
  3. v32 patches 13 repliesSuperseded 1 of 2 applied
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 RFC1 patch5 repliesSuperseded
v13 patches20 repliesSuperseded

Changes in v4 from the cover letter

- Keep to use smp_send_stop if crash_kexec_post_notifiers is not set
- Rename panic_smp_send_stop to crash_smp_send_stop
- Don't change the behavior for Xen's PV kernel
- Support MIPS

Patches in v4 posting 2/2 Applied · 2/4

#Subject and filesSizeRepliesApplied
1/2x86/panic: Replace smp_send_stop() with kdump friendly version in panic patharch/x86/include/asm/kexec.h arch/x86/include/asm/smp.h arch/x86/kernel/crash.c +2 more+66 -100 replies
1/2x86/panic: Replace smp_send_stop() with kdump friendly version in panic patharch/x86/include/asm/kexec.h arch/x86/include/asm/smp.h arch/x86/kernel/crash.c +2 more+66 -1012 repliesApplied
2/2mips/panic: Replace smp_send_stop() with kdump friendly version in panic patharch/mips/cavium-octeon/setup.c arch/mips/include/asm/kexec.h arch/mips/kernel/crash.c +1 more+33 -10 replies
2/2mips/panic: Replace smp_send_stop() with kdump friendly version in panic patharch/mips/cavium-octeon/setup.c arch/mips/include/asm/kexec.h arch/mips/kernel/crash.c +1 more+33 -116 repliesApplied

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchCorey MinyardDave Young
1/2A-b A-b
1/2A-b A-b
2/2T-b R-b T-b R-b T-b R-b T-b R-b
2/2T-b R-b T-b R-b T-b R-b T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [V4 PATCH 0/2] kexec: crash_kexec_post_notifiers boot option related fixes

Daniel Walker reported problems which happens when crash_kexec_post_notifiers kernel option is enabled
(https://lkml.org/lkml/2015/6/24/44).

In that case, smp_send_stop() is called before entering kdump routines which assume other CPUs are still online. This causes some issues depending on architectures. For example, for x86, kdump routines fail to save other CPUs' registers and disable virtualization extensions. For MIPS OCTEON, it fails to stop the watchdog timer.

To fix this problem, call a new kdump friendly function, crash_smp_send_stop(), instead of the smp_send_stop() when crash_kexec_post_notifiers is enabled. crash_smp_send_stop() is a weak function, and it just call smp_send_stop(). Architecture codes should override it so that kdump can work appropriately. This patch set supports only x86 and MIPS.

NOTE:
- Right solution would be to place crash_smp_send_stop() before __crash_kexec() invocation in all cases and remove smp_send_stop(), but we can't do that until all architectures implement own crash_smp_send_stop()
- crash_smp_send_stop()-like work is still needed by machine_crash_shutdown() because crash_kexec() can be called without entering panic()

Changes in V4:
- Keep to use smp_send_stop if crash_kexec_post_notifiers is not set
- Rename panic_smp_send_stop to crash_smp_send_stop
- Don't change the behavior for Xen's PV kernel
- Support MIPS

Changes in V3: https://lkml.org/lkml/2016/7/5/221
- Revise comments, description, and symbol names (the logic doesn't change)
- Make crash_kexec_post_notifiers boot option modifiable after boot

Changes in V2: https://lkml.org/lkml/2015/7/23/864
- Replace smp_send_stop() call with crash_kexec version which saves cpu states and does cleanups instead of changing execution flow
- Drop a fix for Problem 1
- Drop other patches because they aren't needed anymore

V1: https://lkml.org/lkml/2015/7/10/316

---

Hidehiro Kawai (2):
x86/panic: Replace smp_send_stop() with kdump friendly version in panic path mips/panic: Replace smp_send_stop() with kdump friendly version in panic path

 arch/mips/cavium-octeon/setup.c  |   14 +++++++++++
 arch/mips/include/asm/kexec.h    |    1 +
 arch/mips/kernel/crash.c         |   18 ++++++++++++++-
 arch/mips/kernel/machine_kexec.c |    1 +
 arch/x86/include/asm/kexec.h     |    1 +
 arch/x86/include/asm/smp.h       |    1 +
 arch/x86/kernel/crash.c          |   22 +++++++++++++++---
 arch/x86/kernel/smp.c            |    5 ++++
 kernel/panic.c                   |   47 ++++++++++++++++++++++++++++++++------
 9 files changed, 99 insertions(+), 11 deletions(-)
Signature · 2 lines
Hidehiro Kawai
Hitachi, Ltd. Research & Development Group