[PATCH] arm64: Don't allow SVE to be used with BROKEN_GAS_INST

Catalin Marinas catalin.marinas at arm.com
Wed Mar 2 05:58:13 PST 2022


On Fri, Feb 25, 2022 at 06:40:45PM +0000, Mark Brown wrote:
> We support building the kernel with archaic versions of binutils which
> had some confusion regarding how instructions should be encoded for .inst
> which we work around with the __emit_inst() macro. Unfortunately we have
> not consistently used this macro, one of the places where it's missed being
> the macros that manually encode SVE instructions. This means that kernels
> built with such toolchains have never supported SVE correctly.
> 
> Since these toolchains are very old (some idle research suggested 2015
> era) it seems more sensible to just refuse to build SVE support with them,
> in the unlikely event that someone has a need to use such a toolchain to
> build a kernel which will run on a system with SVE support they can always
> fix this properly but it seems more likely that we will deprecate support
> for these toolchains and remove __emit_inst() before that happens.
> 
> Signed-off-by: Mark Brown <broonie at kernel.org>
> ---
>  arch/arm64/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index f8e5f64fc40b..4312cc622277 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1899,6 +1899,7 @@ endmenu
>  config ARM64_SVE
>  	bool "ARM Scalable Vector Extension support"
>  	default y
> +	depends on !BROKEN_GAS_INST

It looks like it's not just SVE affected here. A grep for "\.inst\>"
shows a few places in the crypto code as well. How hard is it to use
__emit_inst() in these places?

-- 
Catalin



More information about the linux-arm-kernel mailing list