aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHidehiro Kawai <hidehiro.kawai.ez@hitachi.com>2016-08-02 17:06:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-02 19:35:29 -0400
commitb26e27ddfd2a986dc53e259aba572f3aac182eb8 (patch)
treea967e100504f55323079ceaa8cfdd451f91c0d14
parent0719392a61a9dbc2c850bc7bd1a17efba953fcf5 (diff)
kexec: use core_param for crash_kexec_post_notifiers boot option
crash_kexec_post_notifiers ia a boot option which controls whether the 1st kernel calls panic notifiers or not before booting the 2nd kernel. However, there is no need to limit it to being modifiable only at boot time. So, use core_param instead of early_param. Link: http://lkml.kernel.org/r/20160705113327.5864.43139.stgit@softrs Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com> Cc: Dave Young <dyoung@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Eric Biederman <ebiederm@xmission.com> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/panic.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/kernel/panic.c b/kernel/panic.c
index 8aa74497cc5a..ca8cea1ef673 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -108,6 +108,7 @@ void panic(const char *fmt, ...)
108 long i, i_next = 0; 108 long i, i_next = 0;
109 int state = 0; 109 int state = 0;
110 int old_cpu, this_cpu; 110 int old_cpu, this_cpu;
111 bool _crash_kexec_post_notifiers = crash_kexec_post_notifiers;
111 112
112 /* 113 /*
113 * Disable local interrupts. This will prevent panic_smp_self_stop 114 * Disable local interrupts. This will prevent panic_smp_self_stop
@@ -160,7 +161,7 @@ void panic(const char *fmt, ...)
160 * 161 *
161 * Bypass the panic_cpu check and call __crash_kexec directly. 162 * Bypass the panic_cpu check and call __crash_kexec directly.
162 */ 163 */
163 if (!crash_kexec_post_notifiers) { 164 if (!_crash_kexec_post_notifiers) {
164 printk_nmi_flush_on_panic(); 165 printk_nmi_flush_on_panic();
165 __crash_kexec(NULL); 166 __crash_kexec(NULL);
166 } 167 }
@@ -191,7 +192,7 @@ void panic(const char *fmt, ...)
191 * 192 *
192 * Bypass the panic_cpu check and call __crash_kexec directly. 193 * Bypass the panic_cpu check and call __crash_kexec directly.
193 */ 194 */
194 if (crash_kexec_post_notifiers) 195 if (_crash_kexec_post_notifiers)
195 __crash_kexec(NULL); 196 __crash_kexec(NULL);
196 197
197 bust_spinlocks(0); 198 bust_spinlocks(0);
@@ -571,13 +572,7 @@ EXPORT_SYMBOL(__stack_chk_fail);
571core_param(panic, panic_timeout, int, 0644); 572core_param(panic, panic_timeout, int, 0644);
572core_param(pause_on_oops, pause_on_oops, int, 0644); 573core_param(pause_on_oops, pause_on_oops, int, 0644);
573core_param(panic_on_warn, panic_on_warn, int, 0644); 574core_param(panic_on_warn, panic_on_warn, int, 0644);
574 575core_param(crash_kexec_post_notifiers, crash_kexec_post_notifiers, bool, 0644);
575static int __init setup_crash_kexec_post_notifiers(char *s)
576{
577 crash_kexec_post_notifiers = true;
578 return 0;
579}
580early_param("crash_kexec_post_notifiers", setup_crash_kexec_post_notifiers);
581 576
582static int __init oops_setup(char *s) 577static int __init oops_setup(char *s)
583{ 578{