Commit 9e8307ec authored by David S. Miller's avatar David S. Miller

sparc64: Properly truncate pt_regs framepointer in perf callback.

For 32-bit processes, we save the full 64-bits of the regs in pt_regs.

But unlike when the userspace actually does load and store
instructions, the top 32-bits don't get automatically truncated by the
cpu in kernel mode (because the kernel doesn't execute with PSTATE_AM
address masking enabled).

So we have to do it by hand.
Reported-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d2566af8
...@@ -1337,7 +1337,7 @@ static void perf_callchain_user_32(struct pt_regs *regs, ...@@ -1337,7 +1337,7 @@ static void perf_callchain_user_32(struct pt_regs *regs,
callchain_store(entry, PERF_CONTEXT_USER); callchain_store(entry, PERF_CONTEXT_USER);
callchain_store(entry, regs->tpc); callchain_store(entry, regs->tpc);
ufp = regs->u_regs[UREG_I6]; ufp = regs->u_regs[UREG_I6] & 0xffffffffUL;
do { do {
struct sparc_stackf32 *usf, sf; struct sparc_stackf32 *usf, sf;
unsigned long pc; unsigned long pc;
......
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