Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Steven Rostedt and committed by
Steven Rostedt
be10ab10 9135c3cc

+1 -2
+1 -2
arch/powerpc/kernel/entry_64.S
··· 1038 1038 * We are in a module using the module's TOC. 1039 1039 * Switch to our TOC to run inside the core kernel. 1040 1040 */ 1041 - LOAD_REG_IMMEDIATE(r4,ftrace_return_to_handler) 1042 - ld r2, 8(r4) 1041 + ld r2, PACATOC(r13) 1043 1042 1044 1043 bl .ftrace_return_to_handler 1045 1044 nop