Merge patch series "riscv: Introduce compat-mode helpers & improve arch_get_mmap_end()"
[linux-2.6-microblaze.git] / arch / riscv / kernel / ptrace.c
index f362832..92731ff 100644 (file)
@@ -99,8 +99,11 @@ static int riscv_vr_get(struct task_struct *target,
         * Ensure the vector registers have been saved to the memory before
         * copying them to membuf.
         */
-       if (target == current)
-               riscv_v_vstate_save(current, task_pt_regs(current));
+       if (target == current) {
+               get_cpu_vector_context();
+               riscv_v_vstate_save(&current->thread.vstate, task_pt_regs(current));
+               put_cpu_vector_context();
+       }
 
        ptrace_vstate.vstart = vstate->vstart;
        ptrace_vstate.vl = vstate->vl;