From: Andi Kleen <ak@suse.de>
To: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.10-rc3, i386: fpu handling on sigreturn
Date: 23 Dec 2004 00:24:45 +0100 [thread overview]
Message-ID: <p73mzw5zzk2.fsf@verdi.suse.de> (raw)
In-Reply-To: <41C9B21F.90802@fujitsu-siemens.com.suse.lists.linux.kernel>
Bodo Stroesser <bstroesser@fujitsu-siemens.com> writes:
>
> Now, the interrupted processes fpu no longer is cleared!
I agree it's a bug, although it's probably pretty obscure so people
didn't notice it. The right fix would be to just clear_fpu again
in this case. The problem has been in Linux forever.
Here's an untested patch for i386 and x86-64.
-Andi
diff -u linux-2.6.10rc2-time/arch/i386/kernel/signal.c-o linux-2.6.10rc2-time/arch/i386/kernel/signal.c
--- linux-2.6.10rc2-time/arch/i386/kernel/signal.c-o 2004-11-15 12:34:25.000000000 +0100
+++ linux-2.6.10rc2-time/arch/i386/kernel/signal.c 2004-12-23 00:07:18.000000000 +0100
@@ -190,7 +190,8 @@
if (verify_area(VERIFY_READ, buf, sizeof(*buf)))
goto badframe;
err |= restore_i387(buf);
- }
+ } else if (current->used_math)
+ clear_fpu(current);
}
err |= __get_user(*peax, &sc->eax);
diff -u linux-2.6.10rc2-time/arch/x86_64/kernel/signal.c-o linux-2.6.10rc2-time/arch/x86_64/kernel/signal.c
--- linux-2.6.10rc2-time/arch/x86_64/kernel/signal.c-o 2004-10-19 01:55:08.000000000 +0200
+++ linux-2.6.10rc2-time/arch/x86_64/kernel/signal.c 2004-12-23 00:07:19.000000000 +0100
@@ -125,7 +125,8 @@
if (verify_area(VERIFY_READ, buf, sizeof(*buf)))
goto badframe;
err |= restore_i387(buf);
- }
+ } else if (current->used_math)
+ clear_fpu(current);
}
err |= __get_user(*prax, &sc->rax);
diff -u linux-2.6.10rc2-time/arch/x86_64/ia32/ia32_signal.c-o linux-2.6.10rc2-time/arch/x86_64/ia32/ia32_signal.c
--- linux-2.6.10rc2-time/arch/x86_64/ia32/ia32_signal.c-o 2004-10-19 01:55:08.000000000 +0200
+++ linux-2.6.10rc2-time/arch/x86_64/ia32/ia32_signal.c 2004-12-23 00:07:17.000000000 +0100
@@ -261,7 +261,8 @@
if (verify_area(VERIFY_READ, buf, sizeof(*buf)))
goto badframe;
err |= restore_i387_ia32(current, buf, 0);
- }
+ } else if (current->used_math)
+ clear_fpu(current);
}
{
next parent reply other threads:[~2004-12-22 23:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <41C9B21F.90802@fujitsu-siemens.com.suse.lists.linux.kernel>
2004-12-22 23:24 ` Andi Kleen [this message]
2004-12-22 23:49 ` 2.6.10-rc3, i386: fpu handling on sigreturn Bodo Stroesser
2004-12-22 23:54 ` Andi Kleen
2004-12-23 9:33 ` Bodo Stroesser
2004-12-23 11:29 ` Andi Kleen
2004-12-22 17:42 Bodo Stroesser
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=p73mzw5zzk2.fsf@verdi.suse.de \
--to=ak@suse.de \
--cc=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