summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/linkage.h
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2021-12-14 15:27:14 +0000
committerCatalin Marinas <catalin.marinas@arm.com>2021-12-14 18:12:58 +0000
commit742a15b1a23aa43bde2d9d681281ec1925be13fd (patch)
tree6bf39f9f07ffeebf8cac95fd921ca9b813ac6e6e /arch/arm64/include/asm/linkage.h
parent481ee45ce9e078715b4ca50fcaea518e3aee1aa7 (diff)
downloadlinux-742a15b1a23aa43bde2d9d681281ec1925be13fd.tar.bz2
arm64: Use BTI C directly and unconditionally
Now we have a macro for BTI C that looks like a regular instruction change all the users of the current BTI_C macro to just emit a BTI C directly and remove the macro. This does mean that we now unconditionally BTI annotate all assembly functions, meaning that they are worse in this respect than code generated by the compiler. The overhead should be minimal for implementations with a reasonable HINT implementation. Signed-off-by: Mark Brown <broonie@kernel.org> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Mark Rutland <mark.rutland@arm.com> Link: https://lore.kernel.org/r/20211214152714.2380849-4-broonie@kernel.org Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/linkage.h')
-rw-r--r--arch/arm64/include/asm/linkage.h22
1 files changed, 6 insertions, 16 deletions
diff --git a/arch/arm64/include/asm/linkage.h b/arch/arm64/include/asm/linkage.h
index 1cfa8bb33edd..9065e4749b42 100644
--- a/arch/arm64/include/asm/linkage.h
+++ b/arch/arm64/include/asm/linkage.h
@@ -4,16 +4,6 @@
#define __ALIGN .align 2
#define __ALIGN_STR ".align 2"
-#if defined(CONFIG_ARM64_BTI_KERNEL) && defined(__aarch64__)
-
-#define BTI_C bti c ;
-
-#else
-
-#define BTI_C
-
-#endif
-
/*
* When using in-kernel BTI we need to ensure that PCS-conformant
* assembly functions have suitable annotations. Override
@@ -23,27 +13,27 @@
*/
#define SYM_FUNC_START(name) \
SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN) \
- BTI_C
+ bti c ;
#define SYM_FUNC_START_NOALIGN(name) \
SYM_START(name, SYM_L_GLOBAL, SYM_A_NONE) \
- BTI_C
+ bti c ;
#define SYM_FUNC_START_LOCAL(name) \
SYM_START(name, SYM_L_LOCAL, SYM_A_ALIGN) \
- BTI_C
+ bti c ;
#define SYM_FUNC_START_LOCAL_NOALIGN(name) \
SYM_START(name, SYM_L_LOCAL, SYM_A_NONE) \
- BTI_C
+ bti c ;
#define SYM_FUNC_START_WEAK(name) \
SYM_START(name, SYM_L_WEAK, SYM_A_ALIGN) \
- BTI_C
+ bti c ;
#define SYM_FUNC_START_WEAK_NOALIGN(name) \
SYM_START(name, SYM_L_WEAK, SYM_A_NONE) \
- BTI_C
+ bti c ;
/*
* Annotate a function as position independent, i.e., safe to be called before