summaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/smp_64.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-08-12 00:38:46 +0200
committerDavid S. Miller <davem@davemloft.net>2014-08-12 05:45:12 +0200
commit8bccf5b313180faefce38e0d1140f76e0f327d28 (patch)
treeed8d8f8c5696526f1ecf6fccd94680fe166427f4 /arch/sparc/kernel/smp_64.c
parentsparc64: Do not disable interrupts in nmi_cpu_busy() (diff)
downloadlinux-8bccf5b313180faefce38e0d1140f76e0f327d28.tar.xz
linux-8bccf5b313180faefce38e0d1140f76e0f327d28.zip
sparc64: Fix pcr_ops initialization and usage bugs.
Christopher reports that perf_event_print_debug() can crash in uniprocessor builds. The crash is due to pcr_ops being NULL. This happens because pcr_arch_init() is only invoked by smp_cpus_done() which only executes in SMP builds. init_hw_perf_events() is closely intertwined with pcr_ops being setup properly, therefore: 1) Call pcr_arch_init() early on from init_hw_perf_events(), instead of from smp_cpus_done(). 2) Do not hook up a PMU type if pcr_ops is NULL after pcr_arch_init(). 3) Move init_hw_perf_events to a later initcall so that it we will be sure to invoke pcr_arch_init() after all cpus are brought up. Finally, guard the one naked sequence of pcr_ops dereferences in __global_pmu_self() with an appropriate NULL check. Reported-by: Christopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--arch/sparc/kernel/smp_64.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index 41aa2478f3ca..f7ba87543e5f 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1383,7 +1383,6 @@ void __cpu_die(unsigned int cpu)
void __init smp_cpus_done(unsigned int max_cpus)
{
- pcr_arch_init();
}
void smp_send_reschedule(int cpu)