diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2024-05-02 09:13:24 +0200 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-05-07 11:30:24 +0200 |
commit | 7b749aad1faa5bcb23b45b7126f677ab17324c40 (patch) | |
tree | 7d21e5dc3cbd404c82c83434835850a0e2c8d7c1 /arch/arm/mm/cache-v4wt.S | |
parent | ARM: 9392/2: Support CLANG CFI (diff) | |
download | linux-7b749aad1faa5bcb23b45b7126f677ab17324c40.tar.xz linux-7b749aad1faa5bcb23b45b7126f677ab17324c40.zip |
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>
Diffstat (limited to 'arch/arm/mm/cache-v4wt.S')
-rw-r--r-- | arch/arm/mm/cache-v4wt.S | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/mm/cache-v4wt.S b/arch/arm/mm/cache-v4wt.S index 43b4275ab680..a97dc267b3b0 100644 --- a/arch/arm/mm/cache-v4wt.S +++ b/arch/arm/mm/cache-v4wt.S @@ -108,7 +108,9 @@ SYM_FUNC_END(v4wt_flush_user_cache_range) * - end - virtual end address */ SYM_TYPED_FUNC_START(v4wt_coherent_kern_range) +#ifdef CONFIG_CFI_CLANG /* Fallthrough if !CFI */ b v4wt_coherent_user_range +#endif SYM_FUNC_END(v4wt_coherent_kern_range) /* |