From: Andi Kleen <ak@muc.de>
To: "David S. Miller" <davem@redhat.com>
Cc: ak@suse.de, torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [BK-2.5] Move "used FPU status" into new non-atomic thread_info->status field.
Date: Mon, 10 Mar 2003 22:28:15 +0100 [thread overview]
Message-ID: <20030310212815.GA30916@averell> (raw)
In-Reply-To: <20030310.124502.115944935.davem@redhat.com>
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.
-Andi
next prev parent reply other threads:[~2003-03-10 21:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[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 ` [BK-2.5] Move "used FPU status" into new non-atomic thread_info->status field Andi Kleen
2003-03-10 20:45 ` David S. Miller
2003-03-10 21:28 ` Andi Kleen [this message]
2003-03-11 0:56 Mikael Pettersson
2003-03-11 1:02 ` Linus Torvalds
2003-03-11 12:59 ` Mikael Pettersson
[not found] <200303101905.h2AJ56P00946@hera.kernel.org>
2003-03-10 18:56 ` 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030310212815.GA30916@averell \
--to=ak@muc.de \
--cc=ak@suse.de \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox