]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit1f93c77f4eade34d72b2b90c26522bb7500bac22
tree8095c4e134c96662cd2933e19dd0b92f3a919e80
parent85c2346b539a6d4c8218051f58bbe40638b9b542
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