Skip to content

Commit

Permalink
perf/x86/amd: Fix AMD NB and L2I "uncore" support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jacob Shin authored and Ingo Molnar committed Apr 22, 2013
1 parent 0cf5f43 commit 94f4db3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/x86/kernel/cpu/perf_event_amd_uncore.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,6 @@ static void __init init_cpu_already_online(void *dummy)
{
unsigned int cpu = smp_processor_id();

amd_uncore_cpu_up_prepare(cpu);
amd_uncore_cpu_starting(cpu);
amd_uncore_cpu_online(cpu);
}
Expand Down Expand Up @@ -535,8 +534,10 @@ static int __init amd_uncore_init(void)

get_online_cpus();
/* init cpus already online before registering for hotplug notifier */
for_each_online_cpu(cpu)
for_each_online_cpu(cpu) {
amd_uncore_cpu_up_prepare(cpu);
smp_call_function_single(cpu, init_cpu_already_online, NULL, 1);
}

register_cpu_notifier(&amd_uncore_cpu_notifier_block);
put_online_cpus();
Expand Down

0 comments on commit 94f4db3

Please sign in to comment.