From: Krzysztof Helt <krzysztof.h1@wp.pl>
To: sparclinux@vger.kernel.org
Subject: FPU context and fork
Date: Wed, 19 Jan 2005 19:48:37 +0000 [thread overview]
Message-ID: <41EEB995.8070402@wp.pl> (raw)
I struggle to build a self-compiled toolchain and glibc for Sparcstation
20 M612. I am running testsuite for both and I run into a failure from
test-fenv test from glibc testsuite. This is a test of FP exceptions
(IEEE 754 compliant) -each exception is disabled or enabled and checked
if a handler is called when the exception is raised.
The test fails with 11 errors on UP kernel 2.4.27. This is probably
incorrect as SuperSparc should be IEEE 754 compliant. But a problem is
that it fails with 21 errors on SMP kernel 2.4.27. I suppose that a
different behavior between UP and SMP version is a serious bug. I see it
is done the same way in 2.6.10 series.
I dug into a problem and found that it comes from not copying the FPU
state in do_fork function. Actually, the FPU is disabled in every new
created task and enabled later when the FPU operation is done. So the
glibc test must have failed, because it enables or disables FP
exceptions than forks and wait for the FP exception signal. After the
fork, the FPU in the new task is initialized to a default state so
rounding and exception settings are lost.
I also observed that a system of handling FPU context reloading is
different in SMP and UP version.
I did a little research on Internet and found that FPU context
initialization and reloading happened to other architectures (MIPS, SH)
too. Various arguments were given how it should be done.
How should it be done? Should copy_flags() during do_fork() preserve
FPU context/registers for child task? Should SMP and UP context
switching be handled differently?
I am eager to fix this,
Krzysztof Helt
next reply other threads:[~2005-01-19 19:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-19 19:48 Krzysztof Helt [this message]
2005-01-19 20:25 ` FPU context and fork David S. Miller
2005-01-19 20:43 ` David S. Miller
2005-01-19 20:46 ` Krzysztof Helt
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=41EEB995.8070402@wp.pl \
--to=krzysztof.h1@wp.pl \
--cc=sparclinux@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.