]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
arm64/fpsimd: Sync FPSIMD state with SVE for SME only systems
authorMark Brown <broonie@kernel.org>
Thu, 3 Aug 2023 18:33:22 +0000 (19:33 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 30 Oct 2023 10:59:57 +0000 (11:59 +0100)
BugLink: https://bugs.launchpad.net/bugs/2038236
commit 507ea5dd92d23fcf10e4d1a68a443c86a49753ed upstream.

Currently we guard FPSIMD/SVE state conversions with a check for the system
supporting SVE but SME only systems may need to sync streaming mode SVE
state so add a check for SME support too.  These functions are only used
by the ptrace code.

Fixes: e12310a0d30f ("arm64/sme: Implement ptrace support for streaming mode SVE registers")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-ssve-no-sve-v1-2-49df214bfb3e@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/arm64/kernel/fpsimd.c

index 8cf65d3ad177616bf49f6401a17f1f84db71ef66..8c64fe7d3c9a9c3540906ca82d8014004a0bfb38 100644 (file)
@@ -677,7 +677,7 @@ static void fpsimd_to_sve(struct task_struct *task)
        void *sst = task->thread.sve_state;
        struct user_fpsimd_state const *fst = &task->thread.uw.fpsimd_state;
 
-       if (!system_supports_sve())
+       if (!system_supports_sve() && !system_supports_sme())
                return;
 
        vq = sve_vq_from_vl(thread_get_cur_vl(&task->thread));
@@ -703,7 +703,7 @@ static void sve_to_fpsimd(struct task_struct *task)
        unsigned int i;
        __uint128_t const *p;
 
-       if (!system_supports_sve())
+       if (!system_supports_sve() && !system_supports_sme())
                return;
 
        vl = thread_get_cur_vl(&task->thread);