]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:58:31 +0000 (11:58 +0200)
commit5fa01ddccf0339e13f8af71c11d750cc79a8dab4
tree901b88a55311c30839268510aadd68ad9865d4d6
parentff0d3e731fe2940d57518ae78cc5c90cdb7e1341
ARM: ftrace: avoid redundant loads or clobbering IP

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit d11967870815b5ab89843980e35aab616c97c463 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 330de92eb10f77e45d8c93804c931ffe0fff4b78)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/arm/kernel/entry-ftrace.S