Subject: Don't access 'current' registers in interrupt handler From: Kevin Corry The pfm_cell_disable_counters() routine can be called during interrupt context, and if we are using hardware-sampling, the "current" thread's registers may not be available, and accessing them may cause a segfault. Since we don't actually use the "ip" and "regs" arguments in the hardware-sampling handler, we can just pass zeros and get rid of the reference to the "current" registers. Signed-off-by: Kevin Corry Signed-off-by: Carl Love Signed-off-by: Arnd Bergmann Index: linux-2.6/arch/powerpc/perfmon/perfmon_cell.c =================================================================== --- linux-2.6.orig/arch/powerpc/perfmon/perfmon_cell.c +++ linux-2.6/arch/powerpc/perfmon/perfmon_cell.c @@ -306,16 +306,14 @@ static void pfm_cell_disable_counters(st struct pfm_event_set *set) { struct pfm_smpl_fmt *smpl_fmt = ctx->smpl_fmt; - struct pt_regs *regs; cbe_disable_pm(smp_processor_id()); if (smpl_fmt && !strcmp(smpl_fmt->fmt_name, PFM_CELL_HW_SMPL_NAME)) { ctx->ovfl_arg.ovfl_pmd = PFM_CELL_HW_SMPL_OVFL_PMD_PARTIAL; ctx->ovfl_arg.active_set = ctx->active_set->id; - regs = current->thread.regs; - smpl_fmt->fmt_handler(ctx->smpl_addr, &ctx->ovfl_arg, - instruction_pointer(regs), 0, regs); + smpl_fmt->fmt_handler(ctx->smpl_addr, + &ctx->ovfl_arg, 0, 0, NULL); } }