Lines Matching refs:fpstate

42 struct fpstate init_fpstate __ro_after_init;
118 os_xsave(fpu->fpstate); in save_fpregs_to_fpstate()
124 if (fpu->fpstate->regs.xsave.header.xfeatures & XFEATURE_MASK_AVX512) in save_fpregs_to_fpstate()
130 fxsave(&fpu->fpstate->regs.fxsave); in save_fpregs_to_fpstate()
138 asm volatile("fnsave %[fp]; fwait" : [fp] "=m" (fpu->fpstate->regs.fsave)); in save_fpregs_to_fpstate()
139 frstor(&fpu->fpstate->regs.fsave); in save_fpregs_to_fpstate()
142 void restore_fpregs_from_fpstate(struct fpstate *fpstate, u64 mask) in restore_fpregs_from_fpstate() argument
155 : : [addr] "m" (fpstate)); in restore_fpregs_from_fpstate()
174 xfd_update_state(fpstate); in restore_fpregs_from_fpstate()
187 os_xrstor(fpstate, mask); in restore_fpregs_from_fpstate()
190 fxrstor(&fpstate->regs.fxsave); in restore_fpregs_from_fpstate()
192 frstor(&fpstate->regs.fsave); in restore_fpregs_from_fpstate()
202 static void __fpstate_reset(struct fpstate *fpstate);
206 struct fpstate *fpstate; in fpu_alloc_guest_fpstate() local
209 size = fpu_user_cfg.default_size + ALIGN(offsetof(struct fpstate, regs), 64); in fpu_alloc_guest_fpstate()
210 fpstate = vzalloc(size); in fpu_alloc_guest_fpstate()
211 if (!fpstate) in fpu_alloc_guest_fpstate()
214 __fpstate_reset(fpstate); in fpu_alloc_guest_fpstate()
215 fpstate_init_user(fpstate); in fpu_alloc_guest_fpstate()
216 fpstate->is_valloc = true; in fpu_alloc_guest_fpstate()
217 fpstate->is_guest = true; in fpu_alloc_guest_fpstate()
219 gfpu->fpstate = fpstate; in fpu_alloc_guest_fpstate()
226 struct fpstate *fps = gfpu->fpstate; in fpu_free_guest_fpstate()
234 gfpu->fpstate = NULL; in fpu_free_guest_fpstate()
241 struct fpstate *guest_fps = guest_fpu->fpstate; in fpu_swap_kvm_fpstate()
243 struct fpstate *cur_fps = fpu->fpstate; in fpu_swap_kvm_fpstate()
252 fpu->fpstate = guest_fps; in fpu_swap_kvm_fpstate()
256 fpu->fpstate = fpu->__task_fpstate; in fpu_swap_kvm_fpstate()
260 cur_fps = fpu->fpstate; in fpu_swap_kvm_fpstate()
283 struct fpstate *kstate = gfpu->fpstate; in fpu_copy_guest_fpstate_to_uabi()
301 struct fpstate *kstate = gfpu->fpstate; in fpu_copy_uabi_to_guest_fpstate()
396 static inline void fpstate_init_fxstate(struct fpstate *fpstate) in fpstate_init_fxstate() argument
398 fpstate->regs.fxsave.cwd = 0x37f; in fpstate_init_fxstate()
399 fpstate->regs.fxsave.mxcsr = MXCSR_DEFAULT; in fpstate_init_fxstate()
405 static inline void fpstate_init_fstate(struct fpstate *fpstate) in fpstate_init_fstate() argument
407 fpstate->regs.fsave.cwd = 0xffff037fu; in fpstate_init_fstate()
408 fpstate->regs.fsave.swd = 0xffff0000u; in fpstate_init_fstate()
409 fpstate->regs.fsave.twd = 0xffffffffu; in fpstate_init_fstate()
410 fpstate->regs.fsave.fos = 0xffff0000u; in fpstate_init_fstate()
418 void fpstate_init_user(struct fpstate *fpstate) in fpstate_init_user() argument
421 fpstate_init_soft(&fpstate->regs.soft); in fpstate_init_user()
425 xstate_init_xcomp_bv(&fpstate->regs.xsave, fpstate->xfeatures); in fpstate_init_user()
428 fpstate_init_fxstate(fpstate); in fpstate_init_user()
430 fpstate_init_fstate(fpstate); in fpstate_init_user()
433 static void __fpstate_reset(struct fpstate *fpstate) in __fpstate_reset() argument
436 fpstate->size = fpu_kernel_cfg.default_size; in __fpstate_reset()
437 fpstate->user_size = fpu_user_cfg.default_size; in __fpstate_reset()
438 fpstate->xfeatures = fpu_kernel_cfg.default_features; in __fpstate_reset()
439 fpstate->user_xfeatures = fpu_user_cfg.default_features; in __fpstate_reset()
440 fpstate->xfd = init_fpstate.xfd; in __fpstate_reset()
446 fpu->fpstate = &fpu->__fpstate; in fpstate_reset()
447 __fpstate_reset(fpu->fpstate); in fpstate_reset()
493 memcpy(&dst_fpu->fpstate->regs, &init_fpstate.regs, in fpu_clone()
601 memcpy(&fpu->fpstate->regs, &init_fpstate.regs, init_fpstate_copy_size()); in fpu_reset_fpregs()
628 os_xrstor_supervisor(fpu->fpstate); in fpu__clear_user_states()
709 cwd = fpu->fpstate->regs.fxsave.cwd; in fpu__exception_code()
710 swd = fpu->fpstate->regs.fxsave.swd; in fpu__exception_code()
712 cwd = (unsigned short)fpu->fpstate->regs.fsave.cwd; in fpu__exception_code()
713 swd = (unsigned short)fpu->fpstate->regs.fsave.swd; in fpu__exception_code()
727 mxcsr = fpu->fpstate->regs.fxsave.mxcsr; in fpu__exception_code()