linux-uconsole/arch
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
..
alpha untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
arm pxa/colibri: fix missing #include <mach/mfp.h> in colibri.h 2010-05-12 14:57:16 -07:00
avr32 untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
blackfin FDPIC: Respect PT_GNU_STACK exec protection markings when creating NOMMU stack 2010-02-09 04:50:49 -08:00
cris untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
frv FDPIC: Respect PT_GNU_STACK exec protection markings when creating NOMMU stack 2010-02-09 04:50:49 -08:00
h8300 untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
ia64 KVM: fix the handling of dirty bitmaps to avoid overflows 2010-04-26 07:41:37 -07:00
m32r untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
m68k untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
m68knommu untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
microblaze untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
mips MIPS: Sibyte: Apply M3 workaround only on affected chip types and versions. 2010-05-12 14:57:17 -07:00
mn10300 untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
parisc parisc: Set PCI CLS early in boot. 2010-05-12 14:57:13 -07:00
powerpc powerpc/perf_event: Fix oops due to perf_event_do_pending call 2010-05-26 14:29:16 -07:00
s390 ptrace: fix return value of do_syscall_trace_enter() 2010-05-26 14:29:16 -07:00
score untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
sh sh: Fix FDPIC binary loader 2010-04-26 07:41:17 -07:00
sparc sparc64: Make prom entry spinlock NMI safe. 2010-04-01 15:58:16 -07:00
um x86: Fix breakage of UML from the changes in the rwsem system 2010-04-26 07:41:28 -07:00
x86 KVM: remove unused load_segment_descriptor_to_kvm_desct 2010-05-12 14:57:11 -07:00
xtensa untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
.gitignore
Kconfig oprofile: remove tracing build dependency 2010-03-15 08:49:47 -07:00