[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160225133133.GE21932@lst.de>
Date: Thu, 25 Feb 2016 14:31:33 +0100
From: Torsten Duwe <duwe@....de>
To: Balbir Singh <bsingharora@...il.com>
Cc: Michael Ellerman <mpe@...erman.id.au>, linuxppc-dev@...abs.org,
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 03/12] powerpc/module: Create a special stub for
ftrace_caller()
On Thu, Feb 25, 2016 at 11:08:54AM +1100, Balbir Singh wrote:
> 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)
To be precise: ftrace_caller needs to save _and_ restore r2 in case of -mprofile-kernel.
> > + /* Stub uses address relative to kernel_toc */
> > + reladdr = (unsigned long)ftrace_caller - get_paca()->kernel_toc;
kernel_toc is a compile time constant; do you really want to look it up in
memory at runtime each time? It's a bit tricky to get the +- 0x8000 right
OTOH...
I wrote:
extern unsigned long __toc_start;
reladdr = addr - ((unsigned long)(&__toc_start) + 0x8000UL);
looks a bit odd, but evaluates to a constant for ftrace_caller.
Either way is fine with me:
Signed-off-by: Torsten Duwe <duwe@...e.de>
Reviewed-by: Torsten Duwe <duwe@...e.de>
> Reviewed-by: Balbir Singh <bsingharora@...il.com>
Torsten
Powered by blists - more mailing lists