Commit 091d30c8 authored by Alexander van Heukelum's avatar Alexander van Heukelum Committed by Ingo Molnar

traps: x86_64: make math_state_restore more like i386

- rename variable me -> tsk
 - get thread and tsk like i386
 - expand used_math()
 - copy comment
Signed-off-by: default avatarAlexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 699d2937
...@@ -604,14 +604,15 @@ asmlinkage void __attribute__((weak)) mce_threshold_interrupt(void) ...@@ -604,14 +604,15 @@ asmlinkage void __attribute__((weak)) mce_threshold_interrupt(void)
*/ */
asmlinkage void math_state_restore(void) asmlinkage void math_state_restore(void)
{ {
struct task_struct *me = current; struct thread_info *thread = current_thread_info();
struct task_struct *tsk = thread->task;
if (!used_math()) { if (!tsk_used_math(tsk)) {
local_irq_enable(); local_irq_enable();
/* /*
* does a slab alloc which can sleep * does a slab alloc which can sleep
*/ */
if (init_fpu(me)) { if (init_fpu(tsk)) {
/* /*
* ran out of memory! * ran out of memory!
*/ */
...@@ -625,13 +626,13 @@ asmlinkage void math_state_restore(void) ...@@ -625,13 +626,13 @@ asmlinkage void math_state_restore(void)
/* /*
* Paranoid restore. send a SIGSEGV if we fail to restore the state. * Paranoid restore. send a SIGSEGV if we fail to restore the state.
*/ */
if (unlikely(restore_fpu_checking(me))) { if (unlikely(restore_fpu_checking(tsk))) {
stts(); stts();
force_sig(SIGSEGV, me); force_sig(SIGSEGV, tsk);
return; return;
} }
task_thread_info(me)->status |= TS_USEDFPU; thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */
me->fpu_counter++; tsk->fpu_counter++;
} }
EXPORT_SYMBOL_GPL(math_state_restore); EXPORT_SYMBOL_GPL(math_state_restore);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment