[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100329.130931.149161813.davem@davemloft.net>
Date: Mon, 29 Mar 2010 13:09:31 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: fweisbec@...il.com
Cc: linux-kernel@...r.kernel.org, sparclinux@...r.kernel.org
Subject: Re: [BUG] fault while using perf callchains in sparc64
From: Frederic Weisbecker <fweisbec@...il.com>
Date: Sun, 28 Mar 2010 06:34:49 +0200
> I get kernel crashes each time I use perf with callchains
> on sparc 64.
>
> It triggers with a simple:
>
> perf record -a -f -g sleep 1
This should fix it, thanks again.
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: Frederic Weisbecker <fweisbec@...il.com>
Signed-off-by: David S. Miller <davem@...emloft.net>
---
arch/sparc/kernel/perf_event.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c
index 9f2b2ba..610112e 100644
--- a/arch/sparc/kernel/perf_event.c
+++ b/arch/sparc/kernel/perf_event.c
@@ -1337,7 +1337,7 @@ static void perf_callchain_user_32(struct pt_regs *regs,
callchain_store(entry, PERF_CONTEXT_USER);
callchain_store(entry, regs->tpc);
- ufp = regs->u_regs[UREG_I6];
+ ufp = regs->u_regs[UREG_I6] & 0xffffffffUL;
do {
struct sparc_stackf32 *usf, sf;
unsigned long pc;
--
1.7.0.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists