public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [BUG] 2.6.17-rc3 broke FP exceptions on x86
@ 2006-04-29  8:00 Chuck Ebbert
  0 siblings, 0 replies; 3+ messages in thread
From: Chuck Ebbert @ 2006-04-29  8:00 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: linux-kernel

In-Reply-To: <17490.4240.578291.222262@alkaid.it.uu.se>

On Fri, 28 Apr 2006 14:54:40 +0200, Mikael Pettersson wrote:

> Running an FP exception using user-space application
> (the runtime system for the Erlang programming language
> in my case) on an Athlon64 with a 32-bit 2.6.17-rc3 kernel
> quickly results in a complete system hang: mouse is dead,
> keyboard is dead, the network doesn't reply to pings.
> Had to reboot via the power switch to get the machine back.
> 
> This happended twice in a row. With 2.6.17-rc2 things
> work fine like they always have before.

This should fix it... please test.

Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>

--- 2.6.17-rc3-d4.orig/include/asm-i386/i387.h
+++ 2.6.17-rc3-d4/include/asm-i386/i387.h
@@ -58,13 +58,13 @@ static inline void __save_init_fpu( stru
 	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 */
-- 
Chuck
"Penguins don't come from next door, they come from the Antarctic!"

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: [BUG] 2.6.17-rc3 broke FP exceptions on x86
@ 2006-04-29 10:03 Mikael Pettersson
  0 siblings, 0 replies; 3+ messages in thread
From: Mikael Pettersson @ 2006-04-29 10:03 UTC (permalink / raw)
  To: 76306.1226; +Cc: linux-kernel

On Sat, 29 Apr 2006 04:00:49 -0400, Chuck Ebbert <76306.1226@compuserve.com> wrote:
>On Fri, 28 Apr 2006 14:54:40 +0200, Mikael Pettersson wrote:
>
>> Running an FP exception using user-space application
>> (the runtime system for the Erlang programming language
>> in my case) on an Athlon64 with a 32-bit 2.6.17-rc3 kernel
>> quickly results in a complete system hang: mouse is dead,
>> keyboard is dead, the network doesn't reply to pings.
>> Had to reboot via the power switch to get the machine back.
>> 
>> This happended twice in a row. With 2.6.17-rc2 things
>> work fine like they always have before.
>
>This should fix it... please test.
>
>Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>
>
>--- 2.6.17-rc3-d4.orig/include/asm-i386/i387.h
>+++ 2.6.17-rc3-d4/include/asm-i386/i387.h
>@@ -58,13 +58,13 @@ static inline void __save_init_fpu( stru
> 	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 */

This fixed the problem. Thanks.

Acked-by: Mikael Pettersson <mikpe@it.uu.se>

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [BUG] 2.6.17-rc3 broke FP exceptions on x86
@ 2006-04-28 12:54 Mikael Pettersson
  0 siblings, 0 replies; 3+ messages in thread
From: Mikael Pettersson @ 2006-04-28 12:54 UTC (permalink / raw)
  To: linux-kernel

Running an FP exception using user-space application
(the runtime system for the Erlang programming language
in my case) on an Athlon64 with a 32-bit 2.6.17-rc3 kernel
quickly results in a complete system hang: mouse is dead,
keyboard is dead, the network doesn't reply to pings.
Had to reboot via the power switch to get the machine back.

This happended twice in a row. With 2.6.17-rc2 things
work fine like they always have before.

Just FYI. I'll try to debug this this weekend if noone
beats me to it.

/Mikael

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-04-29 10:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-29  8:00 [BUG] 2.6.17-rc3 broke FP exceptions on x86 Chuck Ebbert
  -- strict thread matches above, loose matches on Subject: below --
2006-04-29 10:03 Mikael Pettersson
2006-04-28 12:54 Mikael Pettersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox