Lines Matching refs:fpu

44 DEFINE_PER_CPU(struct fpu *, fpu_fpregs_owner_ctx);
99 void save_fpregs_to_fpstate(struct fpu *fpu) in save_fpregs_to_fpstate() argument
102 os_xsave(&fpu->state.xsave); in save_fpregs_to_fpstate()
108 if (fpu->state.xsave.header.xfeatures & XFEATURE_MASK_AVX512) in save_fpregs_to_fpstate()
109 fpu->avx512_timestamp = jiffies; in save_fpregs_to_fpstate()
114 fxsave(&fpu->state.fxsave); in save_fpregs_to_fpstate()
122 asm volatile("fnsave %[fp]; fwait" : [fp] "=m" (fpu->state.fsave)); in save_fpregs_to_fpstate()
123 frstor(&fpu->state.fsave); in save_fpregs_to_fpstate()
166 save_fpregs_to_fpstate(&current->thread.fpu); in kernel_fpu_begin_mask()
192 void fpu_sync_fpstate(struct fpu *fpu) in fpu_sync_fpstate() argument
194 WARN_ON_FPU(fpu != &current->thread.fpu); in fpu_sync_fpstate()
197 trace_x86_fpu_before_save(fpu); in fpu_sync_fpstate()
200 save_fpregs_to_fpstate(fpu); in fpu_sync_fpstate()
202 trace_x86_fpu_after_save(fpu); in fpu_sync_fpstate()
253 struct fpu *src_fpu = &current->thread.fpu; in fpu_clone()
254 struct fpu *dst_fpu = &dst->thread.fpu; in fpu_clone()
298 void fpu__drop(struct fpu *fpu) in fpu__drop() argument
302 if (fpu == &current->thread.fpu) { in fpu__drop()
307 fpregs_deactivate(fpu); in fpu__drop()
310 trace_x86_fpu_dropped(fpu); in fpu__drop()
345 struct fpu *fpu = &current->thread.fpu; in fpu_reset_fpstate() local
348 fpu__drop(fpu); in fpu_reset_fpstate()
362 memcpy(&fpu->state, &init_fpstate, init_fpstate_copy_size()); in fpu_reset_fpstate()
372 void fpu__clear_user_states(struct fpu *fpu) in fpu__clear_user_states() argument
374 WARN_ON_FPU(fpu != &current->thread.fpu); in fpu__clear_user_states()
388 !fpregs_state_valid(fpu, smp_processor_id())) { in fpu__clear_user_states()
389 os_xrstor(&fpu->state.xsave, xfeatures_mask_supervisor()); in fpu__clear_user_states()
430 struct fpu *fpu = &current->thread.fpu; in fpregs_assert_state_consistent() local
435 WARN_ON_FPU(!fpregs_state_valid(fpu, smp_processor_id())); in fpregs_assert_state_consistent()
442 struct fpu *fpu = &current->thread.fpu; in fpregs_mark_activate() local
444 fpregs_activate(fpu); in fpregs_mark_activate()
445 fpu->last_cpu = smp_processor_id(); in fpregs_mark_activate()
454 int fpu__exception_code(struct fpu *fpu, int trap_nr) in fpu__exception_code() argument
471 cwd = fpu->state.fxsave.cwd; in fpu__exception_code()
472 swd = fpu->state.fxsave.swd; in fpu__exception_code()
474 cwd = (unsigned short)fpu->state.fsave.cwd; in fpu__exception_code()
475 swd = (unsigned short)fpu->state.fsave.swd; in fpu__exception_code()
489 mxcsr = fpu->state.fxsave.mxcsr; in fpu__exception_code()