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

Marek Szyprowski
2022-04-26T22:14:41Z

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
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland