diff options
| -rw-r--r-- | arch/x86/kernel/crash.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index 75c468cc7e59..f23c2beeb37d 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c | |||
| @@ -29,10 +29,13 @@ | |||
| 29 | 29 | ||
| 30 | #include <mach_ipi.h> | 30 | #include <mach_ipi.h> |
| 31 | 31 | ||
| 32 | typedef void (*nmi_shootdown_cb)(int, struct die_args*); | ||
| 33 | |||
| 32 | #if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC) | 34 | #if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC) |
| 33 | 35 | ||
| 34 | /* This keeps a track of which one is crashing cpu. */ | 36 | /* This keeps a track of which one is crashing cpu. */ |
| 35 | static int crashing_cpu; | 37 | static int crashing_cpu; |
| 38 | static nmi_shootdown_cb shootdown_callback; | ||
| 36 | 39 | ||
| 37 | static atomic_t waiting_for_crash_ipi; | 40 | static atomic_t waiting_for_crash_ipi; |
| 38 | 41 | ||
| @@ -74,7 +77,7 @@ static int crash_nmi_callback(struct notifier_block *self, | |||
| 74 | return NOTIFY_STOP; | 77 | return NOTIFY_STOP; |
| 75 | local_irq_disable(); | 78 | local_irq_disable(); |
| 76 | 79 | ||
| 77 | kdump_nmi_callback(cpu, (struct die_args *)data); | 80 | shootdown_callback(cpu, (struct die_args *)data); |
| 78 | 81 | ||
| 79 | atomic_dec(&waiting_for_crash_ipi); | 82 | atomic_dec(&waiting_for_crash_ipi); |
| 80 | /* Assume hlt works */ | 83 | /* Assume hlt works */ |
| @@ -97,13 +100,15 @@ static struct notifier_block crash_nmi_nb = { | |||
| 97 | .notifier_call = crash_nmi_callback, | 100 | .notifier_call = crash_nmi_callback, |
| 98 | }; | 101 | }; |
| 99 | 102 | ||
| 100 | static void nmi_shootdown_cpus(void) | 103 | static void nmi_shootdown_cpus(nmi_shootdown_cb callback) |
| 101 | { | 104 | { |
| 102 | unsigned long msecs; | 105 | unsigned long msecs; |
| 103 | 106 | ||
| 104 | /* Make a note of crashing cpu. Will be used in NMI callback.*/ | 107 | /* Make a note of crashing cpu. Will be used in NMI callback.*/ |
| 105 | crashing_cpu = safe_smp_processor_id(); | 108 | crashing_cpu = safe_smp_processor_id(); |
| 106 | 109 | ||
| 110 | shootdown_callback = callback; | ||
| 111 | |||
| 107 | atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1); | 112 | atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1); |
| 108 | /* Would it be better to replace the trap vector here? */ | 113 | /* Would it be better to replace the trap vector here? */ |
| 109 | if (register_die_notifier(&crash_nmi_nb)) | 114 | if (register_die_notifier(&crash_nmi_nb)) |
| @@ -126,7 +131,7 @@ static void nmi_shootdown_cpus(void) | |||
| 126 | 131 | ||
| 127 | static void kdump_nmi_shootdown_cpus(void) | 132 | static void kdump_nmi_shootdown_cpus(void) |
| 128 | { | 133 | { |
| 129 | nmi_shootdown_cpus(); | 134 | nmi_shootdown_cpus(kdump_nmi_callback); |
| 130 | 135 | ||
| 131 | disable_local_APIC(); | 136 | disable_local_APIC(); |
| 132 | } | 137 | } |
