math_state_restore() question
Hi,
I have a quick question.
The math_state_restore() restores the FPU/MMX/XMM states. However where do we save the previous task's states if it is necessary?
asmlinkage void math_state_restore(struct pt_regs regs)
{
struct thread_info *thread = current_thread_info();
struct task_struct *tsk = thread->task;
clts(); /* Allow maths ops (or we recurse) */
if (!tsk_used_math(tsk))
init_fpu(tsk);
restore_fpu(tsk);
thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */
}Thanks in advance,
Hiro
Signature · 2 lines
Hiro Yoshioka mailto:hyoshiok at miraclelinux.com
Hi,
Just take a look at __switch_to(), where __unlazy_fpu() is called.
Quoted 25 lines
Hi,
I have a quick question.
The
math_state_restore()restores the FPU/MMX/XMM states. However where do we save the previous task's states if it is necessary?asmlinkage void
math_state_restore(struct pt_regs regs){ struct thread_info *thread = current_thread_info(); struct task_struct *tsk = thread->task; clts(); /* Allow maths ops (or we recurse) */ if (!tsk_used_math(tsk)) init_fpu(tsk); restore_fpu(tsk); thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */ }Thanks in advance,
HiroSignature · 3 lines
Hiro Yoshioka mailto:hyoshiok at miraclelinux.com -
Quoted 1 line
Just take a look at
__switch_to(), where__unlazy_fpu()is called.
Thanks. Does an exception handler (like page_fault, etc) come from __switch_to()?
Regards,
Hiro
On Wed, 17 Aug 2005 17:42:22 +0900 (JST) Hiro Yoshioka <[email protected]> mentioned:
Quoted 4 lines
Quoted 1 line
Just take a look at
__switch_to(), where__unlazy_fpu()is called.Thanks. Does an exception handler (like
page_fault, etc) come from__switch_to()?
No, page_fault is generated when the location of memory access(virtual) does not have physical memory.
If you have a code like this,
movq (%%esi), %%mm0
a page of address %%esi might be swapped out already and might not have any physical memory page allocated.
Signature · 1 line
Akira Tsukamoto <[email protected], [email protected]>