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

sparc64: Fix NMI startup bug which also breaks perf.

Doing NMI startup as an early initcall doesn't work because we need
to have SMP started up by then.

So we'd only NMI startup one cpu, which causes perf PMU grab to
BUG because the nmi_active count isn't what it's supposed to be.

This also points out that we don't have proper CPU up/down notifiers
for the NMI code which will need to be fixed at some point.

Signed-off-by: David S. Miller <davem@davemloft.net>

+4 -2
+2
arch/sparc/include/asm/pcr.h
··· 43 43 44 44 extern u64 pcr_enable; 45 45 46 + extern int pcr_arch_init(void); 47 + 46 48 #endif /* __PCR_H */
-2
arch/sparc/kernel/pcr.c
··· 167 167 unregister_perf_hsvc(); 168 168 return err; 169 169 } 170 - 171 - early_initcall(pcr_arch_init);
+2
arch/sparc/kernel/smp_64.c
··· 49 49 #include <asm/mdesc.h> 50 50 #include <asm/ldc.h> 51 51 #include <asm/hypervisor.h> 52 + #include <asm/pcr.h> 52 53 53 54 #include "cpumap.h" 54 55 ··· 1359 1358 1360 1359 void __init smp_cpus_done(unsigned int max_cpus) 1361 1360 { 1361 + pcr_arch_init(); 1362 1362 } 1363 1363 1364 1364 void smp_send_reschedule(int cpu)