[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191104135540.GH45140@lakrids.cambridge.arm.com>
Date: Mon, 4 Nov 2019 13:55:40 +0000
From: Mark Rutland <mark.rutland@....com>
To: Amit Daniel Kachhap <amit.kachhap@....com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
catalin.marinas@....com, deller@....de, duwe@...e.de,
James.Bottomley@...senPartnership.com, james.morse@....com,
jeyu@...nel.org, jpoimboe@...hat.com, jthierry@...hat.com,
linux-parisc@...r.kernel.org, mingo@...hat.com,
peterz@...radead.org, rostedt@...dmis.org, svens@...ckframe.org,
takahiro.akashi@...aro.org, will@...nel.org
Subject: Re: [PATCHv2 4/8] arm64: module/ftrace: intialize PLT at load time
On Sat, Nov 02, 2019 at 05:50:02PM +0530, Amit Daniel Kachhap wrote:
> On 10/29/19 10:28 PM, Mark Rutland wrote:
> > @@ -485,24 +486,33 @@ static const Elf_Shdr *find_section(const Elf_Ehdr *hdr,
> > return NULL;
> > }
> > +int module_init_ftrace_plt(const Elf_Ehdr *hdr,
> > + const Elf_Shdr *sechdrs,
> > + struct module *mod)
> I think this function can be made static as it is not used anywhere.
It's only called by module_finalize() below, so making it static makese
sense; done.
Thanks
Mark.
> > +{
> > +#if defined(CONFIG_ARM64_MODULE_PLTS) && defined(CONFIG_DYNAMIC_FTRACE)
> > + const Elf_Shdr *s;
> > + struct plt_entry *plt;
> > +
> > + s = find_section(hdr, sechdrs, ".text.ftrace_trampoline");
> > + if (!s)
> > + return -ENOEXEC;
> > +
> > + plt = (void *)s->sh_addr;
> > + *plt = get_plt_entry(FTRACE_ADDR, plt);
> > + mod->arch.ftrace_trampoline = plt;
> > +#endif
> > + return 0;
> > +}
> > +
> > int module_finalize(const Elf_Ehdr *hdr,
> > const Elf_Shdr *sechdrs,
> > struct module *me)
> > {
> > const Elf_Shdr *s;
> > -
> > s = find_section(hdr, sechdrs, ".altinstructions");
> > if (s)
> > apply_alternatives_module((void *)s->sh_addr, s->sh_size);
> > -#ifdef CONFIG_ARM64_MODULE_PLTS
> > - if (IS_ENABLED(CONFIG_DYNAMIC_FTRACE)) {
> > - s = find_section(hdr, sechdrs, ".text.ftrace_trampoline");
> > - if (!s)
> > - return -ENOEXEC;
> > - me->arch.ftrace_trampoline = (void *)s->sh_addr;
> > - }
> > -#endif
> > -
> > - return 0;
> > + return module_init_ftrace_plt(hdr, sechdrs, me);
> > }
> >
Powered by blists - more mailing lists