summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/fpsimd.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2023-01-16 16:04:43 +0000
committerCatalin Marinas <catalin.marinas@arm.com>2023-01-20 12:23:06 +0000
commitd4913eee152d3ffaf9a1e70073bc15e773625685 (patch)
tree102888dc7da934eaa3a3ef32a2e3a8b02a038a51 /arch/arm64/kernel/fpsimd.c
parentf122576f35336820259a79847e408b9f807eba15 (diff)
downloadlinux-d4913eee152d3ffaf9a1e70073bc15e773625685.tar.gz
linux-d4913eee152d3ffaf9a1e70073bc15e773625685.tar.bz2
linux-d4913eee152d3ffaf9a1e70073bc15e773625685.zip
arm64/sme: Add basic enumeration for SME2
Add basic feature detection for SME2, detecting that the feature is present and disabling traps for ZT0. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20221208-arm64-sme2-v4-8-f2fa0aef982f@kernel.org Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kernel/fpsimd.c')
-rw-r--r--arch/arm64/kernel/fpsimd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 9e168a9eb615..717ae4aaa021 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -1302,6 +1302,17 @@ void sme_kernel_enable(const struct arm64_cpu_capabilities *__always_unused p)
* This must be called after sme_kernel_enable(), we rely on the
* feature table being sorted to ensure this.
*/
+void sme2_kernel_enable(const struct arm64_cpu_capabilities *__always_unused p)
+{
+ /* Allow use of ZT0 */
+ write_sysreg_s(read_sysreg_s(SYS_SMCR_EL1) | SMCR_ELx_EZT0_MASK,
+ SYS_SMCR_EL1);
+}
+
+/*
+ * This must be called after sme_kernel_enable(), we rely on the
+ * feature table being sorted to ensure this.
+ */
void fa64_kernel_enable(const struct arm64_cpu_capabilities *__always_unused p)
{
/* Allow use of FA64 */