Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/64s: Fix build failures with CONFIG_NMI_IPI=n

I broke the build when CONFIG_NMI_IPI=n with my recent commit to add
arch_trigger_cpumask_backtrace(), eg:

stacktrace.c:(.text+0x1b0): undefined reference to `.smp_send_safe_nmi_ipi'

We should rework the CONFIG symbols here in future to avoid these
double barrelled ifdefs but for now they fix the build.

Fixes: 5cc05910f26e ("powerpc/64s: Wire up arch_trigger_cpumask_backtrace()")
Reported-by: Christophe LEROY <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

+3 -3
+1 -1
arch/powerpc/include/asm/nmi.h
··· 8 8 static inline void arch_touch_nmi_watchdog(void) {} 9 9 #endif 10 10 11 - #if defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_STACKTRACE) 11 + #if defined(CONFIG_NMI_IPI) && defined(CONFIG_STACKTRACE) 12 12 extern void arch_trigger_cpumask_backtrace(const cpumask_t *mask, 13 13 bool exclude_self); 14 14 #define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
+2 -2
arch/powerpc/kernel/stacktrace.c
··· 196 196 EXPORT_SYMBOL_GPL(save_stack_trace_tsk_reliable); 197 197 #endif /* CONFIG_HAVE_RELIABLE_STACKTRACE */ 198 198 199 - #ifdef CONFIG_PPC_BOOK3S_64 199 + #if defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_NMI_IPI) 200 200 static void handle_backtrace_ipi(struct pt_regs *regs) 201 201 { 202 202 nmi_cpu_backtrace(regs); ··· 242 242 { 243 243 nmi_trigger_cpumask_backtrace(mask, exclude_self, raise_backtrace_ipi); 244 244 } 245 - #endif /* CONFIG_PPC64 */ 245 + #endif /* defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_NMI_IPI) */