diff options
author | Jacob Shin <jacob.shin@amd.com> | 2013-04-21 14:06:27 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-04-22 04:10:55 -0400 |
commit | 94f4db3590893c600506105b88dab581c7f6f5c8 (patch) | |
tree | 0208cf22b67cd57f69bf21c5dbf37b51fad35eb5 | |
parent | 0cf5f4323b1b51ecca3e952f95110e03ea611882 (diff) |
perf/x86/amd: Fix AMD NB and L2I "uncore" support
Borislav Petkov reported a lockdep splat warning about kzalloc()
done in an IPI (hardirq) handler.
This is a real bug, do not call kzalloc() in a smp_call_function_single()
handler because it can schedule and crash.
Reported-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Jacob Shin <jacob.shin@amd.com>
Tested-by: Borislav Petkov <bp@suse.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: <eranian@google.com>
Cc: <a.p.zijlstra@chello.nl>
Cc: <acme@ghostprotocols.net>
Cc: <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20130421180627.GA21049@jshin-Toonie
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_amd_uncore.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_amd_uncore.c b/arch/x86/kernel/cpu/perf_event_amd_uncore.c index 6dc62273639c..c0c661adf03e 100644 --- a/arch/x86/kernel/cpu/perf_event_amd_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_amd_uncore.c | |||
@@ -498,7 +498,6 @@ static void __init init_cpu_already_online(void *dummy) | |||
498 | { | 498 | { |
499 | unsigned int cpu = smp_processor_id(); | 499 | unsigned int cpu = smp_processor_id(); |
500 | 500 | ||
501 | amd_uncore_cpu_up_prepare(cpu); | ||
502 | amd_uncore_cpu_starting(cpu); | 501 | amd_uncore_cpu_starting(cpu); |
503 | amd_uncore_cpu_online(cpu); | 502 | amd_uncore_cpu_online(cpu); |
504 | } | 503 | } |
@@ -535,8 +534,10 @@ static int __init amd_uncore_init(void) | |||
535 | 534 | ||
536 | get_online_cpus(); | 535 | get_online_cpus(); |
537 | /* init cpus already online before registering for hotplug notifier */ | 536 | /* init cpus already online before registering for hotplug notifier */ |
538 | for_each_online_cpu(cpu) | 537 | for_each_online_cpu(cpu) { |
538 | amd_uncore_cpu_up_prepare(cpu); | ||
539 | smp_call_function_single(cpu, init_cpu_already_online, NULL, 1); | 539 | smp_call_function_single(cpu, init_cpu_already_online, NULL, 1); |
540 | } | ||
540 | 541 | ||
541 | register_cpu_notifier(&amd_uncore_cpu_notifier_block); | 542 | register_cpu_notifier(&amd_uncore_cpu_notifier_block); |
542 | put_online_cpus(); | 543 | put_online_cpus(); |