extern int fpu__restore_sig(void __user *buf, int ia32_frame);
extern void fpu__drop(struct fpu *fpu);
extern int fpu__copy(struct fpu *dst_fpu, struct fpu *src_fpu);
-extern void fpu__reset(struct fpu *fpu);
extern void fpu__clear(struct fpu *fpu);
extern void fpu__init_check_bugs(void);
{
if (fpu_switch.preload) {
if (unlikely(copy_fpstate_to_fpregs(new_fpu)))
- fpu__reset(new_fpu);
+ fpu__clear(new_fpu);
}
}
if (fpu->fpregs_active) {
if (WARN_ON(copy_fpstate_to_fpregs(fpu)))
- fpu__reset(fpu);
+ fpu__clear(fpu);
} else {
__fpregs_deactivate_hw();
}
kernel_fpu_disable();
fpregs_activate(fpu);
if (unlikely(copy_fpstate_to_fpregs(fpu))) {
- fpu__reset(fpu);
+ fpu__clear(fpu);
force_sig_info(SIGSEGV, SEND_SIG_PRIV, tsk);
} else {
tsk->thread.fpu.counter++;
}
/*
- * Reset the FPU state back to init state:
- */
-void fpu__reset(struct fpu *fpu)
-{
- if (!use_eager_fpu())
- fpu__drop(fpu);
- else
- restore_init_xstate();
-}
-
-/*
- * Called by sys_execve() to clear the FPU fpregs, so that FPU state
- * of the previous binary does not leak over into the exec()ed binary:
+ * Clear the FPU state back to init state.
+ *
+ * Called by sys_execve(), by the signal handler code and by various
+ * error paths.
*/
void fpu__clear(struct fpu *fpu)
{