Lines Matching full:fpu
3 * FPU register's regset abstraction, for ptrace, core dumps, etc.
8 #include <asm/fpu/api.h>
9 #include <asm/fpu/signal.h>
10 #include <asm/fpu/regset.h>
40 * owns the FPU then the memory state has to be synchronized and the
41 * FPU register state preserved. Otherwise fpstate is already in sync.
46 static void sync_fpstate(struct fpu *fpu) in sync_fpstate() argument
48 if (fpu == ¤t->thread.fpu) in sync_fpstate()
49 fpu_sync_fpstate(fpu); in sync_fpstate()
53 * Invalidate cached FPU registers before modifying the stopped target
56 * This forces the target task on resume to restore the FPU registers from
58 * with the cached FPU registers which discards the modifications.
60 static void fpu_force_restore(struct fpu *fpu) in fpu_force_restore() argument
63 * Only stopped child tasks can be used to modify the FPU in fpu_force_restore()
66 WARN_ON_FPU(fpu == ¤t->thread.fpu); in fpu_force_restore()
68 __fpu_invalidate_fpregs_state(fpu); in fpu_force_restore()
74 struct fpu *fpu = &target->thread.fpu; in xfpregs_get() local
79 sync_fpstate(fpu); in xfpregs_get()
82 return membuf_write(&to, &fpu->fpstate->regs.fxsave, in xfpregs_get()
83 sizeof(fpu->fpstate->regs.fxsave)); in xfpregs_get()
94 struct fpu *fpu = &target->thread.fpu; in xfpregs_set() local
113 fpu_force_restore(fpu); in xfpregs_set()
116 memcpy(&fpu->fpstate->regs.fxsave, &newstate, sizeof(newstate)); in xfpregs_set()
119 BUILD_BUG_ON(sizeof(fpu->__fpstate.regs.fxsave.xmm_space) != 16 * 16); in xfpregs_set()
121 memset(&fpu->fpstate->regs.fxsave.xmm_space[8*4], 0, 8 * 16); in xfpregs_set()
125 fpu->fpstate->regs.xsave.header.xfeatures |= XFEATURE_MASK_FPSSE; in xfpregs_set()
136 sync_fpstate(&target->thread.fpu); in xstateregs_get()
146 struct fpu *fpu = &target->thread.fpu; in xstateregs_set() local
170 fpu_force_restore(fpu); in xstateregs_set()
171 ret = copy_uabi_from_kernel_to_xstate(fpu->fpstate, kbuf ?: tmpbuf, &target->thread.pkru); in xstateregs_set()
190 struct fpu *fpu = &target->thread.fpu; in ssp_get() local
196 sync_fpstate(fpu); in ssp_get()
197 cetregs = get_xsave_addr(&fpu->fpstate->regs.xsave, XFEATURE_CET_USER); in ssp_get()
216 struct fpu *fpu = &target->thread.fpu; in ssp_set() local
217 struct xregs_state *xsave = &fpu->fpstate->regs.xsave; in ssp_set()
240 fpu_force_restore(fpu); in ssp_set()
261 * FPU tag word conversions.
346 * should be actually ds/cs at fpu exception time, but in __convert_from_fxsr()
370 __convert_from_fxsr(env, tsk, &tsk->thread.fpu.fpstate->regs.fxsave); in convert_from_fxsr()
403 struct fpu *fpu = &target->thread.fpu; in fpregs_get() local
407 sync_fpstate(fpu); in fpregs_get()
413 return membuf_write(&to, &fpu->fpstate->regs.fsave, in fpregs_get()
424 fx = &fpu->fpstate->regs.fxsave; in fpregs_get()
435 struct fpu *fpu = &target->thread.fpu; in fpregs_set() local
450 fpu_force_restore(fpu); in fpregs_set()
453 convert_to_fxsr(&fpu->fpstate->regs.fxsave, &env); in fpregs_set()
455 memcpy(&fpu->fpstate->regs.fsave, &env, sizeof(env)); in fpregs_set()
462 fpu->fpstate->regs.xsave.header.xfeatures |= XFEATURE_MASK_FP; in fpregs_set()