public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Zary <linux@rainbow-software.org>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: FPU-intensive programs crashing with floating point exception on Cyrix MII
Date: Wed, 17 Aug 2005 18:13:55 +0200	[thread overview]
Message-ID: <43036243.5070100@rainbow-software.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1081 bytes --]

My machine (Cyrix MII PR300 CPU, PCPartner TXB820DS board with i430TX 
chipset) exhibits a really weird problem:
When I run a program that uses FPU, it sometimes crashes with "flaoting 
point exception" - for example, when playing MP3 files using any player. 
Or with Prime95 - http://www.mersenne.org/freesoft.htm - the "torture 
test" does not crash but shows "fatal error" in less than 10 minutes.
It might be something like this:
http://lists.suse.com/archive/suse-linux-e/2000-Sep/1080.html
or this
http://lists.slug.org.au/archives/slug/2000/11/msg00343.html

The problem appears on 2.4.x kernels and 2.6.x kernels. It works fine in 
Windows 98 - it can play MP3s and run Prime95 for hours without any 
problems.
I've tracked it down to math_error() in arch/i386/kernel/traps.c and 
"fixed" it (I really don't know anything about FPU programming). The 
patch is attached. It fixes my system - with the patch, I can play MP3s 
fine and Prime95 runs without any problems too.

Does anyone know why these exceptions happen and/or what's the correct 
solution?

-- 
Ondrej Zary


[-- Attachment #2: cyrix-math.patch --]
[-- Type: text/plain, Size: 530 bytes --]

--- linux-2.6.10/arch/i386/kernel/traps.c~	2004-12-25 12:02:03.000000000 +0100
+++ linux-2.6.10/arch/i386/kernel/traps.c	2004-12-25 12:02:03.000000000 +0100
@@ -790,8 +790,11 @@
 	 */
 	cwd = get_fpu_cwd(task);
 	swd = get_fpu_swd(task);
+	printk("MATH ERROR %d\n",((~cwd) & swd & 0x3f) | (swd & 0x240));
 	switch (((~cwd) & swd & 0x3f) | (swd & 0x240)) {
-		case 0x000:
+		case 0x000: /* Hack for Cyrix problems */
+		case 0x200:
+			return;                                
 		default:
 			break;
 		case 0x001: /* Invalid Op */

             reply	other threads:[~2005-08-17 16:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-17 16:13 Ondrej Zary [this message]
2005-08-17 17:08 ` FPU-intensive programs crashing with floating point exception on Cyrix MII linux-os (Dick Johnson)
  -- strict thread matches above, loose matches on Subject: below --
2005-08-17 18:49 Chuck Ebbert
2005-08-18 10:37 ` Ondrej Zary
2005-08-21  9:47 Chuck Ebbert
2005-08-21 17:52 ` Linus Torvalds
2005-08-21 21:28   ` Ondrej Zary
2005-08-21 23:10     ` 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=43036243.5070100@rainbow-software.org \
    --to=linux@rainbow-software.org \
    --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