Message ID | 20200325114110.23491-2-broonie@kernel.org |
---|---|
State | New |
Headers | show |
Series | [1/3] arm64: asm: Provide macro to control enabling architecture extensions | expand |
diff --git a/arch/arm64/include/asm/linkage.h b/arch/arm64/include/asm/linkage.h index ebee3113a62f..e5856c75720b 100644 --- a/arch/arm64/include/asm/linkage.h +++ b/arch/arm64/include/asm/linkage.h @@ -20,4 +20,10 @@ SYM_FUNC_END(x); \ SYM_FUNC_END_ALIAS(__pi_##x) +/* + * Enable additional architecture extensions (eg, for optimized asm + * routines). + */ +#define ARM64_EXTENSIONS(x) .arch armv8-a+x + #endif
Currently several assembler files override the default architecture to enable extensions in order to allow them to implement optimised routines for systems with those extensions. Since inserting BTI landing pads into assembler functions will require us to change the default architecture we need a way to enable extensions without hard coding the architecture. The assembler has the .arch_extension feature but this was introduced for arm64 in gas 2.26 which is too modern for us to rely on it. We could just update the base architecture used by these assembler files but this would mean the assembler would no longer catch attempts to use newer instructions so instead introduce a macro which sets the default architecture centrally. Doing this will also make our use of .arch and .cpu to select the base architecture more consistent. Signed-off-by: Mark Brown <broonie@kernel.org> --- arch/arm64/include/asm/linkage.h | 6 ++++++ 1 file changed, 6 insertions(+)