Lines Matching refs:fpu

60 DEFINE_PER_CPU(struct fpu *, fpu_fpregs_owner_ctx);
115 void save_fpregs_to_fpstate(struct fpu *fpu) in save_fpregs_to_fpstate() argument
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()
125 fpu->avx512_timestamp = jiffies; 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()
242 struct fpu *fpu = &current->thread.fpu; in fpu_swap_kvm_fpstate() local
243 struct fpstate *cur_fps = fpu->fpstate; in fpu_swap_kvm_fpstate()
247 save_fpregs_to_fpstate(fpu); in fpu_swap_kvm_fpstate()
251 fpu->__task_fpstate = cur_fps; 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()
257 fpu->__task_fpstate = NULL; in fpu_swap_kvm_fpstate()
260 cur_fps = fpu->fpstate; in fpu_swap_kvm_fpstate()
347 save_fpregs_to_fpstate(&current->thread.fpu); in kernel_fpu_begin_mask()
373 void fpu_sync_fpstate(struct fpu *fpu) in fpu_sync_fpstate() argument
375 WARN_ON_FPU(fpu != &current->thread.fpu); in fpu_sync_fpstate()
378 trace_x86_fpu_before_save(fpu); in fpu_sync_fpstate()
381 save_fpregs_to_fpstate(fpu); in fpu_sync_fpstate()
383 trace_x86_fpu_after_save(fpu); in fpu_sync_fpstate()
443 void fpstate_reset(struct fpu *fpu) in fpstate_reset() argument
446 fpu->fpstate = &fpu->__fpstate; in fpstate_reset()
447 __fpstate_reset(fpu->fpstate); in fpstate_reset()
450 fpu->perm.__state_perm = fpu_kernel_cfg.default_features; in fpstate_reset()
451 fpu->perm.__state_size = fpu_kernel_cfg.default_size; in fpstate_reset()
452 fpu->perm.__user_state_size = fpu_user_cfg.default_size; in fpstate_reset()
455 static inline void fpu_inherit_perms(struct fpu *dst_fpu) in fpu_inherit_perms()
458 struct fpu *src_fpu = &current->group_leader->thread.fpu; in fpu_inherit_perms()
470 struct fpu *src_fpu = &current->thread.fpu; in fpu_clone()
471 struct fpu *dst_fpu = &dst->thread.fpu; in fpu_clone()
533 *offset = offsetof(struct thread_struct, fpu.__fpstate.regs); in fpu_thread_struct_whitelist()
546 void fpu__drop(struct fpu *fpu) in fpu__drop() argument
550 if (fpu == &current->thread.fpu) { in fpu__drop()
555 fpregs_deactivate(fpu); in fpu__drop()
558 trace_x86_fpu_dropped(fpu); in fpu__drop()
584 struct fpu *fpu = &current->thread.fpu; in fpu_reset_fpregs() local
587 fpu__drop(fpu); in fpu_reset_fpregs()
601 memcpy(&fpu->fpstate->regs, &init_fpstate.regs, init_fpstate_copy_size()); in fpu_reset_fpregs()
611 void fpu__clear_user_states(struct fpu *fpu) in fpu__clear_user_states() argument
613 WARN_ON_FPU(fpu != &current->thread.fpu); in fpu__clear_user_states()
627 !fpregs_state_valid(fpu, smp_processor_id())) in fpu__clear_user_states()
628 os_xrstor_supervisor(fpu->fpstate); in fpu__clear_user_states()
646 fpstate_reset(&current->thread.fpu); in fpu_flush_thread()
669 struct fpu *fpu = &current->thread.fpu; in fpregs_assert_state_consistent() local
674 WARN_ON_FPU(!fpregs_state_valid(fpu, smp_processor_id())); in fpregs_assert_state_consistent()
681 struct fpu *fpu = &current->thread.fpu; in fpregs_mark_activate() local
683 fpregs_activate(fpu); in fpregs_mark_activate()
684 fpu->last_cpu = smp_processor_id(); in fpregs_mark_activate()
692 int fpu__exception_code(struct fpu *fpu, int trap_nr) in fpu__exception_code() argument
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()