linux-uconsole/arch/powerpc
Paul Mackerras 73ef533de7 powerpc/perf_event: Fix oops due to perf_event_do_pending call
commit 0fe1ac48be upstream.

Anton Blanchard found that large POWER systems would occasionally
crash in the exception exit path when profiling with perf_events.
The symptom was that an interrupt would occur late in the exit path
when the MSR[RI] (recoverable interrupt) bit was clear.  Interrupts
should be hard-disabled at this point but they were enabled.  Because
the interrupt was not recoverable the system panicked.

The reason is that the exception exit path was calling
perf_event_do_pending after hard-disabling interrupts, and
perf_event_do_pending will re-enable interrupts.

The simplest and cleanest fix for this is to use the same mechanism
that 32-bit powerpc does, namely to cause a self-IPI by setting the
decrementer to 1.  This means we can remove the tests in the exception
exit path and raw_local_irq_restore.

This also makes sure that the call to perf_event_do_pending from
timer_interrupt() happens within irq_enter/irq_exit.  (Note that
calling perf_event_do_pending from timer_interrupt does not mean that
there is a possible 1/HZ latency; setting the decrementer to 1 ensures
that the timer interrupt will happen immediately, i.e. within one
timebase tick, which is a few nanoseconds or 10s of nanoseconds.)

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-26 14:29:16 -07:00
..
boot Merge branch 'hostprogs-wmissing-prototypes' of git://git.kernel.org/pub/scm/linux/kernel/git/josh/linux-misc 2009-11-17 09:14:49 -08:00
configs powerpc: pasemi_defconfig update 2009-11-11 15:44:02 +11:00
include/asm powerpc/perf_event: Fix oops due to perf_event_do_pending call 2010-05-26 14:29:16 -07:00
kernel powerpc/perf_event: Fix oops due to perf_event_do_pending call 2010-05-26 14:29:16 -07:00
kvm powerpc/kvm: Remove problematic BUILD_BUG_ON statement 2009-11-05 17:10:34 +11:00
lib powerpc: Add configurable -Werror for arch/powerpc 2009-06-16 14:15:45 +10:00
math-emu powerpc/math-emu: Fix efp dependence 2009-03-11 06:00:08 -05:00
mm kgdb: don't needlessly skip PAGE_USER test for Fsl booke 2010-05-12 14:57:12 -07:00
oprofile powerpc: Remove unnecessary semicolons 2009-07-08 13:50:21 +10:00
platforms powerpc/82xx: kmalloc failure ignored in ep8248e_mdio_probe() 2009-11-05 07:18:00 -06:00
sysdev powerpc/fsl: Add PCI device ids for new QoirQ chips 2010-01-28 15:00:40 -08:00
xmon powerpc/booke: Fix xmon single step on PowerPC Book-E 2009-10-27 16:42:40 +11:00
Kconfig powerpc: Cleanup Kconfig selection of hugetlbfs support 2009-10-30 15:03:54 +11:00
Kconfig.debug powerpc: Add configurable -Werror for arch/powerpc 2009-06-16 14:15:45 +10:00
Makefile powerpc: Check for unsupported relocs when using CONFIG_RELOCATABLE 2009-09-24 15:31:40 +10:00
relocs_check.pl powerpc: Check for unsupported relocs when using CONFIG_RELOCATABLE 2009-09-24 15:31:40 +10:00