Migrate this function to pure 'struct fpu' usage.
Reviewed-by: Borislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
* Reset the FPU state in the eager case and drop it in the lazy case (later use
* will reinit it).
*/
-static inline void fpu_reset_state(struct task_struct *tsk)
+static inline void fpu_reset_state(struct fpu *fpu)
{
- struct fpu *fpu = &tsk->thread.fpu;
-
if (!use_eager_fpu())
drop_fpu(fpu);
else
if (fpu.preload) {
if (unlikely(restore_fpu_checking(new_fpu)))
- fpu_reset_state(new);
+ fpu_reset_state(new_fpu);
}
}
void __kernel_fpu_end(void)
{
- struct task_struct *me = current;
- struct fpu *fpu = &me->thread.fpu;
+ struct fpu *fpu = ¤t->thread.fpu;
if (fpu->has_fpu) {
if (WARN_ON(restore_fpu_checking(fpu)))
- fpu_reset_state(me);
+ fpu_reset_state(fpu);
} else if (!use_eager_fpu()) {
stts();
}
kernel_fpu_disable();
__thread_fpu_begin(fpu);
if (unlikely(restore_fpu_checking(fpu))) {
- fpu_reset_state(tsk);
+ fpu_reset_state(fpu);
force_sig_info(SIGSEGV, SEND_SIG_PRIV, tsk);
} else {
tsk->thread.fpu.counter++;
config_enabled(CONFIG_IA32_EMULATION));
if (!buf) {
- fpu_reset_state(tsk);
+ fpu_reset_state(fpu);
return 0;
}
*/
user_fpu_begin();
if (restore_user_xstate(buf_fx, xstate_bv, fx_only)) {
- fpu_reset_state(tsk);
+ fpu_reset_state(fpu);
return -1;
}
}
* Ensure the signal handler starts with the new fpu state.
*/
if (fpu->fpstate_active)
- fpu_reset_state(current);
+ fpu_reset_state(fpu);
}
signal_setup_done(failed, ksig, stepping);
}