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

MIPS: paravirt: Fix undefined reference to smp_bootstrap

If the paravirt machine is compiles without CONFIG_SMP, the following
linker error occurs

arch/mips/kernel/head.o: In function `kernel_entry':
(.ref.text+0x10): undefined reference to `smp_bootstrap'

due to the kernel entry macro always including SMP startup code.
Wrap this code in CONFIG_SMP to fix the error.

Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org # 3.16+
Patchwork: https://patchwork.linux-mips.org/patch/14212/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Matt Redfearn and committed by
Ralf Baechle
951c39cd b03c1e3b

+2
+2
arch/mips/include/asm/mach-paravirt/kernel-entry-init.h
··· 11 11 #define CP0_EBASE $15, 1 12 12 13 13 .macro kernel_entry_setup 14 + #ifdef CONFIG_SMP 14 15 mfc0 t0, CP0_EBASE 15 16 andi t0, t0, 0x3ff # CPUNum 16 17 beqz t0, 1f 17 18 # CPUs other than zero goto smp_bootstrap 18 19 j smp_bootstrap 20 + #endif /* CONFIG_SMP */ 19 21 20 22 1: 21 23 .endm