Commit d154c8f0 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] Fix x86-64 signal FPU saving bug

Don't overwrite FPU state unconditionally in init_fpu.

The child == current check is probably not needed, it's just paranoia.
parent f9358b1b
...@@ -53,6 +53,11 @@ void __init fpu_init(void) ...@@ -53,6 +53,11 @@ void __init fpu_init(void)
*/ */
void init_fpu(struct task_struct *child) void init_fpu(struct task_struct *child)
{ {
if (child->used_math) {
if (child == current)
unlazy_fpu(child);
return;
}
memset(&child->thread.i387.fxsave, 0, sizeof(struct i387_fxsave_struct)); memset(&child->thread.i387.fxsave, 0, sizeof(struct i387_fxsave_struct));
child->thread.i387.fxsave.cwd = 0x37f; child->thread.i387.fxsave.cwd = 0x37f;
child->thread.i387.fxsave.mxcsr = 0x1f80; child->thread.i387.fxsave.mxcsr = 0x1f80;
......
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