public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Arun Sharma <asharma@fb.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, eranian@google.com,
	paulus@samba.org, acme@redhat.com, hpa@zytor.com,
	mingo@kernel.org, tzanussi@gmail.com, a.p.zijlstra@chello.nl,
	efault@gmx.de, namhyung.kim@lge.com, fweisbec@gmail.com,
	tglx@linutronix.de, asharma@fb.com
Subject: [tip:perf/core] perf/x86: Allow multiple stacks
Date: Wed, 6 Jun 2012 09:02:09 -0700	[thread overview]
Message-ID: <tip-302fa4b58ac754a6da13f4f5546f710fecc3b945@git.kernel.org> (raw)
In-Reply-To: <1334961696-19580-2-git-send-email-asharma@fb.com>

Commit-ID:  302fa4b58ac754a6da13f4f5546f710fecc3b945
Gitweb:     http://git.kernel.org/tip/302fa4b58ac754a6da13f4f5546f710fecc3b945
Author:     Arun Sharma <asharma@fb.com>
AuthorDate: Fri, 20 Apr 2012 15:41:33 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 6 Jun 2012 17:07:58 +0200

perf/x86: Allow multiple stacks

Without this patch, applications with two different stack
regions (eg: native stack vs JIT stack) get truncated
callchains even when RBP chaining is present. GDB shows proper
stack traces and the frame pointer chaining is intact.

This patch disables the (fp < RSP) check, hoping that other checks
in the code save the day for us. In our limited testing, this
didn't seem to break anything.

In the long term, we could potentially have userspace advise
the kernel on the range of valid stack addresses, so we don't
spend a lot of time unwinding from bogus addresses.

Signed-off-by: Arun Sharma <asharma@fb.com>
CC: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-perf-users@vger.kernel.org
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1334961696-19580-2-git-send-email-asharma@fb.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/cpu/perf_event.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index cb60838..e78bc25 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -1781,9 +1781,6 @@ perf_callchain_user32(struct pt_regs *regs, struct perf_callchain_entry *entry)
 		if (bytes != sizeof(frame))
 			break;
 
-		if (fp < compat_ptr(regs->sp))
-			break;
-
 		perf_callchain_store(entry, frame.return_address);
 		fp = compat_ptr(frame.next_frame);
 	}
@@ -1827,9 +1824,6 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
 		if (bytes != sizeof(frame))
 			break;
 
-		if ((unsigned long)fp < regs->sp)
-			break;
-
 		perf_callchain_store(entry, frame.return_address);
 		fp = frame.next_frame;
 	}

  parent reply	other threads:[~2012-06-06 16:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-20 22:41 [PATCH 0/4] perf: Support multiple stacks (v3) Arun Sharma
2012-04-20 22:41 ` [PATCH 1/4] perf, x86: Allow multiple stacks Arun Sharma
2012-05-07 23:46   ` Arun Sharma
2012-06-06 16:02   ` tip-bot for Arun Sharma [this message]
2012-04-20 22:41 ` [PATCH 2/4] perf: Limit callchains to 127 Arun Sharma
2012-06-06 16:03   ` [tip:perf/core] " tip-bot for Arun Sharma
2012-04-20 22:41 ` [PATCH 3/4] perf, x86: Check if user fp is valid Arun Sharma
2012-06-06 16:03   ` [tip:perf/core] perf/x86: " tip-bot for Arun Sharma
2012-04-20 22:41 ` [PATCH 4/4] x86: Check user address explicitly in copy_from_user_nmi() Arun Sharma
2012-06-05 16:55   ` Peter Zijlstra
2012-06-06 16:04   ` [tip:perf/core] perf/x86: " tip-bot for Arun Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-302fa4b58ac754a6da13f4f5546f710fecc3b945@git.kernel.org \
    --to=asharma@fb.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=efault@gmx.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    --cc=tzanussi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox