mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-09-21 11:53:01 +00:00
MIPS: mcount: Adjust stack pointer for static trace in MIPS32
commit 8a574cfa2652545eb95595d38ac2a0bb501af0ae upstream. Every mcount() call in the MIPS 32-bit kernel is done as follows: [...] move at, ra jal _mcount addiu sp, sp, -8 [...] but upon returning from the mcount() function, the stack pointer is not adjusted properly. This is explained in details in58b69401c7
(MIPS: Function tracer: Fix broken function tracing). Commitad8c396936
("MIPS: Unbreak function tracer for 64-bit kernel.) fixed the stack manipulation for 64-bit but it didn't fix it completely for MIPS32. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/7792/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
eee78f74dc
commit
f7feecd70f
|
@ -123,7 +123,11 @@ NESTED(_mcount, PT_SIZE, ra)
|
||||||
nop
|
nop
|
||||||
#endif
|
#endif
|
||||||
b ftrace_stub
|
b ftrace_stub
|
||||||
|
#ifdef CONFIG_32BIT
|
||||||
|
addiu sp, sp, 8
|
||||||
|
#else
|
||||||
nop
|
nop
|
||||||
|
#endif
|
||||||
|
|
||||||
static_trace:
|
static_trace:
|
||||||
MCOUNT_SAVE_REGS
|
MCOUNT_SAVE_REGS
|
||||||
|
@ -133,6 +137,9 @@ static_trace:
|
||||||
move a1, AT /* arg2: parent's return address */
|
move a1, AT /* arg2: parent's return address */
|
||||||
|
|
||||||
MCOUNT_RESTORE_REGS
|
MCOUNT_RESTORE_REGS
|
||||||
|
#ifdef CONFIG_32BIT
|
||||||
|
addiu sp, sp, 8
|
||||||
|
#endif
|
||||||
.globl ftrace_stub
|
.globl ftrace_stub
|
||||||
ftrace_stub:
|
ftrace_stub:
|
||||||
RETURN_BACK
|
RETURN_BACK
|
||||||
|
@ -181,6 +188,11 @@ NESTED(ftrace_graph_caller, PT_SIZE, ra)
|
||||||
jal prepare_ftrace_return
|
jal prepare_ftrace_return
|
||||||
nop
|
nop
|
||||||
MCOUNT_RESTORE_REGS
|
MCOUNT_RESTORE_REGS
|
||||||
|
#ifndef CONFIG_DYNAMIC_FTRACE
|
||||||
|
#ifdef CONFIG_32BIT
|
||||||
|
addiu sp, sp, 8
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
RETURN_BACK
|
RETURN_BACK
|
||||||
END(ftrace_graph_caller)
|
END(ftrace_graph_caller)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue