Commit 08280e6c authored by David S. Miller's avatar David S. Miller

sparc64: Like x86 we should check current->mm during perf backtrace generation.

If the MM is not active, only report the top-level PC.  Do not try to
access the address space.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ddffeb8c
...@@ -1738,8 +1738,6 @@ static void perf_callchain_user_64(struct perf_callchain_entry *entry, ...@@ -1738,8 +1738,6 @@ static void perf_callchain_user_64(struct perf_callchain_entry *entry,
{ {
unsigned long ufp; unsigned long ufp;
perf_callchain_store(entry, regs->tpc);
ufp = regs->u_regs[UREG_I6] + STACK_BIAS; ufp = regs->u_regs[UREG_I6] + STACK_BIAS;
do { do {
struct sparc_stackf *usf, sf; struct sparc_stackf *usf, sf;
...@@ -1760,8 +1758,6 @@ static void perf_callchain_user_32(struct perf_callchain_entry *entry, ...@@ -1760,8 +1758,6 @@ static void perf_callchain_user_32(struct perf_callchain_entry *entry,
{ {
unsigned long ufp; unsigned long ufp;
perf_callchain_store(entry, regs->tpc);
ufp = regs->u_regs[UREG_I6] & 0xffffffffUL; ufp = regs->u_regs[UREG_I6] & 0xffffffffUL;
do { do {
struct sparc_stackf32 *usf, sf; struct sparc_stackf32 *usf, sf;
...@@ -1780,6 +1776,11 @@ static void perf_callchain_user_32(struct perf_callchain_entry *entry, ...@@ -1780,6 +1776,11 @@ static void perf_callchain_user_32(struct perf_callchain_entry *entry,
void void
perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
{ {
perf_callchain_store(entry, regs->tpc);
if (!current->mm)
return;
flushw_user(); flushw_user();
if (test_thread_flag(TIF_32BIT)) if (test_thread_flag(TIF_32BIT))
perf_callchain_user_32(entry, regs); perf_callchain_user_32(entry, regs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment