ARM: 9393/1: mm: Use conditionals for CFI branches
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 2 May 2024 07:13:24 +0000 (08:13 +0100)
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 7 May 2024 09:30:24 +0000 (10:30 +0100)
commit7b749aad1faa5bcb23b45b7126f677ab17324c40
tree7d21e5dc3cbd404c82c83434835850a0e2c8d7c1
parent1a4fec49efe5273eb2fcf575175a117745f76f97
ARM: 9393/1: mm: Use conditionals for CFI branches

Commit 9385/2 introduced a few branches inside function
prototypes when using CFI in order to deal with the situation
where CFI inserts a few bytes of function information in front
of the symbol.

This is not good for older CPUs where every cycle counts.

Commit 9386/2 alleviated the situation a bit by using aliases
for the cache functions with identical signatures.

This leaves the coherent cache flush functions
*_coherent_kern_range() with these branches to the corresponing
*_coherent_user_range() around, since their return type differ and
they therefore cannot be aliased.

Solve this by a simple ifdef so at least we can use fallthroughs
when compiling without CFI enabled.

Link: https://lore.kernel.org/linux-arm-kernel/Zi+e9M%2Ff5b%2FSto9H@shell.armlinux.org.uk/
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
20 files changed:
arch/arm/mm/cache-fa.S
arch/arm/mm/cache-v4.S
arch/arm/mm/cache-v4wb.S
arch/arm/mm/cache-v4wt.S
arch/arm/mm/cache-v6.S
arch/arm/mm/cache-v7.S
arch/arm/mm/cache-v7m.S
arch/arm/mm/proc-arm1020.S
arch/arm/mm/proc-arm1020e.S
arch/arm/mm/proc-arm1022.S
arch/arm/mm/proc-arm1026.S
arch/arm/mm/proc-arm920.S
arch/arm/mm/proc-arm922.S
arch/arm/mm/proc-arm925.S
arch/arm/mm/proc-arm926.S
arch/arm/mm/proc-arm940.S
arch/arm/mm/proc-arm946.S
arch/arm/mm/proc-feroceon.S
arch/arm/mm/proc-mohawk.S
arch/arm/mm/proc-xsc3.S