aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2018-04-01 06:36:13 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2018-04-03 08:59:09 -0400
commit6bed3237624e3faad1592543952907cd01a42c83 (patch)
treeb3a9aa7ef1247c67ad75b42147e13f35ed528a8f
parenta2b5e056b75ee6ef0777817644a456b36b96ce38 (diff)
powerpc: use NMI IPI for smp_send_stop
Use the NMI IPI rather than smp_call_function for smp_send_stop. Have stopped CPUs hard disable interrupts rather than just soft disable. This function is used in crash/panic/shutdown paths to bring other CPUs down as quickly and reliably as possible, and minimizing their potential to cause trouble. Avoiding the Linux smp_call_function infrastructure and (if supported) using true NMI IPIs makes this more robust. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/kernel/smp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index cfc08b099c49..db88660bf6bd 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -565,7 +565,11 @@ void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *))
565} 565}
566#endif 566#endif
567 567
568#ifdef CONFIG_NMI_IPI
569static void stop_this_cpu(struct pt_regs *regs)
570#else
568static void stop_this_cpu(void *dummy) 571static void stop_this_cpu(void *dummy)
572#endif
569{ 573{
570 /* Remove this CPU */ 574 /* Remove this CPU */
571 set_cpu_online(smp_processor_id(), false); 575 set_cpu_online(smp_processor_id(), false);
@@ -577,7 +581,11 @@ static void stop_this_cpu(void *dummy)
577 581
578void smp_send_stop(void) 582void smp_send_stop(void)
579{ 583{
584#ifdef CONFIG_NMI_IPI
585 smp_send_nmi_ipi(NMI_IPI_ALL_OTHERS, stop_this_cpu, 1000000);
586#else
580 smp_call_function(stop_this_cpu, NULL, 0); 587 smp_call_function(stop_this_cpu, NULL, 0);
588#endif
581} 589}
582 590
583struct thread_info *current_set[NR_CPUS]; 591struct thread_info *current_set[NR_CPUS];