ARM: assembler: introduce bl_r macro
authorArd Biesheuvel <ardb@kernel.org>
Tue, 5 Oct 2021 07:15:35 +0000 (09:15 +0200)
committerArd Biesheuvel <ardb@kernel.org>
Fri, 3 Dec 2021 14:11:31 +0000 (15:11 +0100)
commitb3ab60b1794c20fe7033d2c8f7dcdef87ada1a23
tree8095c4e134c96662cd2933e19dd0b92f3a919e80
parent08572cd41955166e387d9b4984294d37f8f7526c
ARM: assembler: introduce bl_r macro

Add a bl_r macro that abstract the difference between the ways indirect
calls are performed on older and newer ARM architecture revisions.

The main difference is to prefer blx instructions over explicit LR
assignments when possible, as these tend to confuse the prediction logic
in out-of-order cores when speculating across a function return.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Keith Packard <keithpac@amazon.com>
Tested-by: Marc Zyngier <maz@kernel.org>
Tested-by: Vladimir Murzin <vladimir.murzin@arm.com> # ARMv7M
arch/arm/include/asm/assembler.h