diff options
Diffstat (limited to 'kernel/kexec.c')
-rw-r--r-- | kernel/kexec.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c index a0411b3bd54a..277f22afe74b 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -18,6 +18,8 @@ | |||
18 | #include <linux/reboot.h> | 18 | #include <linux/reboot.h> |
19 | #include <linux/syscalls.h> | 19 | #include <linux/syscalls.h> |
20 | #include <linux/ioport.h> | 20 | #include <linux/ioport.h> |
21 | #include <linux/hardirq.h> | ||
22 | |||
21 | #include <asm/page.h> | 23 | #include <asm/page.h> |
22 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
23 | #include <asm/io.h> | 25 | #include <asm/io.h> |
@@ -32,6 +34,13 @@ struct resource crashk_res = { | |||
32 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM | 34 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM |
33 | }; | 35 | }; |
34 | 36 | ||
37 | int kexec_should_crash(struct task_struct *p) | ||
38 | { | ||
39 | if (in_interrupt() || !p->pid || p->pid == 1 || panic_on_oops) | ||
40 | return 1; | ||
41 | return 0; | ||
42 | } | ||
43 | |||
35 | /* | 44 | /* |
36 | * When kexec transitions to the new kernel there is a one-to-one | 45 | * When kexec transitions to the new kernel there is a one-to-one |
37 | * mapping between physical and virtual addresses. On processors | 46 | * mapping between physical and virtual addresses. On processors |
@@ -1010,7 +1019,7 @@ asmlinkage long compat_sys_kexec_load(unsigned long entry, | |||
1010 | } | 1019 | } |
1011 | #endif | 1020 | #endif |
1012 | 1021 | ||
1013 | void crash_kexec(void) | 1022 | void crash_kexec(struct pt_regs *regs) |
1014 | { | 1023 | { |
1015 | struct kimage *image; | 1024 | struct kimage *image; |
1016 | int locked; | 1025 | int locked; |
@@ -1028,7 +1037,7 @@ void crash_kexec(void) | |||
1028 | if (!locked) { | 1037 | if (!locked) { |
1029 | image = xchg(&kexec_crash_image, NULL); | 1038 | image = xchg(&kexec_crash_image, NULL); |
1030 | if (image) { | 1039 | if (image) { |
1031 | machine_crash_shutdown(); | 1040 | machine_crash_shutdown(regs); |
1032 | machine_kexec(image); | 1041 | machine_kexec(image); |
1033 | } | 1042 | } |
1034 | xchg(&kexec_lock, 0); | 1043 | xchg(&kexec_lock, 0); |