diff options
author | Mark Brown <broonie@kernel.org> | 2023-01-16 17:04:43 +0100 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2023-01-20 13:23:06 +0100 |
commit | d4913eee152d3ffaf9a1e70073bc15e773625685 (patch) | |
tree | 102888dc7da934eaa3a3ef32a2e3a8b02a038a51 /arch/arm64/kernel/fpsimd.c | |
parent | arm64/sme: Enable host kernel to access ZT0 (diff) | |
download | linux-d4913eee152d3ffaf9a1e70073bc15e773625685.tar.xz 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.c | 11 |
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 */ |