Ard Biesheuvel ad1c2f39fd ARM: ftrace: use ADD not POP to counter PUSH at entry
The compiler emitted hook used for ftrace consists of a PUSH {LR} to
preserve the link register, followed by a branch-and-link (BL) to
__gnu_mount_nc. Dynamic ftrace patches away the latter to turn the
combined sequence into a NOP, using a POP {LR} instruction.

This is not necessary, since the link register does not get clobbered in
this case, and simply adding #4 to the stack pointer is sufficient, and
avoids a memory access that may take a few cycles to resolve depending
on the micro-architecture.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2022-02-09 09:12:32 +01:00
..
2021-10-20 13:36:30 -05:00
2021-12-06 12:49:11 +01:00
2020-12-22 13:34:27 -08:00
2020-02-11 12:56:27 +01:00
2021-09-09 13:25:49 -07:00
2021-06-13 18:16:48 +01:00
2020-10-30 21:57:05 +01:00
2020-12-15 12:13:41 -08:00