[lkml]   [2003]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [BK-2.5] Move "used FPU status" into new non-atomic thread_info->status field.
On Mon, Mar 10, 2003 at 12:45:02PM -0800, David S. Miller wrote:
> Turned out the 32bit ptrace unlazy FPU path shared two lines too many
> with with the 32bit signal FPU saving path and was resetting the
> used_fpu flag. Result was that the FPU state of the child could be
> reinitialized in some circumstances on ptrace accesses.
> So what it depended upon was the FP control register state,
> not the state of the individual FPU registers, across fork()
> right?

Yes. The IA32 ABI says the FPU registers are clobbered in a function
call. And fork is a function call. Same with the SSE registers.

Unfortunately it is much more expensive to save individual registers
(SSE and x87 stack) than to just save everything using FXSAVE.
FXSAVE uses lazy saving and saves only the x87 registers that are
actually uses.

For SSE registers it may make sense, but then FXSAVE does that already
too and you always have to handle the x87 register stack too.

I doubt it would be a good idea to not use FXSAVE on i386. The microcode
can do a better job here because it has more information. In addition
it also promises to handle future new Intel registers transparently.

x86-64 ABIs have similar semantics.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:33    [W:0.030 / U:4.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site