]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sparc64: Fix segfaults and incorrect data collection by perf
authorDave Aldridge <david.j.aldridge@oracle.com>
Wed, 16 Dec 2015 17:04:25 +0000 (09:04 -0800)
committerAllen Pais <allen.pais@oracle.com>
Mon, 21 Dec 2015 17:05:39 +0000 (22:35 +0530)
commit708559f82b9545fb19c0e068c864a4a96298afc8
treedb9b9fec5ac5c5c64a462c77032536abf6eee5f9
parent29a8d1d61ed329d7e5d876fffe572bc05ce2116a
sparc64: Fix segfaults and incorrect data collection by perf

There are two perf problems addressed by this commit:

1) Perf doesn't produce totally accurate call graphs for the user
   space processes being analyzed. This is because the kernel's
   space identifier is used to access the user stack when a
   privileged context is interrupted by irq15 (perf counter
   interrupt).

2) Spurious segfaults and bus errors occur in random processes,
   including perf itself. This is caused by the same situation as
   above, but if the perf counter interrupt arrives in the middle of
   handling a fault (ie, TLB miss, page fault, etc), the running
   thread's fault address and/or fault code (in thread_info) can be
   inadvertantly modified by a nested fault, which makes the fault
   unresolvable, and the process is killed with a signal.
   This inadvertant modification happens because perf interrupt
   processing can (and will) incur a fault itself while walking
   the user stack, and this can overwrite the fault information
   for the handler that was interrupted.

Orabug: 22350940

Signed-off-by: Dave Aldridge <david.j.aldridge@oracle.com>
Signed-off-by: Rob Gardner <rob.gardner@oracle.com>
(cherry picked from commit 21c8eb7e6a89f6be2a90ab8044ff64ceea8c2b36)
arch/sparc/kernel/perf_event.c