From: Abel Vesa <abelvesa@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Russell King - ARM Linux <linux@armlinux.org.uk>,
Abel Vesa <abelvesa@linux.com>,
mingo@redhat.com, viro@zeniv.linux.org.uk,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, jjhiblot@traphandler.com,
pmladek@suse.com, robin.murphy@arm.com,
zhouchengming1@huawei.com, Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS
Date: Thu, 9 Feb 2017 19:01:10 +0000 [thread overview]
Message-ID: <20170209190110.GC3439@nuc> (raw)
In-Reply-To: <20170209131452.472aa882@gandalf.local.home>
On Thu, Feb 09, 2017 at 01:14:52PM -0500, Steven Rostedt wrote:
>
> [ sending again with Masami Cc'd ]
>
> On Thu, 9 Feb 2017 13:14:14 -0500
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > On Thu, 9 Feb 2017 18:06:44 +0000
> > Russell King - ARM Linux <linux@armlinux.org.uk> wrote:
> >
> > > On Thu, Feb 09, 2017 at 12:13:22PM -0500, Steven Rostedt wrote:
> > > > Then came along live kernel patching, which I believe this series is
> > > > trying to support. What is needed by pt_regs is a way to "hijack" the
> > > > function being called to instead call the patched function. That is,
> > > > ftrace is not being used for tracing, but in reality, being used to
> > > > modify the running kernel. It is being used to change what function
> > > > gets called. ftrace is just a hook for that mechanism.
> > >
> > > So, would I be correct to assume that the only parts of pt_regs that
> > > would be touched are those which contain arguments to the function,
> > > and the register which would contain the return value?
> > >
> >
> > For live kernel patching, perhaps.
> >
> > But for kprobes, I think they can touch anything. Matters what the
> > creater of the kprobe wanted to do.
> >
Thing is, by saving all of them is the easiest way to ensure that the
whole context is the same when the replacing function gets called, as
I said before.
We can't be sure that while __ftrace_ops_list_func is executing, any of
the regs will have the value they had when the function-to-be-replaced
was called. That's the reason I say we need to save them all.
> > -- Steve
>
next prev parent reply other threads:[~2017-02-09 19:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-07 22:57 [PATCHv3] arm: ftrace: Adds support for CONFIG_DYNAMIC_FTRACE_WITH_REGS Abel Vesa
2017-02-09 15:38 ` Jean-Jacques Hiblot
2017-02-09 15:49 ` Russell King - ARM Linux
2017-02-09 16:29 ` Russell King - ARM Linux
2017-02-09 17:13 ` Steven Rostedt
2017-02-09 18:06 ` Russell King - ARM Linux
2017-02-09 18:14 ` Steven Rostedt
2017-02-09 18:14 ` Steven Rostedt
2017-02-09 19:01 ` Abel Vesa [this message]
2017-02-09 19:09 ` Abel Vesa
2017-02-09 18:18 ` Abel Vesa
2017-02-09 18:30 ` Abel Vesa
2017-02-10 10:36 ` Jean-Jacques Hiblot
2017-02-10 12:03 ` Abel Vesa
2017-02-10 13:57 ` Jean-Jacques Hiblot
2017-02-10 17:27 ` Abel Vesa
2017-02-10 14:28 ` Russell King - ARM Linux
2017-02-10 17:17 ` Abel Vesa
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=20170209190110.GC3439@nuc \
--to=abelvesa@gmail.com \
--cc=abelvesa@linux.com \
--cc=jjhiblot@traphandler.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=pmladek@suse.com \
--cc=robin.murphy@arm.com \
--cc=rostedt@goodmis.org \
--cc=viro@zeniv.linux.org.uk \
--cc=zhouchengming1@huawei.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