linux-stable/arch/sparc
Rob Gardner 3f74306ac8 sparc64: Ensure perf can access user stacks
When an interrupt (such as a perf counter interrupt) is delivered
while executing in user space, the trap entry code puts ASI_AIUS in
%asi so that copy_from_user() and copy_to_user() will access the
correct memory. But if a perf counter interrupt is delivered while the
cpu is already executing in kernel space, then the trap entry code
will put ASI_P in %asi, and this will prevent copy_from_user() from
reading any useful stack data in either of the perf_callchain_user_X
functions, and thus no user callgraph data will be collected for this
sample period. An additional problem is that a fault is guaranteed
to occur, and though it will be silently covered up, it wastes time
and could perturb state.

In perf_callchain_user(), we ensure that %asi contains ASI_AIUS
because we know for a fact that the subsequent calls to
copy_from_user() are intended to read the user's stack.

[ Use get_fs()/set_fs() -DaveM ]

Signed-off-by: Rob Gardner <rob.gardner@oracle.com>
Signed-off-by: Dave Aldridge <david.j.aldridge@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-12-24 12:10:29 -05:00
..
boot sparc: Add "install" target 2014-08-04 20:45:59 -07:00
configs sparc: Set CONFIG_NET=y in defconfigs 2014-09-24 13:38:30 -04:00
crypto crypto: sparc - initialize blkcipher.ivsize 2015-10-08 21:36:48 +08:00
include sparc64: Add ADI capability to cpu capabilities 2015-12-24 12:05:06 -05:00
kernel sparc64: Ensure perf can access user stacks 2015-12-24 12:10:29 -05:00
lib Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc 2015-11-05 16:34:48 -08:00
math-emu arch/sparc/math-emu/math_32.c: drop stray break operator 2014-08-04 20:29:06 -07:00
mm sparc64: Fix numa distance values 2015-11-04 12:14:49 -08:00
net ebpf: migrate bpf_prog's flags to bitfield 2015-10-03 05:02:39 -07:00
oprofile
power Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc 2014-10-11 20:36:34 -04:00
prom sparc64: Fix register corruption in top-most kernel stack frame during boot. 2014-10-24 09:52:49 -07:00
Kbuild sparc64: Add SHA1 driver making use of the 'sha1' instruction. 2012-08-20 15:08:49 -07:00
Kconfig sparc: time: Replace update_persistent_clock() with CONFIG_RTC_SYSTOHC 2015-06-25 01:13:43 +02:00
Kconfig.debug
Makefile sparc: Add "install" target 2014-08-04 20:45:59 -07:00