[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1456382638.30375.4.camel@ellerman.id.au>
Date: Thu, 25 Feb 2016 17:43:58 +1100
From: Michael Ellerman <mpe@...erman.id.au>
To: Balbir Singh <bsingharora@...il.com>, linuxppc-dev@...abs.org
Cc: duwe@....de, linux-kernel@...r.kernel.org, rostedt@...dmis.org,
kamalesh@...ux.vnet.ibm.com, pmladek@...e.com, jeyu@...hat.com,
jkosina@...e.cz, live-patching@...r.kernel.org, mbenes@...e.cz
Subject: Re: [PATCH 02/12] powerpc/module: Mark module stubs with a magic
value
On Thu, 2016-02-25 at 11:04 +1100, Balbir Singh wrote:
>
> On 25/02/16 01:28, Michael Ellerman wrote:
> > -bool is_module_trampoline(u32 *p)
> > +int module_trampoline_target(struct module *mod, unsigned long addr,
> > + unsigned long *target)
> > {
> > - unsigned int i;
> > - u32 insns[ARRAY_SIZE(ppc64_stub_insns)];
> > -
> > - BUILD_BUG_ON(sizeof(ppc64_stub_insns) != sizeof(ppc64_stub_mask));
> > + struct ppc64_stub_entry *stub;
> > + func_desc_t funcdata;
> > + u32 magic;
> >
> > - if (probe_kernel_read(insns, p, sizeof(insns)))
> > + if (!within_module_core(addr, mod)) {
> > + pr_err("%s: stub %lx not in module %s\n", __func__, addr, mod->name);
> > return -EFAULT;
> -EFAULT or -EINVAL?
I think we want EFAULT. Otherwise ftrace_bug() will try and print the actual
instruction, which would then fault. (though I haven't confirmed that by
testing)
> I wonder if we can recover from a bad trampoline address.
We can't recover at the moment. Do you mean is there some way we could recover?
cheers
Powered by blists - more mailing lists