Patchwork [3.5.y.z,extended,stable] Patch "sparc64: Like x86 we should check current->mm during perf" has been added to staging queue

login
register
mail settings
Submitter Herton Ronaldo Krzesinski
Date Dec. 12, 2012, 5:09 a.m.
Message ID <1355288954-29350-1-git-send-email-herton.krzesinski@canonical.com>
Download mbox | patch
Permalink /patch/205380/
State New
Headers show

Comments

Herton Ronaldo Krzesinski - Dec. 12, 2012, 5:09 a.m.
This is a note to let you know that I have just added a patch titled

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

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Herton

------

From e6b0b89e64bd1c169827df115f828ad26a5de370 Mon Sep 17 00:00:00 2001
From: "David S. Miller" <davem@davemloft.net>
Date: Sun, 14 Oct 2012 17:59:40 -0700
Subject: [PATCH] sparc64: Like x86 we should check current->mm during perf
 backtrace generation.

commit 08280e6c4c2e8049ac61d9e8e3536ec1df629c0d upstream.

If the MM is not active, only report the top-level PC.  Do not try to
access the address space.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
---
 arch/sparc/kernel/perf_event.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

--
1.7.9.5

Patch

diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c
index 5713957..b0cce26 100644
--- a/arch/sparc/kernel/perf_event.c
+++ b/arch/sparc/kernel/perf_event.c
@@ -1426,8 +1426,6 @@  static void perf_callchain_user_64(struct perf_callchain_entry *entry,
 {
 	unsigned long ufp;

-	perf_callchain_store(entry, regs->tpc);
-
 	ufp = regs->u_regs[UREG_I6] + STACK_BIAS;
 	do {
 		struct sparc_stackf *usf, sf;
@@ -1448,8 +1446,6 @@  static void perf_callchain_user_32(struct perf_callchain_entry *entry,
 {
 	unsigned long ufp;

-	perf_callchain_store(entry, regs->tpc);
-
 	ufp = regs->u_regs[UREG_I6] & 0xffffffffUL;
 	do {
 		struct sparc_stackf32 *usf, sf;
@@ -1468,6 +1464,11 @@  static void perf_callchain_user_32(struct perf_callchain_entry *entry,
 void
 perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
 {
+	perf_callchain_store(entry, regs->tpc);
+
+	if (!current->mm)
+		return;
+
 	flushw_user();
 	if (test_thread_flag(TIF_32BIT))
 		perf_callchain_user_32(entry, regs);