diff mbox series

[v14,27/39] arm64/sme: Provide Kconfig for SME

Message ID 20220419112247.711548-28-broonie@kernel.org (mailing list archive)
State Accepted
Commit a1f4ccd25cc256255813f584f10e5527369d4a02
Headers show
Series arm64/sme: Initial support for the Scalable Matrix Extension | expand

Commit Message

Mark Brown April 19, 2022, 11:22 a.m. UTC
Now that basline support for the Scalable Matrix Extension (SME) is present
introduce the Kconfig option allowing it to be built. While the feature
registers don't impose a strong requirement for a system with SME to
support SVE at runtime the support for streaming mode SVE is mostly
shared with normal SVE so depend on SVE.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
---
 arch/arm64/Kconfig | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Marek Szyprowski April 26, 2022, 10:14 p.m. UTC | #1
Hi Mark,

On 19.04.2022 13:22, Mark Brown wrote:
> Now that basline support for the Scalable Matrix Extension (SME) is present
> introduce the Kconfig option allowing it to be built. While the feature
> registers don't impose a strong requirement for a system with SME to
> support SVE at runtime the support for streaming mode SVE is mostly
> shared with normal SVE so depend on SVE.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>

This patchset landed in linux next-20220426. By default SME is enabled 
and it breaks CPU hot-plug on all my arm64 test systems. Bisect points 
this patch, because it finally enables this feature. Here is a report 
from QEMU's arm64 virt machine:

# for i in /sys/devices/system/cpu/cpu[1-9]; do echo 0 >$i/online; done
psci: CPU1 killed (polled 0 ms)
# cat /proc/cpuinfo | grep processor | wc -l
1
# for i in /sys/devices/system/cpu/cpu[1-9]; do echo 1 >$i/online; done
------------[ cut here ]------------
kernel BUG at arch/arm64/kernel/cpufeature.c:1353!
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
Modules linked in: bluetooth ecdh_generic ecc rfkill ipv6
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.18.0-rc3+ #4891
Hardware name: linux,dummy-virt (DT)
pstate: 200001c5 (nzCv dAIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __read_sysreg_by_encoding+0x350/0x354
lr : has_cpuid_feature+0x6c/0xe0
...
Call trace:
  __read_sysreg_by_encoding+0x350/0x354
  has_cpuid_feature+0x6c/0xe0
  verify_local_cpu_caps+0x98/0x130
  check_local_cpu_capabilities+0x2c/0x270
  secondary_start_kernel+0xc0/0x170
  __secondary_switched+0xa0/0xa4
Code: d53802d3 17ffff49 d5380233 17ffff47 (d4210000)
---[ end trace 0000000000000000 ]---
Kernel panic - not syncing: Attempted to kill the idle task!
SMP: stopping secondary CPUs
Kernel Offset: 0x4e81fb600000 from 0xffff800008000000
PHYS_OFFSET: 0xffff98f240000000
CPU features: 0x440,00033c08,00001086
Memory Limit: none
---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---

Disabling SME on top of next-20220426 hides this issue.

> ---
>   arch/arm64/Kconfig | 11 +++++++++++
>   1 file changed, 11 insertions(+)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 57c4c995965f..0897984918e8 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1939,6 +1939,17 @@ config ARM64_SVE
>   	  booting the kernel.  If unsure and you are not observing these
>   	  symptoms, you should assume that it is safe to say Y.
>   
> +config ARM64_SME
> +	bool "ARM Scalable Matrix Extension support"
> +	default y
> +	depends on ARM64_SVE
> +	help
> +	  The Scalable Matrix Extension (SME) is an extension to the AArch64
> +	  execution state which utilises a substantial subset of the SVE
> +	  instruction set, together with the addition of new architectural
> +	  register state capable of holding two dimensional matrix tiles to
> +	  enable various matrix operations.
> +
>   config ARM64_MODULE_PLTS
>   	bool "Use PLTs to allow module memory to spill over into vmalloc area"
>   	depends on MODULES

Best regards
Mark Brown April 27, 2022, 12:55 p.m. UTC | #2
On Wed, Apr 27, 2022 at 12:14:32AM +0200, Marek Szyprowski wrote:

> This patchset landed in linux next-20220426. By default SME is enabled 
> and it breaks CPU hot-plug on all my arm64 test systems. Bisect points 
> this patch, because it finally enables this feature. Here is a report 
> from QEMU's arm64 virt machine:

This is the cpucaps infrastructure not being able to cope with FA64
since it's in a register which is only there if the base SME feature is
there.  It works during boot because we have custom code for walking
through the registers there, and it works for the hwcaps for both SVE
and SME because at first look we don't seem to recheck them for
secondaries.
diff mbox series

Patch

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 57c4c995965f..0897984918e8 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1939,6 +1939,17 @@  config ARM64_SVE
 	  booting the kernel.  If unsure and you are not observing these
 	  symptoms, you should assume that it is safe to say Y.
 
+config ARM64_SME
+	bool "ARM Scalable Matrix Extension support"
+	default y
+	depends on ARM64_SVE
+	help
+	  The Scalable Matrix Extension (SME) is an extension to the AArch64
+	  execution state which utilises a substantial subset of the SVE
+	  instruction set, together with the addition of new architectural
+	  register state capable of holding two dimensional matrix tiles to
+	  enable various matrix operations.
+
 config ARM64_MODULE_PLTS
 	bool "Use PLTs to allow module memory to spill over into vmalloc area"
 	depends on MODULES