Re: 2.6.34-rc2: cpu hotplug test failure on x86_64

From: Peter Zijlstra
Date: Sat Mar 20 2010 - 13:29:19 EST


On Sat, 2010-03-20 at 22:47 +0530, Sachin Sant wrote:
> Running cpu hotplug tests on a x86_64 box results in
> the following BUG.
>
> BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
> IP: [<ffffffff81037388>] amd_pmu_cpu_offline+0x38/0x67

I guess something like the below might work.

---
arch/x86/kernel/cpu/perf_event_amd.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_event_amd.c b/arch/x86/kernel/cpu/perf_event_amd.c
index 358a8e3..0189af4 100644
--- a/arch/x86/kernel/cpu/perf_event_amd.c
+++ b/arch/x86/kernel/cpu/perf_event_amd.c
@@ -345,6 +345,8 @@ static void amd_pmu_cpu_offline(int cpu)
return;

cpuhw = &per_cpu(cpu_hw_events, cpu);
+ if (!cpuhw)
+ return;

raw_spin_lock(&amd_nb_lock);



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/