summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/linkage.h
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2021-12-14 15:27:13 +0000
committerCatalin Marinas <catalin.marinas@arm.com>2021-12-14 18:12:58 +0000
commit481ee45ce9e078715b4ca50fcaea518e3aee1aa7 (patch)
tree2e3e5d08719f3bd92b5baa38d9c91c690e48acf2 /arch/arm64/include/asm/linkage.h
parent9be34be87cc8d1afe3c3bc2e645b4dee512d9eda (diff)
arm64: Unconditionally override SYM_FUNC macros
Currently we only override the SYM_FUNC macros when we need to insert BTI C into them, do this unconditionally to make it more likely that we'll notice bugs in our override. Suggested-by: Mark Rutland <mark.rutland@arm.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org> Acked-by: Mark Rutland <mark.rutland@arm.com> Link: https://lore.kernel.org/r/20211214152714.2380849-3-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.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/arm64/include/asm/linkage.h b/arch/arm64/include/asm/linkage.h
index c5d0c11d7709..1cfa8bb33edd 100644
--- a/arch/arm64/include/asm/linkage.h
+++ b/arch/arm64/include/asm/linkage.h
@@ -8,10 +8,18 @@
#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 SYM_FUNC_START to insert
- * a BTI landing pad at the start of everything.
+ * When using in-kernel BTI we need to ensure that PCS-conformant
+ * assembly functions have suitable annotations. Override
+ * SYM_FUNC_START to insert a BTI landing pad at the start of
+ * everything, the override is done unconditionally so we're more
+ * likely to notice any drift from the overridden definitions.
*/
#define SYM_FUNC_START(name) \
SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN) \
@@ -37,8 +45,6 @@
SYM_START(name, SYM_L_WEAK, SYM_A_NONE) \
BTI_C
-#endif
-
/*
* Annotate a function as position independent, i.e., safe to be called before
* the kernel virtual mapping is activated.