public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
[parent not found: <20030310.105659.57012503.davem@redhat.com.suse.lists.linux.kernel>]
* Re: [BK-2.5] Move "used FPU status" into new non-atomic thread_info->status field.
@ 2003-03-11  0:56 Mikael Pettersson
  2003-03-11  1:02 ` Linus Torvalds
  0 siblings, 1 reply; 11+ messages in thread
From: Mikael Pettersson @ 2003-03-11  0:56 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

On Mon, 10 Mar 2003 11:25:55 -0800 (PST), Linus Torvalds wrote:
>We could _probably_ do it on x86 too. The standard C calling convention on 
>x86 says FPU register state is clobbered, if I remember correctly. 
>However, some of the state is "long-term", like rounding modes, exception 
>masking etc, and even if we didn't save the register state we would have 
>to save that part.
...
>As it was, the x86 state was pretty much random after fork(), and that can 
>definitely lead to problems for real programs if they depend on things 
>like silent underflow etc. 

Do you mean x87 control or the x87 stack here?

>(Now, in _practice_ all processes on the machine tends to use the same
>rounding and exception control, so the "random" state wasn't actually very
>random, and would not lead to problems. It's a security issue, though).

Sorry for being dense, but can you clarify: will current 2.{2,4,5}
kernels preserve or destroy the parent process' FPU control at fork()?

We're using unmasked FPU exceptions on x86 (and Solaris/SPARC) in the
runtime system for the Erlang telecom systems programming language.
This gives a noticeable performance improvement, but it relies on
the FPU control not changing beneath it: the FPU control is only
initialised at startup and when SIGFPU has occurred.

/Mikael

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

end of thread, other threads:[~2003-03-11 12:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200303101905.h2AJ56P00946@hera.kernel.org>
2003-03-10 18:56 ` [BK-2.5] Move "used FPU status" into new non-atomic thread_info->status field David S. Miller
2003-03-10 19:25   ` Linus Torvalds
2003-03-10 19:14     ` David S. Miller
2003-03-10 19:59     ` Chris Friesen
2003-03-10 20:09       ` Linus Torvalds
     [not found] <20030310.105659.57012503.davem@redhat.com.suse.lists.linux.kernel>
     [not found] ` <Pine.LNX.4.44.0303101119220.2240-100000@home.transmeta.com.suse.lists.linux.kernel>
2003-03-10 21:01   ` Andi Kleen
2003-03-10 20:45     ` David S. Miller
2003-03-10 21:28       ` Andi Kleen
2003-03-11  0:56 Mikael Pettersson
2003-03-11  1:02 ` Linus Torvalds
2003-03-11 12:59   ` Mikael Pettersson

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