]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: ftrace: avoid redundant loads or clobbering IP
authorArd Biesheuvel <ardb@kernel.org>
Sun, 23 Jan 2022 19:18:33 +0000 (20:18 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Wed, 9 Feb 2022 08:12:32 +0000 (09:12 +0100)
commit52b0b6aa6514ba61fd2a6243dd8d620251e5a7f6
tree9056da31edd06e1ed96221417fdb49fb16a0a0ea
parent48aaa15747bb7c34a7d0c44b9508903cbdf82bb3
ARM: ftrace: avoid redundant loads or clobbering IP

Tweak the ftrace return paths to avoid redundant loads of SP, as well as
unnecessary clobbering of IP.

This also fixes the inconsistency of using MOV to perform a function
return, which is sub-optimal on recent micro-architectures but more
importantly, does not perform an interworking return, unlike compiler
generated function returns in Thumb2 builds.

Let's fix this by popping PC from the stack like most ordinary code
does.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
arch/arm/kernel/entry-ftrace.S