···368368 STI369369 .endm370370371371+ .macro __build_clear_msa_fpe372372+ _cfcmsa a1, MSA_CSR373373+ li a2, ~(0x3f << 12)374374+ and a1, a1, a2375375+ _ctcmsa MSA_CSR, a1376376+ TRACE_IRQS_ON377377+ STI378378+ .endm379379+371380 .macro __build_clear_ade372381 MFC0 t0, CP0_BADVADDR373382 PTR_S t0, PT_BVADDR(sp)···435426 BUILD_HANDLER cpu cpu sti silent /* #11 */436427 BUILD_HANDLER ov ov sti silent /* #12 */437428 BUILD_HANDLER tr tr sti silent /* #13 */438438- BUILD_HANDLER msa_fpe msa_fpe sti silent /* #14 */429429+ BUILD_HANDLER msa_fpe msa_fpe msa_fpe silent /* #14 */439430 BUILD_HANDLER fpe fpe fpe silent /* #15 */440431 BUILD_HANDLER ftlb ftlb none silent /* #16 */441432 BUILD_HANDLER msa msa sti silent /* #21 */
+24-6
arch/mips/kernel/ptrace.c
···4747#define CREATE_TRACE_POINTS4848#include <trace/events/syscalls.h>49495050+static void init_fp_ctx(struct task_struct *target)5151+{5252+ /* If FP has been used then the target already has context */5353+ if (tsk_used_math(target))5454+ return;5555+5656+ /* Begin with data registers set to all 1s... */5757+ memset(&target->thread.fpu.fpr, ~0, sizeof(target->thread.fpu.fpr));5858+5959+ /* ...and FCSR zeroed */6060+ target->thread.fpu.fcr31 = 0;6161+6262+ /*6363+ * Record that the target has "used" math, such that the context6464+ * just initialised, and any modifications made by the caller,6565+ * aren't discarded.6666+ */6767+ set_stopped_child_used_math(target);6868+}6969+5070/*5171 * Called by kernel/ptrace.c when detaching..5272 *···166146 if (!access_ok(VERIFY_READ, data, 33 * 8))167147 return -EIO;168148149149+ init_fp_ctx(child);169150 fregs = get_fpu_regs(child);170151171152 for (i = 0; i < 32; i++) {···466445467446 /* XXX fcr31 */468447448448+ init_fp_ctx(target);449449+469450 if (sizeof(target->thread.fpu.fpr[i]) == sizeof(elf_fpreg_t))470451 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,471452 &target->thread.fpu,···689666 case FPR_BASE ... FPR_BASE + 31: {690667 union fpureg *fregs = get_fpu_regs(child);691668692692- if (!tsk_used_math(child)) {693693- /* FP not yet used */694694- memset(&child->thread.fpu, ~0,695695- sizeof(child->thread.fpu));696696- child->thread.fpu.fcr31 = 0;697697- }669669+ init_fp_ctx(child);698670#ifdef CONFIG_32BIT699671 if (test_thread_flag(TIF_32BIT_FPREGS)) {700672 /*
+1-1
arch/mips/kernel/r4k_fpu.S
···3434 .endm35353636 .set noreorder3737- .set MIPS_ISA_ARCH_LEVEL_RAW38373938LEAF(_save_fp_context)4039 .set push···102103 /* Save 32-bit process floating point context */103104LEAF(_save_fp_context32)104105 .set push106106+ .set MIPS_ISA_ARCH_LEVEL_RAW105107 SET_HARDFLOAT106108 cfc1 t1, fcr31107109