linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [V4 PATCH 0/2] kexec: crash_kexec_post_notifiers boot option related fixes
@ 2016-08-10  8:09 Hidehiro Kawai
  2016-08-10  8:09 ` [V4 PATCH 1/2] x86/panic: Replace smp_send_stop() with kdump friendly version in panic path Hidehiro Kawai
  2016-08-10  8:09 ` [V4 PATCH 2/2] mips/panic: " Hidehiro Kawai
  0 siblings, 2 replies; 17+ messages in thread
From: Hidehiro Kawai @ 2016-08-10  8:09 UTC (permalink / raw)
  To: Andrew Morton, Dave Young, Eric W. Biederman, Baoquan He, Ralf Baechle
  Cc: linux-mips, Xunlei Pang, x86, kexec, linux-kernel,
	HATAYAMA Daisuke, Masami Hiramatsu, xen-devel, Daniel Walker,
	Vivek Goyal

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(-)


-- 
Hidehiro Kawai
Hitachi, Ltd. Research & Development Group

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-09-22  1:54 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-10  8:09 [V4 PATCH 0/2] kexec: crash_kexec_post_notifiers boot option related fixes Hidehiro Kawai
2016-08-10  8:09 ` [V4 PATCH 1/2] x86/panic: Replace smp_send_stop() with kdump friendly version in panic path Hidehiro Kawai
2016-08-12  3:16   ` Dave Young
2016-08-15 11:22     ` 河合英宏 / KAWAI,HIDEHIRO
2016-09-20  7:40       ` Xunlei Pang
2016-09-20  8:53         ` 河合英宏 / KAWAI,HIDEHIRO
2016-09-20 11:22           ` 河合英宏 / KAWAI,HIDEHIRO
2016-09-22  1:53             ` 'Dave Young'
2016-08-10  8:09 ` [V4 PATCH 2/2] mips/panic: " Hidehiro Kawai
2016-08-12  3:17   ` Dave Young
2016-08-12 13:55     ` Corey Minyard
2016-08-15 11:35       ` 河合英宏 / KAWAI,HIDEHIRO
2016-08-15 17:06         ` Corey Minyard
2016-08-15 18:01           ` Corey Minyard
2016-08-16 10:29             ` 河合英宏 / KAWAI,HIDEHIRO
2016-08-18 21:18   ` Corey Minyard
2016-09-20 11:37     ` 河合英宏 / KAWAI,HIDEHIRO

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).