From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Steven Rostedt <rostedt@goodmis.org>, linux-kernel@vger.kernel.org
Cc: "H. Peter Anvin" <hpa@linux.intel.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Frederic Weisbecker <fweisbec@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
yrl.pp-manager.tt@hitachi.com
Subject: [PATCH -tip 0/4][BUGFIX] Fix ftrace-based kprobes
Date: Wed, 05 Sep 2012 23:30:46 +0900 [thread overview]
Message-ID: <20120905143045.10329.64502.stgit@localhost.localdomain> (raw)
Hi,
This series of patches fixes some bugs and corrects behaviors
of ftrace and ftrace-based kprobe.
As Fengguang reported at https://lkml.org/lkml/2012/8/24/45
ftrace-based kprobes and -mfentry option caused failures
on kprobe smoke test. This basically comes from the initial
design of ftrace-based kprobe which prohibits jprobe on
ftraced kprobe.
Without -mfentry support, this works well because NO mcount
call is at the first instruction of any function. However,
-mfentry calls it at the first one and it conflicts with
jprobe.
On this series, kprobe allows jprobe even if it is based on
ftrace. For this fix, I need following fixes.
- Make ftrace-handler interface same on x86/x86-64
On x86, ftrace_regs_caller puts a same address on ip and
regs.ip, however those are different on x86-64. I've
modified x86 to fit to x86-64 ABI.
- Fix kprobe ftrace handler for above ABI change
Current kprobe_ftrace_handler expects ip == regs.ip, but
it's not correct on x86-64 (and now on x86 too). This should
be fixed.
- Use regs.ip for return address on ftrace
From Steven, this change is suggested. Thanks!
Thank you,
---
Masami Hiramatsu (3):
[BUGFIX] kprobes/x86: Fix to support jprobes on ftrace-based kprobe
[BUGFIX] kprobes/x86: Fix kprobes to collectly handle IP on ftrace
[BUGFIX] ftrace/x86: Adjust x86 regs.ip as like as x86-64
Steven Rostedt (1):
ftrace/x86-64: Allow to change RIP in handlers
arch/x86/kernel/entry_32.S | 3 +--
arch/x86/kernel/entry_64.S | 4 ++++
arch/x86/kernel/kprobes.c | 43 +++++++++++++++++++++++++++++++------------
kernel/kprobes.c | 3 ---
4 files changed, 36 insertions(+), 17 deletions(-)
--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com
next reply other threads:[~2012-09-05 14:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-05 14:30 Masami Hiramatsu [this message]
2012-09-05 14:31 ` [PATCH -tip 1/4] [BUGFIX] ftrace/x86: Adjust x86 regs.ip as like as x86-64 Masami Hiramatsu
2012-09-14 11:42 ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2012-09-05 14:31 ` [PATCH -tip 2/4] [BUGFIX] kprobes/x86: Fix kprobes to collectly handle IP on ftrace Masami Hiramatsu
2012-09-14 11:43 ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2012-09-05 14:31 ` [PATCH -tip 3/4] ftrace/x86-64: Allow to change RIP in handlers Masami Hiramatsu
2012-09-14 11:44 ` [tip:perf/core] " tip-bot for Steven Rostedt
2012-09-05 14:31 ` [PATCH -tip 4/4] [BUGFIX] kprobes/x86: Fix to support jprobes on ftrace-based kprobe Masami Hiramatsu
2012-09-07 8:44 ` Masami Hiramatsu
2012-09-14 11:45 ` [tip:perf/core] " tip-bot for Masami Hiramatsu
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=20120905143045.10329.64502.stgit@localhost.localdomain \
--to=masami.hiramatsu.pt@hitachi.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=hpa@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=yrl.pp-manager.tt@hitachi.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
Powered by JetHome