Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1343104
| From | Michael Ellerman <mpe@ellerman.id.au> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 03/12] powerpc/module: Create a special stub for ftrace_caller() |
| Date | 2016-02-25 11:50 +0100 |
| Message-ID | <r61EC-2xk-13@gated-at.bofh.it> (permalink) |
| References | <r5IBX-5Pl-7@gated-at.bofh.it> <r5ILE-5T6-37@gated-at.bofh.it> <r5RFg-3Xk-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, 2016-02-25 at 11:08 +1100, Balbir Singh wrote:
>
> On 25/02/16 01:28, Michael Ellerman wrote:
> > In order to support the new -mprofile-kernel ABI, we need to be able to
> > call from the module back to ftrace_caller() (in the kernel) without
> > using the module's r2. That is because the function in this module which
> > is calling ftrace_caller() may not have setup r2, if it doesn't
> > otherwise need it (ie. it accesses no globals).
> >
> > To make that work we add a new stub which is used for calling
> > ftrace_caller(), which uses the kernel toc instead of the module toc.
> >
> > diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c
> > index 9629966e614b..e711d40a3b8f 100644
> > --- a/arch/powerpc/kernel/module_64.c
> > +++ b/arch/powerpc/kernel/module_64.c
> > @@ -671,10 +671,56 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
> > }
> >
> > #ifdef CONFIG_DYNAMIC_FTRACE
> > +
> > +#define PACATOC offsetof(struct paca_struct, kernel_toc)
> > +
> > +static unsigned long create_ftrace_stub(const Elf64_Shdr *sechdrs, struct module *me)
> > +{
> > + struct ppc64_stub_entry *entry;
> > + unsigned int i, num_stubs;
> How about some comments on r2
> r2 is still pointing to the module's toc, will be saved by ftrace_caller and
> restored by the instruction following bl ftrace_caller (after patching
> _mcount/nop)
Yeah I'll add some commentary.
I think the change log describes it fairly well but a comment is also good.
cheers
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 01/12] powerpc/module: Only try to generate the ftrace_caller() stub once Michael Ellerman <mpe@ellerman.id.au> - 2016-02-24 15:30 +0100
[PATCH 02/12] powerpc/module: Mark module stubs with a magic value Michael Ellerman <mpe@ellerman.id.au> - 2016-02-24 15:40 +0100
Re: [PATCH 02/12] powerpc/module: Mark module stubs with a magic value Balbir Singh <bsingharora@gmail.com> - 2016-02-25 01:10 +0100
Re: [PATCH 02/12] powerpc/module: Mark module stubs with a magic value Michael Ellerman <mpe@ellerman.id.au> - 2016-02-25 07:50 +0100
Re: [PATCH 02/12] powerpc/module: Mark module stubs with a magic value Torsten Duwe <duwe@lst.de> - 2016-02-25 14:20 +0100
Re: [PATCH 02/12] powerpc/module: Mark module stubs with a magic value Michael Ellerman <mpe@ellerman.id.au> - 2016-02-26 11:40 +0100
[PATCH 06/12] powerpc/module: Rework is_early_mcount_callsite() Michael Ellerman <mpe@ellerman.id.au> - 2016-02-24 15:40 +0100
Re: [PATCH 06/12] powerpc/module: Rework is_early_mcount_callsite() Balbir Singh <bsingharora@gmail.com> - 2016-02-25 00:40 +0100
Re: [PATCH 06/12] powerpc/module: Rework is_early_mcount_callsite() Michael Ellerman <mpe@ellerman.id.au> - 2016-02-25 11:30 +0100
Re: [PATCH 06/12] powerpc/module: Rework is_early_mcount_callsite() Torsten Duwe <duwe@lst.de> - 2016-02-25 15:10 +0100
[PATCH 05/12] powerpc/ftrace: ftrace_graph_caller() needs to save/restore toc Michael Ellerman <mpe@ellerman.id.au> - 2016-02-24 15:40 +0100
Re: [PATCH 05/12] powerpc/ftrace: ftrace_graph_caller() needs to save/restore toc Balbir Singh <bsingharora@gmail.com> - 2016-02-25 01:40 +0100
Re: [PATCH 05/12] powerpc/ftrace: ftrace_graph_caller() needs to save/restore toc Michael Ellerman <mpe@ellerman.id.au> - 2016-02-25 11:50 +0100
Re: [PATCH 05/12] powerpc/ftrace: ftrace_graph_caller() needs to save/restore toc Torsten Duwe <duwe@lst.de> - 2016-02-25 15:10 +0100
[PATCH 10/12] powerpc/ftrace: FTRACE_WITH_REGS configuration variables Michael Ellerman <mpe@ellerman.id.au> - 2016-02-24 15:40 +0100
Re: [PATCH 10/12] powerpc/ftrace: FTRACE_WITH_REGS configuration variables Balbir Singh <bsingharora@gmail.com> - 2016-02-25 02:20 +0100
Re: [PATCH 10/12] powerpc/ftrace: FTRACE_WITH_REGS configuration variables Torsten Duwe <duwe@lst.de> - 2016-02-25 15:40 +0100
[PATCH 07/12] powerpc/ftrace: FTRACE_WITH_REGS implementation for ppc64le Michael Ellerman <mpe@ellerman.id.au> - 2016-02-24 15:40 +0100
Re: [PATCH 07/12] powerpc/ftrace: FTRACE_WITH_REGS implementation for ppc64le Balbir Singh <bsingharora@gmail.com> - 2016-02-25 01:50 +0100
Re: [PATCH 07/12] powerpc/ftrace: FTRACE_WITH_REGS implementation for ppc64le Torsten Duwe <duwe@lst.de> - 2016-02-25 16:20 +0100
Re: [PATCH 07/12] powerpc/ftrace: FTRACE_WITH_REGS implementation for ppc64le Michael Ellerman <mpe@ellerman.id.au> - 2016-02-26 11:20 +0100
[PATCH 09/12] powerpc/ftrace: Use generic ftrace_modify_all_code() Michael Ellerman <mpe@ellerman.id.au> - 2016-02-24 15:40 +0100
Re: [PATCH 09/12] powerpc/ftrace: Use generic ftrace_modify_all_code() Balbir Singh <bsingharora@gmail.com> - 2016-02-25 02:20 +0100
[PATCH 03/12] powerpc/module: Create a special stub for ftrace_caller() Michael Ellerman <mpe@ellerman.id.au> - 2016-02-24 15:40 +0100
Re: [PATCH 03/12] powerpc/module: Create a special stub for ftrace_caller() Balbir Singh <bsingharora@gmail.com> - 2016-02-25 01:10 +0100
Re: [PATCH 03/12] powerpc/module: Create a special stub for ftrace_caller() Michael Ellerman <mpe@ellerman.id.au> - 2016-02-25 11:50 +0100
Re: [PATCH 03/12] powerpc/module: Create a special stub for ftrace_caller() Torsten Duwe <duwe@lst.de> - 2016-02-25 14:40 +0100
Re: [PATCH 03/12] powerpc/module: Create a special stub for ftrace_caller() Michael Ellerman <mpe@ellerman.id.au> - 2016-02-26 11:40 +0100
Re: [PATCH 01/12] powerpc/module: Only try to generate the ftrace_caller() stub once Balbir Singh <bsingharora@gmail.com> - 2016-02-25 01:00 +0100
Re: [PATCH 01/12] powerpc/module: Only try to generate the ftrace_caller() stub once Balbir Singh <bsingharora@gmail.com> - 2016-02-25 05:40 +0100
Re: [PATCH 01/12] powerpc/module: Only try to generate the ftrace_caller() stub once Torsten Duwe <duwe@lst.de> - 2016-02-25 14:10 +0100
Re: [PATCH 01/12] powerpc/module: Only try to generate the ftrace_caller() stub once Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> - 2016-02-25 15:40 +0100
csiph-web