All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: Don't allow SVE to be used with BROKEN_GAS_INST
@ 2022-02-25 18:40 Mark Brown
  2022-03-02 13:58 ` Catalin Marinas
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2022-02-25 18:40 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon; +Cc: linux-arm-kernel, Mark Rutland, Mark Brown

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@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
 	help
 	  The Scalable Vector Extension (SVE) is an extension to the AArch64
 	  execution state which complements and extends the SIMD functionality
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: Don't allow SVE to be used with BROKEN_GAS_INST
  2022-02-25 18:40 [PATCH] arm64: Don't allow SVE to be used with BROKEN_GAS_INST Mark Brown
@ 2022-03-02 13:58 ` Catalin Marinas
  2022-03-02 16:04   ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Catalin Marinas @ 2022-03-02 13:58 UTC (permalink / raw)
  To: Mark Brown; +Cc: Will Deacon, linux-arm-kernel, Mark Rutland

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@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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: Don't allow SVE to be used with BROKEN_GAS_INST
  2022-03-02 13:58 ` Catalin Marinas
@ 2022-03-02 16:04   ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2022-03-02 16:04 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: Will Deacon, linux-arm-kernel, Mark Rutland


[-- Attachment #1.1: Type: text/plain, Size: 739 bytes --]

On Wed, Mar 02, 2022 at 01:58:13PM +0000, Catalin Marinas wrote:

> 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?

TBH given the indeterminate existance of a userbase I'm not sure it's
even worth it - they're for v8.2 instructions and there's arguments
being encoded in there so I'd be more inclined to do the same as SVE and
shove some dependencies in there for now rather than make those macros
even longer.  I'd be astonished if there were anyone using a toolchain
old enough to have the issue with hardware new enough to be impacted,
the fact that we didn't hear about it thus far suggests that there isn't.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-02 16:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-25 18:40 [PATCH] arm64: Don't allow SVE to be used with BROKEN_GAS_INST Mark Brown
2022-03-02 13:58 ` Catalin Marinas
2022-03-02 16:04   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.