Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1336278
| From | Torsten Duwe <duwe@lst.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v8 1/8] ppc64 (le): prepare for -mprofile-kernel |
| Date | 2016-02-17 12:40 +0100 |
| Message-ID | <r38CC-5Js-7@gated-at.bofh.it> (permalink) |
| References | <r0H3P-5r5-3@gated-at.bofh.it> <r0H3R-5r5-37@gated-at.bofh.it> <r37ZT-5dl-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Feb 17, 2016 at 09:55:40PM +1100, Michael Ellerman wrote:
> On Wed, 2016-02-10 at 17:21 +0100, Torsten Duwe wrote:
>
> > --- a/arch/powerpc/kernel/module_64.c
> > +++ b/arch/powerpc/kernel/module_64.c
> > @@ -476,17 +474,44 @@ static unsigned long stub_for_addr(Elf64_Shdr *sechdrs,
> > return (unsigned long)&stubs[i];
> > }
> >
> > +#ifdef CC_USING_MPROFILE_KERNEL
> > +static int is_early_mcount_callsite(u32 *instruction)
> > +{
> > + /* -mprofile-kernel sequence starting with
> > + * mflr r0 and maybe std r0, LRSAVE(r1).
> > + */
> > + if ((instruction[-3] == PPC_INST_MFLR &&
> > + instruction[-2] == PPC_INST_STD_LR) ||
> > + instruction[-2] == PPC_INST_MFLR) {
> > + /* Nothing to be done here, it's an _mcount
> > + * call location and r2 will have to be
> > + * restored in the _mcount function.
> > + */
> > + return 1;
> > + }
> > + return 0;
> > +}
>
> On a kernel built with the 2 instruction version this will fault when the
> function we're looking at is located at the beginning of a page. Because
> instruction[-3] goes off the front of the mapping.
>
> We can probably fix that. But it's still a bit dicey.
Not necessarily. Now that it's a separate function, it can be nested a bit deeper,
so we don't take chances on compiler optimisation:
if (instruction[-2] == PPC_INST_STD_LR) /* where should R0 come from? there must be... */
{
if (instruction[-3] == PPC_INST_MFLR)
return 1;
}
else if (instruction[-2] == PPC_INST_MFLR)
return 1;
return 0;
> I'm wondering if we want to just say we only support the 2 instruction version.
> Currently that means GCC 6 only, or a distro compiler with the backport of
> e95d0248dace. But we could also ask GCC to backport it to 4.9 and 5.
>
> Thoughts?
IMHO that's a too weak reason for a too strong limitation. OTOH getting everyone
to use the 2 insn version sounds appealing...
Is e95d0248dace self-sufficient or does it depend on other improvements?
Torsten
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v8 0/8] ftrace with regs + live patching for ppc64 LE (ABI v2) Torsten Duwe <duwe@lst.de> - 2016-02-10 18:50 +0100
[PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables Torsten Duwe <duwe@lst.de> - 2016-02-10 18:50 +0100
Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables Balbir Singh <bsingharora@gmail.com> - 2016-02-11 08:50 +0100
Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> - 2016-02-11 09:50 +0100
Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables Balbir Singh <bsingharora@gmail.com> - 2016-02-11 10:40 +0100
Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables Murali Sampath <MSampath@alphion.com> - 2016-02-11 14:10 +0100
Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables Murali Sampath <MSampath@alphion.com> - 2016-02-11 14:10 +0100
Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables Torsten Duwe <duwe@lst.de> - 2016-02-11 09:50 +0100
Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables Balbir Singh <bsingharora@gmail.com> - 2016-02-11 10:40 +0100
Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables Michael Ellerman <mpe@ellerman.id.au> - 2016-02-15 11:30 +0100
Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables Jiri Kosina <jikos@kernel.org> - 2016-02-15 14:00 +0100
Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables Torsten Duwe <duwe@lst.de> - 2016-02-15 15:10 +0100
Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables Torsten Duwe <duwe@lst.de> - 2016-02-15 23:30 +0100
Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables Balbir Singh <bsingharora@gmail.com> - 2016-02-16 06:00 +0100
Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables Michael Ellerman <mpe@ellerman.id.au> - 2016-02-16 11:20 +0100
Re: [PATCH v8 4/8] ppc64 ftrace_with_regs configuration variables Torsten Duwe <duwe@lst.de> - 2016-02-16 11:40 +0100
[PATCH v8 3/8] ppc use ftrace_modify_all_code default Torsten Duwe <duwe@lst.de> - 2016-02-10 18:50 +0100
[PATCH v8 1/8] ppc64 (le): prepare for -mprofile-kernel Torsten Duwe <duwe@lst.de> - 2016-02-10 18:50 +0100
Re: [PATCH v8 1/8] ppc64 (le): prepare for -mprofile-kernel Michael Ellerman <mpe@ellerman.id.au> - 2016-02-17 12:00 +0100
Re: [PATCH v8 1/8] ppc64 (le): prepare for -mprofile-kernel Michael Ellerman <mpe@ellerman.id.au> - 2016-02-17 12:40 +0100
Re: [PATCH v8 1/8] ppc64 (le): prepare for -mprofile-kernel Torsten Duwe <duwe@lst.de> - 2016-02-17 12:40 +0100
[PATCH v8 6/8] Implement kernel live patching for ppc64le (ABIv2) Torsten Duwe <duwe@lst.de> - 2016-02-10 18:50 +0100
Re: [PATCH v8 6/8] Implement kernel live patching for ppc64le (ABIv2) Miroslav Benes <mbenes@suse.cz> - 2016-02-11 10:10 +0100
Re: [PATCH v8 0/8] ftrace with regs + live patching for ppc64 LE (ABI v2) Balbir Singh <bsingharora@gmail.com> - 2016-02-11 07:20 +0100
Re: [PATCH v8 0/8] ftrace with regs + live patching for ppc64 LE (ABI v2) Torsten Duwe <duwe@lst.de> - 2016-02-11 09:40 +0100
csiph-web