Lines Matching refs:fpu

57 DEFINE_PER_CPU(struct fpu *, fpu_fpregs_owner_ctx);
60 struct fpu *x86_task_fpu(struct task_struct *task) in x86_task_fpu()
117 static void update_avx_timestamp(struct fpu *fpu) in update_avx_timestamp() argument
122 if (fpu->fpstate->regs.xsave.header.xfeatures & AVX512_TRACKING_MASK) in update_avx_timestamp()
123 fpu->avx512_timestamp = jiffies; in update_avx_timestamp()
140 void save_fpregs_to_fpstate(struct fpu *fpu) in save_fpregs_to_fpstate() argument
143 os_xsave(fpu->fpstate); in save_fpregs_to_fpstate()
144 update_avx_timestamp(fpu); in save_fpregs_to_fpstate()
149 fxsave(&fpu->fpstate->regs.fxsave); in save_fpregs_to_fpstate()
157 asm volatile("fnsave %[fp]; fwait" : [fp] "=m" (fpu->fpstate->regs.fsave)); in save_fpregs_to_fpstate()
158 frstor(&fpu->fpstate->regs.fsave); in save_fpregs_to_fpstate()
357 struct fpu *fpu = x86_task_fpu(current); in fpu_swap_kvm_fpstate() local
358 struct fpstate *cur_fps = fpu->fpstate; in fpu_swap_kvm_fpstate()
362 save_fpregs_to_fpstate(fpu); in fpu_swap_kvm_fpstate()
366 fpu->__task_fpstate = cur_fps; in fpu_swap_kvm_fpstate()
367 fpu->fpstate = guest_fps; in fpu_swap_kvm_fpstate()
371 fpu->fpstate = fpu->__task_fpstate; in fpu_swap_kvm_fpstate()
372 fpu->__task_fpstate = NULL; in fpu_swap_kvm_fpstate()
375 cur_fps = fpu->fpstate; in fpu_swap_kvm_fpstate()
487 void fpu_sync_fpstate(struct fpu *fpu) in fpu_sync_fpstate() argument
489 WARN_ON_FPU(fpu != x86_task_fpu(current)); in fpu_sync_fpstate()
492 trace_x86_fpu_before_save(fpu); in fpu_sync_fpstate()
495 save_fpregs_to_fpstate(fpu); in fpu_sync_fpstate()
497 trace_x86_fpu_after_save(fpu); in fpu_sync_fpstate()
573 void fpstate_reset(struct fpu *fpu) in fpstate_reset() argument
576 fpu->fpstate = &fpu->__fpstate; in fpstate_reset()
577 __fpstate_reset(fpu->fpstate); in fpstate_reset()
580 fpu->perm.__state_perm = fpu_kernel_cfg.default_features; in fpstate_reset()
581 fpu->perm.__state_size = fpu_kernel_cfg.default_size; in fpstate_reset()
582 fpu->perm.__user_state_size = fpu_user_cfg.default_size; in fpstate_reset()
584 fpu->guest_perm.__state_perm = guest_default_cfg.features; in fpstate_reset()
585 fpu->guest_perm.__state_size = guest_default_cfg.size; in fpstate_reset()
590 fpu->guest_perm.__user_state_size = fpu_user_cfg.default_size; in fpstate_reset()
593 static inline void fpu_inherit_perms(struct fpu *dst_fpu) in fpu_inherit_perms()
596 struct fpu *src_fpu = x86_task_fpu(current->group_leader); in fpu_inherit_perms()
644 struct fpu *dst_fpu = (void *)dst + sizeof(*dst); in fpu_clone()
724 *offset += offsetof(struct fpu, __fpstate.regs); in fpu_thread_struct_whitelist()
739 struct fpu *fpu; in fpu__drop() local
744 fpu = x86_task_fpu(tsk); in fpu__drop()
748 if (fpu == x86_task_fpu(current)) { in fpu__drop()
753 fpregs_deactivate(fpu); in fpu__drop()
756 trace_x86_fpu_dropped(fpu); in fpu__drop()
782 struct fpu *fpu = x86_task_fpu(current); in fpu_reset_fpstate_regs() local
785 __fpu_invalidate_fpregs_state(fpu); in fpu_reset_fpstate_regs()
799 memcpy(&fpu->fpstate->regs, &init_fpstate.regs, init_fpstate_copy_size()); in fpu_reset_fpstate_regs()
809 void fpu__clear_user_states(struct fpu *fpu) in fpu__clear_user_states() argument
811 WARN_ON_FPU(fpu != x86_task_fpu(current)); in fpu__clear_user_states()
825 !fpregs_state_valid(fpu, smp_processor_id())) in fpu__clear_user_states()
826 os_xrstor_supervisor(fpu->fpstate); in fpu__clear_user_states()
885 struct fpu *fpu = x86_task_fpu(current); in fpregs_assert_state_consistent() local
890 WARN_ON_FPU(!fpregs_state_valid(fpu, smp_processor_id())); in fpregs_assert_state_consistent()
897 struct fpu *fpu = x86_task_fpu(current); in fpregs_mark_activate() local
899 fpregs_activate(fpu); in fpregs_mark_activate()
900 fpu->last_cpu = smp_processor_id(); in fpregs_mark_activate()
908 int fpu__exception_code(struct fpu *fpu, int trap_nr) in fpu__exception_code() argument
925 cwd = fpu->fpstate->regs.fxsave.cwd; in fpu__exception_code()
926 swd = fpu->fpstate->regs.fxsave.swd; in fpu__exception_code()
928 cwd = (unsigned short)fpu->fpstate->regs.fsave.cwd; in fpu__exception_code()
929 swd = (unsigned short)fpu->fpstate->regs.fsave.swd; in fpu__exception_code()
943 mxcsr = fpu->fpstate->regs.fxsave.mxcsr; in fpu__exception_code()