lkml.org 
[lkml]   [2006]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 16/30] x86_64: Fix FPU corruption
-stable review patch.  If anyone has any objections, please let us know.
------------------

From: Andi Kleen <ak@suse.de>

This reverts an earlier patch that was found to cause FPU
state corruption. I think the corruption happens because
unlazy_fpu() can cause FPU exceptions and when it happens
after the current switch some processing would affect
the state in the wrong process.

Thanks to Douglas Crosher and Tom Hughes for testing.

Cc: jbeulich@novell.com
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
arch/x86_64/kernel/process.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

--- linux-2.6.18.2.orig/arch/x86_64/kernel/process.c
+++ linux-2.6.18.2/arch/x86_64/kernel/process.c
@@ -571,6 +571,9 @@ __switch_to(struct task_struct *prev_p,
prev->gsindex = gsindex;
}

+ /* Must be after DS reload */
+ unlazy_fpu(prev_p);
+
/*
* Switch the PDA and FPU contexts.
*/
@@ -578,10 +581,6 @@ __switch_to(struct task_struct *prev_p,
write_pda(oldrsp, next->userrsp);
write_pda(pcurrent, next_p);

- /* This must be here to ensure both math_state_restore() and
- kernel_fpu_begin() work consistently.
- And the AMD workaround requires it to be after DS reload. */
- unlazy_fpu(prev_p);
write_pda(kernelstack,
task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET);

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-11-16 03:49    [W:0.151 / U:0.944 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site