Commit e0476371 authored by Milton Miller's avatar Milton Miller Committed by Benjamin Herrenschmidt

powerpc: Remove call sites of MSG_ALL_BUT_SELF

The only user of MSG_ALL_BUT_SELF in the whole kernel tree is powerpc,
and it only uses it to start the debugger. Both debuggers always call
smp_send_debugger_break with MSG_ALL_BUT_SELF, and only mpic can do
anything more optimal than a loop over all online cpus, but all message
passing implementations have to code for this special delivery target.

Convert smp_send_debugger_break to take void and loop calling the smp_ops
message_pass function for each of the other cpus in the online cpumask.

Use raw_smp_processor_id() because we are either entering the debugger
or trying to start kdump and the additional warning it not useful were
it to trigger.
Signed-off-by: default avatarMilton Miller <miltonm@bga.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 2a116f3d
...@@ -35,7 +35,7 @@ extern void cpu_die(void); ...@@ -35,7 +35,7 @@ extern void cpu_die(void);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
extern void smp_send_debugger_break(int cpu); extern void smp_send_debugger_break(void);
extern void smp_message_recv(int); extern void smp_message_recv(int);
extern void start_secondary_resume(void); extern void start_secondary_resume(void);
......
...@@ -109,7 +109,7 @@ static int kgdb_call_nmi_hook(struct pt_regs *regs) ...@@ -109,7 +109,7 @@ static int kgdb_call_nmi_hook(struct pt_regs *regs)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
void kgdb_roundup_cpus(unsigned long flags) void kgdb_roundup_cpus(unsigned long flags)
{ {
smp_send_debugger_break(MSG_ALL_BUT_SELF); smp_send_debugger_break();
} }
#endif #endif
......
...@@ -218,10 +218,17 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask) ...@@ -218,10 +218,17 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask)
smp_ops->message_pass(cpu, PPC_MSG_CALL_FUNCTION); smp_ops->message_pass(cpu, PPC_MSG_CALL_FUNCTION);
} }
#ifdef CONFIG_DEBUGGER #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
void smp_send_debugger_break(int cpu) void smp_send_debugger_break(void)
{ {
if (likely(smp_ops)) int cpu;
int me = raw_smp_processor_id();
if (unlikely(!smp_ops))
return;
for_each_online_cpu(cpu)
if (cpu != me)
smp_ops->message_pass(cpu, PPC_MSG_DEBUGGER_BREAK); smp_ops->message_pass(cpu, PPC_MSG_DEBUGGER_BREAK);
} }
#endif #endif
...@@ -230,9 +237,9 @@ void smp_send_debugger_break(int cpu) ...@@ -230,9 +237,9 @@ void smp_send_debugger_break(int cpu)
void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *)) void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *))
{ {
crash_ipi_function_ptr = crash_ipi_callback; crash_ipi_function_ptr = crash_ipi_callback;
if (crash_ipi_callback && smp_ops) { if (crash_ipi_callback) {
mb(); mb();
smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_DEBUGGER_BREAK); smp_send_debugger_break();
} }
} }
#endif #endif
......
...@@ -437,7 +437,7 @@ static int xmon_core(struct pt_regs *regs, int fromipi) ...@@ -437,7 +437,7 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
xmon_owner = cpu; xmon_owner = cpu;
mb(); mb();
if (ncpus > 1) { if (ncpus > 1) {
smp_send_debugger_break(MSG_ALL_BUT_SELF); smp_send_debugger_break();
/* wait for other cpus to come in */ /* wait for other cpus to come in */
for (timeout = 100000000; timeout != 0; --timeout) { for (timeout = 100000000; timeout != 0; --timeout) {
if (cpumask_weight(&cpus_in_xmon) >= ncpus) if (cpumask_weight(&cpus_in_xmon) >= ncpus)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment