From: Mikael Pettersson <mikpe@it.uu.se>
To: Dave Martin <dave.martin@linaro.org>
Cc: Kautuk Consul <consul.kautuk@gmail.com>,
linux-arm-kernel@lists.infradead.org,
Russell King <linux@arm.linux.org.uk>,
linux-kernel@vger.kernel.org,
"Mohd. Faris" <mohdfarisq2010@gmail.com>
Subject: Re: [PATCH 1/1] arm: vfp: Raising SIGFPE on invalid floating point operation
Date: Fri, 3 Feb 2012 15:45:23 +0100 [thread overview]
Message-ID: <20267.62211.944159.412283@pilspetsen.it.uu.se> (raw)
In-Reply-To: <20120203132717.GB2098@linaro.org>
Dave Martin writes:
> On Fri, Feb 03, 2012 at 02:06:24PM +0530, Kautuk Consul wrote:
> > There is a lot of ARM/VFP hardware which does not invoke the
> > undefined instruction exception handler (i.e. __und_usr) at all
> > even in case of an invalid floating point operation in usermode.
> > For example, 100.0 divided by 0.0 will not lead to the undefined
> > instruction exception being called by the processor although the
> > hardware does reliably set the DZC bit in the FPSCR.
>
> Which revision of the architecture are you referring to?
>
> In VFPv2, I believe that exception trapping is architecturally required
> to work: a CPU which doesn't trap when the corresponding exxception
> enable bits in the FPSCR are set is a wrong implementation.
>
> For VFPv3 and VFPv4 (on ARMv7+), there are two variants specified by the
> architecture: "U" variants VFPv3U/VFPv4U where trapping must work (as in
> VFPv2); and non-trapping variants VFPv3/VFPv4.
>
> The non-trapping variants are common: Cortex-A8 and A9 for example have
> non-trapping VFP implementations.
>
> The architecture specified that writes to those FPSCR bits must be
> ignored, and they must always read as 0, in non-trapping implementations.
If it's documented that non-trapping implementations are allowed,
and that they can be detected by the FPSCR bits being immutable zeros,
then there is no problem here for the kernel to deal with. It's simply
a buggy application or buggy libc that fails to check if the FPU is
trapping or not.
next prev parent reply other threads:[~2012-02-03 14:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-03 8:36 Kautuk Consul
2012-02-03 13:27 ` Dave Martin
2012-02-03 14:37 ` Kautuk Consul
2012-02-03 15:11 ` Russell King - ARM Linux
2012-02-03 14:45 ` Mikael Pettersson [this message]
2012-02-03 13:32 ` Mikael Pettersson
2012-02-03 14:06 ` Russell King - ARM Linux
2012-02-03 14:41 ` Mikael Pettersson
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=20267.62211.944159.412283@pilspetsen.it.uu.se \
--to=mikpe@it.uu.se \
--cc=consul.kautuk@gmail.com \
--cc=dave.martin@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mohdfarisq2010@gmail.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
all inboxes | Powered by JetHome®