Home
last modified time | relevance | path

Searched refs:fpstate (Results 1 – 25 of 34) sorted by relevance

12

/linux-6.1.9/arch/x86/kernel/fpu/
Dcore.c44 struct fpstate init_fpstate __ro_after_init;
97 if (fpu->fpstate->regs.xsave.header.xfeatures & AVX512_TRACKING_MASK) in update_avx_timestamp()
118 os_xsave(fpu->fpstate); in save_fpregs_to_fpstate()
124 fxsave(&fpu->fpstate->regs.fxsave); in save_fpregs_to_fpstate()
132 asm volatile("fnsave %[fp]; fwait" : [fp] "=m" (fpu->fpstate->regs.fsave)); in save_fpregs_to_fpstate()
133 frstor(&fpu->fpstate->regs.fsave); in save_fpregs_to_fpstate()
136 void restore_fpregs_from_fpstate(struct fpstate *fpstate, u64 mask) in restore_fpregs_from_fpstate() argument
149 : : [addr] "m" (fpstate)); in restore_fpregs_from_fpstate()
168 xfd_update_state(fpstate); in restore_fpregs_from_fpstate()
181 os_xrstor(fpstate, mask); in restore_fpregs_from_fpstate()
[all …]
Dxstate.h45 extern void __copy_xstate_to_uabi_buf(struct membuf to, struct fpstate *fpstate,
49 extern int copy_uabi_from_kernel_to_xstate(struct fpstate *fpstate, const void *kbuf, u32 *pkru);
144 extern void xfd_validate_state(struct fpstate *fpstate, u64 mask, bool rstor);
146 static inline void xfd_validate_state(struct fpstate *fpstate, u64 mask, bool rstor) { } in xfd_validate_state() argument
150 static inline void xfd_update_state(struct fpstate *fpstate) in xfd_update_state() argument
153 u64 xfd = fpstate->xfd; in xfd_update_state()
164 static inline void xfd_update_state(struct fpstate *fpstate) { } in xfd_update_state() argument
177 static inline void os_xsave(struct fpstate *fpstate) in os_xsave() argument
179 u64 mask = fpstate->xfeatures; in os_xsave()
185 xfd_validate_state(fpstate, mask, false); in os_xsave()
[all …]
Dsignal.c32 void __user *fpstate = fxbuf; in check_xstate_in_sigframe() local
41 fx_sw->xstate_size > current->thread.fpu.fpstate->user_size || in check_xstate_in_sigframe()
51 if (__get_user(magic2, (__u32 __user *)(fpstate + fx_sw->xstate_size))) in check_xstate_in_sigframe()
72 struct xregs_state *xsave = &tsk->thread.fpu.fpstate->regs.xsave; in save_fsave_header()
78 fxsave(&tsk->thread.fpu.fpstate->regs.fxsave); in save_fsave_header()
106 struct fpstate *fpstate) in save_sw_bytes() argument
109 sw_bytes->extended_size = fpstate->user_size + FP_XSTATE_MAGIC2_SIZE; in save_sw_bytes()
110 sw_bytes->xfeatures = fpstate->user_xfeatures; in save_sw_bytes()
111 sw_bytes->xstate_size = fpstate->user_size; in save_sw_bytes()
118 struct fpstate *fpstate) in save_xstate_epilog() argument
[all …]
Dxstate.c400 struct fpstate *fpstate) in validate_user_xstate_header() argument
403 if (hdr->xfeatures & ~fpstate->user_xfeatures) in validate_user_xstate_header()
918 wrmsrl(MSR_IA32_XFD, current->thread.fpu.fpstate->xfd); in fpu__resume_cpu()
1058 void __copy_xstate_to_uabi_buf(struct membuf to, struct fpstate *fpstate, in __copy_xstate_to_uabi_buf() argument
1063 struct xregs_state *xsave = &fpstate->regs.xsave; in __copy_xstate_to_uabi_buf()
1083 header.xfeatures &= fpstate->user_xfeatures; in __copy_xstate_to_uabi_buf()
1126 mask = fpstate->user_xfeatures; in __copy_xstate_to_uabi_buf()
1186 __copy_xstate_to_uabi_buf(to, tsk->thread.fpu.fpstate, in copy_xstate_to_uabi_buf()
1231 static int copy_uabi_to_xstate(struct fpstate *fpstate, const void *kbuf, in copy_uabi_to_xstate() argument
1234 struct xregs_state *xsave = &fpstate->regs.xsave; in copy_uabi_to_xstate()
[all …]
Dregset.c81 return membuf_write(&to, &fpu->fpstate->regs.fxsave, in xfpregs_get()
82 sizeof(fpu->fpstate->regs.fxsave)); in xfpregs_get()
115 memcpy(&fpu->fpstate->regs.fxsave, &newstate, sizeof(newstate)); in xfpregs_set()
120 memset(&fpu->fpstate->regs.fxsave.xmm_space[8*4], 0, 8 * 16); in xfpregs_set()
124 fpu->fpstate->regs.xsave.header.xfeatures |= XFEATURE_MASK_FPSSE; in xfpregs_set()
170 ret = copy_uabi_from_kernel_to_xstate(fpu->fpstate, kbuf ?: tmpbuf, &target->thread.pkru); in xstateregs_set()
289 __convert_from_fxsr(env, tsk, &tsk->thread.fpu.fpstate->regs.fxsave); in convert_from_fxsr()
332 return membuf_write(&to, &fpu->fpstate->regs.fsave, in fpregs_get()
343 fx = &fpu->fpstate->regs.fxsave; in fpregs_get()
372 convert_to_fxsr(&fpu->fpstate->regs.fxsave, &env); in fpregs_set()
[all …]
Dinternal.h5 extern struct fpstate init_fpstate;
25 extern void fpstate_init_user(struct fpstate *fpstate);
Dcontext.h75 restore_fpregs_from_fpstate(fpu->fpstate, XFEATURE_MASK_FPSTATE); in fpregs_restore_userregs()
Dinit.c41 fpstate_init_soft(&current->thread.fpu.fpstate->regs.soft); in fpu__init_cpu_generic()
/linux-6.1.9/arch/m68k/kernel/
Dsignal.c333 unsigned char fpstate[FPCONTEXT_SIZE]; in rt_restore_fpu_state() local
350 if (__get_user(*(long *)fpstate, (long __user *)&uc->uc_fpstate)) in rt_restore_fpu_state()
352 if (CPU_IS_060 ? fpstate[2] : fpstate[0]) { in rt_restore_fpu_state()
354 context_size = fpstate[1]; in rt_restore_fpu_state()
357 (fpstate[0] != fpu_version)) in rt_restore_fpu_state()
372 if (!(fpstate[3] == 0x00 || in rt_restore_fpu_state()
373 fpstate[3] == 0x60 || in rt_restore_fpu_state()
374 fpstate[3] == 0xe0)) in rt_restore_fpu_state()
377 if (!(fpstate[3] == 0x00 || in rt_restore_fpu_state()
378 fpstate[3] == 0x05 || in rt_restore_fpu_state()
[all …]
Dprocess.c183 asm volatile ("fsave %0" : : "m" (p->thread.fpstate[0]) : "memory"); in copy_thread()
185 if (!CPU_IS_060 ? p->thread.fpstate[0] : p->thread.fpstate[2]) { in copy_thread()
208 asm volatile ("frestore %0" : : "m" (p->thread.fpstate[0])); in copy_thread()
/linux-6.1.9/arch/x86/include/asm/fpu/
Dtypes.h344 struct fpstate { struct
464 struct fpstate *fpstate; member
472 struct fpstate *__task_fpstate;
496 struct fpstate __fpstate;
533 struct fpstate *fpstate; member
Dapi.h133 extern void fpstate_clear_xstate_component(struct fpstate *fps, unsigned int xfeature);
156 gfpu->fpstate->is_confidential = true; in fpstate_set_confidential()
161 return gfpu->fpstate->is_confidential; in fpstate_is_confidential()
Dsignal.h43 extern void restore_fpregs_from_fpstate(struct fpstate *fpstate, u64 mask);
/linux-6.1.9/arch/x86/um/
Dsignal.c210 &((struct _fpstate __user *)sc.fpstate)->_fxsr_env[0], in copy_sc_from_user()
215 err = convert_fxsr_from_user(&fpx, (void *)sc.fpstate); in copy_sc_from_user()
229 err = copy_from_user(regs->regs.fp, (void *)sc.fpstate, in copy_sc_from_user()
285 sc.fpstate = (unsigned long)to_fp; in copy_sc_to_user()
304 err = convert_fxsr_to_user(&to_fp->fpstate, &fpx); in copy_sc_to_user()
308 err |= __put_user(fpx.swd, &to_fp->fpstate.status); in copy_sc_to_user()
309 err |= __put_user(X86_FXSR_MAGIC, &to_fp->fpstate.magic); in copy_sc_to_user()
313 if (copy_to_user(&to_fp->fpstate._fxsr_env[0], &fpx, in copy_sc_to_user()
344 struct _xstate fpstate; member
357 struct _xstate fpstate; member
[all …]
/linux-6.1.9/arch/x86/include/uapi/asm/
Dsigcontext.h193 struct _fpstate fpstate; member
230 __u32 fpstate; /* Zero when no FPU/extended context */ member
273 __u64 fpstate; /* Zero when no FPU/extended context */ member
320 struct _fpstate __user *fpstate; member
380 struct _fpstate __user *fpstate; /* Zero when no FPU context */ member
/linux-6.1.9/arch/x86/ia32/
Dia32_signal.c96 return fpu__restore_sig(compat_ptr(sc.fpstate), 1); in ia32_restore_sigcontext()
158 void __user *fpstate, in __unsafe_setup_sigcontext32() argument
182 unsafe_put_user(ptr_to_compat(fpstate), &sc->fpstate, Efault); in __unsafe_setup_sigcontext32()
204 void __user **fpstate) in get_sigframe() argument
221 *fpstate = (struct _fpstate_32 __user *) sp; in get_sigframe()
222 if (!copy_fpstate_to_sigframe(*fpstate, (void __user *)fx_aligned, in get_sigframe()
/linux-6.1.9/tools/testing/selftests/x86/
Dcorrupt_xstate_header.c48 uint8_t *fpstate = (uint8_t *)uc->uc_mcontext.fpregs; in sigusr1() local
49 uint64_t *xfeatures = (uint64_t *)(fpstate + 512); in sigusr1()
/linux-6.1.9/arch/x86/include/asm/trace/
Dfpu.h25 __entry->xfeatures = fpu->fpstate->regs.xsave.header.xfeatures;
26 __entry->xcomp_bv = fpu->fpstate->regs.xsave.header.xcomp_bv;
/linux-6.1.9/arch/x86/kernel/
Dsignal.c140 return fpu__restore_sig((void __user *)sc.fpstate, in restore_sigcontext()
145 __unsafe_setup_sigcontext(struct sigcontext __user *sc, void __user *fpstate, in __unsafe_setup_sigcontext() argument
193 unsafe_put_user(fpstate, (unsigned long __user *)&sc->fpstate, Efault); in __unsafe_setup_sigcontext()
242 void __user **fpstate) in get_sigframe() argument
278 *fpstate = (void __user *)sp; in get_sigframe()
297 if (!copy_fpstate_to_sigframe(*fpstate, (void __user *)buf_fx, math_size)) in get_sigframe()
/linux-6.1.9/arch/arm/nwfpe/
Dfpa11.h13 #define GET_FPA11() ((FPA11 *)(&current_thread_info()->fpstate))
Dfpmodule.c53 nwfpe_init_fpa(&thread->fpstate); in nwfpe_notify()
/linux-6.1.9/arch/arm/kernel/
Dptrace.c301 return copy_to_user(ufp, &thread->fpstate.iwmmxt, IWMMXT_SIZE) in ptrace_getwmmxregs()
315 return copy_from_user(&thread->fpstate.iwmmxt, ufp, IWMMXT_SIZE) in ptrace_setwmmxregs()
576 return membuf_write(&to, &task_thread_info(target)->fpstate, in fpa_get()
590 &thread->fpstate, in fpa_set()
Dasm-offsets.c52 DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate)); in main()
63 DEFINE(TI_IWMMXT_STATE, offsetof(struct thread_info, fpstate.iwmmxt)); in main()
/linux-6.1.9/arch/m68k/include/asm/
Dprocessor.h114 unsigned char fpstate[FPSTATESIZE]; /* floating point state */ member
/linux-6.1.9/arch/arm/include/asm/
Dthread_info.h71 union fp_state fpstate __attribute__((aligned(8))); member

12