From: Michael Ellerman <mpe@ellerman•id.au>
To: Torsten Duwe <duwe@lst•de>
Cc: linuxppc-dev@ozlabs•org, bsingharora@gmail•com,
linux-kernel@vger•kernel.org, rostedt@goodmis•org,
kamalesh@linux•vnet.ibm.com, pmladek@suse•com, jeyu@redhat•com,
jkosina@suse•cz, live-patching@vger•kernel.org, mbenes@suse•cz
Subject: Re: [PATCH 02/12] powerpc/module: Mark module stubs with a magic value
Date: Fri, 26 Feb 2016 21:37:52 +1100 [thread overview]
Message-ID: <1456483072.25691.11.camel@ellerman.id.au> (raw)
In-Reply-To: <20160225131727.GD21932@lst.de>
On Thu, 2016-02-25 at 14:17 +0100, Torsten Duwe wrote:
> On Thu, Feb 25, 2016 at 01:28:25AM +1100, Michael Ellerman wrote:
> >
> > We can make that process easier by marking the generated stubs with a
> > magic value, and then looking for that magic value. Altough this is not
> > as rigorous as the current method, I believe it is sufficient in
> > practice.
>
> The actual magic value is sort of debatable; it should be "improbable"
> enough. But this can be changed easily, for each kernel compile, even.
Yeah. Given the locations we're trying to patch are computed in the first place
from the mcount call sites, I feel like we don't need to be super paranoid
here. The only time I've heard of this code (the current version) tripping up
is when folks are hacking on ftrace.
> > Signed-off-by: Michael Ellerman <mpe@ellerman•id.au>
> Reviewed-by: Torsten Duwe <duwe@suse•de>
>
> [for reference:]
> > +#define STUB_MAGIC 0x73747562 /* stub */
Which is one of:
ori r21,r19,29811
andi. r20,r27,30050
Both of which are pretty improbable. They don't appear in any kernel I have
around here.
I have more plans for this code, which would hopefully mean we can get rid of
the magic checking entirely. But I think this is OK for now.
cheers
next prev parent reply other threads:[~2016-02-26 10:37 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-24 14:28 [PATCH 01/12] powerpc/module: Only try to generate the ftrace_caller() stub once Michael Ellerman
2016-02-24 14:28 ` [PATCH 02/12] powerpc/module: Mark module stubs with a magic value Michael Ellerman
2016-02-25 0:04 ` Balbir Singh
2016-02-25 6:43 ` Michael Ellerman
2016-02-25 13:17 ` Torsten Duwe
2016-02-26 10:37 ` Michael Ellerman [this message]
2016-02-24 14:28 ` [PATCH 03/12] powerpc/module: Create a special stub for ftrace_caller() Michael Ellerman
2016-02-25 0:08 ` Balbir Singh
2016-02-25 10:48 ` Michael Ellerman
2016-02-25 13:31 ` Torsten Duwe
2016-02-26 10:35 ` Michael Ellerman
2016-02-24 14:28 ` [PATCH 04/12] powerpc/ftrace: Prepare for -mprofile-kernel Michael Ellerman
2016-02-25 0:28 ` Balbir Singh
2016-02-25 10:37 ` Michael Ellerman
2016-02-25 13:52 ` Torsten Duwe
2016-02-26 10:14 ` Michael Ellerman
2016-02-24 14:28 ` [PATCH 05/12] powerpc/ftrace: ftrace_graph_caller() needs to save/restore toc Michael Ellerman
2016-02-25 0:30 ` Balbir Singh
2016-02-25 10:39 ` Michael Ellerman
2016-02-25 14:02 ` Torsten Duwe
2016-02-24 14:28 ` [PATCH 06/12] powerpc/module: Rework is_early_mcount_callsite() Michael Ellerman
2016-02-24 23:39 ` Balbir Singh
2016-02-25 10:28 ` Michael Ellerman
2016-02-25 14:06 ` Torsten Duwe
2016-02-24 14:28 ` [PATCH 07/12] powerpc/ftrace: FTRACE_WITH_REGS implementation for ppc64le Michael Ellerman
2016-02-25 0:48 ` Balbir Singh
2016-02-25 15:11 ` Torsten Duwe
2016-02-26 10:14 ` Michael Ellerman
2016-02-24 14:28 ` [PATCH 08/12] powerpc/ftrace: Rework ftrace_caller() Michael Ellerman
2016-02-25 1:06 ` Balbir Singh
2016-02-25 14:25 ` Torsten Duwe
2016-02-24 14:28 ` [PATCH 09/12] powerpc/ftrace: Use generic ftrace_modify_all_code() Michael Ellerman
2016-02-25 1:10 ` Balbir Singh
2016-02-24 14:28 ` [PATCH 10/12] powerpc/ftrace: FTRACE_WITH_REGS configuration variables Michael Ellerman
2016-02-25 1:11 ` Balbir Singh
2016-02-25 14:34 ` Torsten Duwe
2016-02-24 14:28 ` [PATCH 11/12] powerpc/ftrace: Rework __ftrace_make_nop() Michael Ellerman
2016-02-24 14:28 ` [PATCH 12/12] powerpc/ftrace: Disable profiling for some files Michael Ellerman
2016-02-25 1:13 ` Balbir Singh
2016-02-24 23:55 ` [PATCH 01/12] powerpc/module: Only try to generate the ftrace_caller() stub once Balbir Singh
2016-02-25 4:36 ` Balbir Singh
2016-02-25 13:08 ` Torsten Duwe
2016-02-25 14:38 ` Kamalesh Babulal
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=1456483072.25691.11.camel@ellerman.id.au \
--to=mpe@ellerman$(echo .)id.au \
--cc=bsingharora@gmail$(echo .)com \
--cc=duwe@lst$(echo .)de \
--cc=jeyu@redhat$(echo .)com \
--cc=jkosina@suse$(echo .)cz \
--cc=kamalesh@linux$(echo .)vnet.ibm.com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=live-patching@vger$(echo .)kernel.org \
--cc=mbenes@suse$(echo .)cz \
--cc=pmladek@suse$(echo .)com \
--cc=rostedt@goodmis$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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