aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuck Ebbert <76306.1226@compuserve.com>2006-04-29 14:07:49 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-05-01 12:03:44 -0700
commit6584014ec33ed34c5bf6c5af20a0951069bea7a9 (patch)
treea0f5b58fcafe3dd8f6fc7fd69bd13048c0512916
parenta5ddce5373218e73fbd58c20a96edd730048529d (diff)
[PATCH] i386: fix broken FP exception handling
The FXSAVE information leak patch introduced a bug in FP exception handling: it clears FP exceptions only when there are already none outstanding. Mikael Pettersson reported that causes problems with the Erlang runtime and has tested this fix. Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com> Acked-by: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--include/asm-i386/i387.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-i386/i387.h b/include/asm-i386/i387.h
index 7b1f01191e70..bc1d6edae1ed 100644
--- a/include/asm-i386/i387.h
+++ b/include/asm-i386/i387.h
@@ -58,13 +58,13 @@ static inline void __save_init_fpu( struct task_struct *tsk )
alternative_input(
"fnsave %[fx] ;fwait;" GENERIC_NOP8 GENERIC_NOP4,
"fxsave %[fx]\n"
- "bt $7,%[fsw] ; jc 1f ; fnclex\n1:",
+ "bt $7,%[fsw] ; jnc 1f ; fnclex\n1:",
X86_FEATURE_FXSR,
[fx] "m" (tsk->thread.i387.fxsave),
[fsw] "m" (tsk->thread.i387.fxsave.swd) : "memory");
/* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
is pending. Clear the x87 state here by setting it to fixed
- values. __per_cpu_offset[0] is a random variable that should be in L1 */
+ values. safe_address is a random variable that should be in L1 */
alternative_input(
GENERIC_NOP8 GENERIC_NOP2,
"emms\n\t" /* clear stack tags */