arm64/signal: Don't assume that TIF_SVE means we saved SVE state
[linux-2.6-microblaze.git] / arch / arm64 / kernel / signal.c
index 0e8beb3..425b1bc 100644 (file)
@@ -242,7 +242,7 @@ static int preserve_sve_context(struct sve_context __user *ctx)
                vl = task_get_sme_vl(current);
                vq = sve_vq_from_vl(vl);
                flags |= SVE_SIG_FLAG_SM;
-       } else if (test_thread_flag(TIF_SVE)) {
+       } else if (current->thread.fp_type == FP_STATE_SVE) {
                vq = sve_vq_from_vl(vl);
        }
 
@@ -878,7 +878,7 @@ static int setup_sigframe_layout(struct rt_sigframe_user_layout *user,
        if (system_supports_sve() || system_supports_sme()) {
                unsigned int vq = 0;
 
-               if (add_all || test_thread_flag(TIF_SVE) ||
+               if (add_all || current->thread.fp_type == FP_STATE_SVE ||
                    thread_sm_enabled(&current->thread)) {
                        int vl = max(sve_max_vl(), sme_max_vl());