forked from Minki/linux
powerpc64/ftrace: use PACA to retrieve TOC in mod_return_to_handler
The mod_return_to_handler needs to switch to the kernel TOC before jumping to a the kernel code. It currently does this by looking at the kernel function data and retrieves the TOC that way. Not only is this inefficient, it also breaks with a relocatable kernel. The PACA contains the kernel TOC and we can easily retrieve it that way. Reported-by: Sachin Sant <sachinp@in.ibm.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
parent
9135c3cc5a
commit
be10ab1090
@ -1038,8 +1038,7 @@ _GLOBAL(mod_return_to_handler)
|
|||||||
* We are in a module using the module's TOC.
|
* We are in a module using the module's TOC.
|
||||||
* Switch to our TOC to run inside the core kernel.
|
* Switch to our TOC to run inside the core kernel.
|
||||||
*/
|
*/
|
||||||
LOAD_REG_IMMEDIATE(r4,ftrace_return_to_handler)
|
ld r2, PACATOC(r13)
|
||||||
ld r2, 8(r4)
|
|
||||||
|
|
||||||
bl .ftrace_return_to_handler
|
bl .ftrace_return_to_handler
|
||||||
nop
|
nop
|
||||||
|
Loading…
Reference in New Issue
Block a user