From: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
To: linux-kernel@vger.kernel.org
Subject: 2.6.10-rc3, i386: fpu handling on sigreturn
Date: Wed, 22 Dec 2004 18:42:55 +0100 [thread overview]
Message-ID: <41C9B21F.90802@fujitsu-siemens.com> (raw)
Maybe, there is a problem in i386 fpu/signal handling:
On i386, if a signal handler is started, the kernel saves the fpu-state
of the interrupted routine in the sigcontext on the stack. Calling
unlazy_fpu() and setting current->used_math=0, the kernel supplies the
signal-handler with a cleared virtual fpu.
On sigreturn(), the old fpu-state of the interrupted routine is
restored.
If a process never used the fpu, it virtually has a cleared fpu.
If such a process is interrupted by a signal handler, no fpu-context is
saved and sigcontext->fpstate is set to NULL.
Assume, that the signal handler uses the fpu. Then, AFAICS, on sigreturn
current->used_math will be 1. Since sigcontext->fpstate still is NULL,
restore_sigcontext() doesn't call restore_i387(). Thus, no
clear_fpu() is done, current->used_math is not reset.
Now, the interrupted processes fpu no longer is cleared!
I don't know, if this could cause trouble, since I'm not an expert for
i386-fpu. But it seems to be not clean.
Best regards
Bodo
next reply other threads:[~2004-12-22 17:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-22 17:42 Bodo Stroesser [this message]
[not found] <41C9B21F.90802@fujitsu-siemens.com.suse.lists.linux.kernel>
2004-12-22 23:24 ` Andi Kleen
2004-12-22 23:49 ` Bodo Stroesser
2004-12-22 23:54 ` Andi Kleen
2004-12-23 9:33 ` Bodo Stroesser
2004-12-23 11:29 ` Andi Kleen
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=41C9B21F.90802@fujitsu-siemens.com \
--to=bstroesser@fujitsu-siemens.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®