[Top] [All Lists]

Re: float crash

To: "Kjeld Borch Egevang" <>, "Brad Parker" <>
Subject: Re: float crash
From: "Kevin D. Kissell" <>
Date: Sat, 8 Jun 2002 15:51:27 +0200
Cc: "linux-mips mailing list" <>
References: <>
The FP sr value does of course get initialized by default,
but the bug which Kjeld identified could prevent it.
The proper initialization of the emulated FPU state is
done only if last_task_used_math != current, under
the assumption that if the current task is the last task
to have used the "FPU", the current emulation cannot
be its first.  But in exit_thread()/flush_thread(), we
set last_task_used_math to NULL only if we have
an FPU.  Kjeld's patch breaks down the code so
that the *hardware* shutdown is done only if there
is an FPU, but the clearing of last_task_used_math
must be done whenever the current process has done FP.
Sorry about my offhand remark about no understanding
its relevance in my earlier response about the usefulness
of cfc1 $0,$31.

Without Kjeld's patch, a process inheriting a thread
context slot from a process which had done FP
emulation would have inherited the FP register 
state, including SR, of that previous process.
If you're seeing the problem only *with* Kjeld's
patch, there must have been a typo inserted in
the chain somewhere...

            Kevin K.

----- Original Message ----- 
From: "Brad Parker" <>
To: "Kjeld Borch Egevang" <>; "Kevin D. Kissell" 
Cc: "linux-mips mailing list" <>
Sent: Saturday, June 08, 2002 2:40 PM
Subject: re: float crash

> Quick question -
> I'm running a 2.4.17 kernel on an Au1000 (MIPS32).  Trying to run
> Kaffe I get SIGFPE's in odd places (like dividing 11 by 44).  I tracked
> it down to the fpe emulator setting the cx bit which is setting
> the "inexact" bit in the fp status reg.  
> I think the real problem is that the fp sr is not being initialized.
> It doesn't happen in a trivial program but in Kaffe it happens a lot.
> it's somewhat random, however, as if something is not initialized.
> I wonder if the fix you two where talking about is the problem; i.e.
> in traps.c "if (last_task_used_math != current) {"
> Is there a recommended fix?  Just comment out the test?
> thanks!
> -brad
> ps: I tried to subscribe to the linux-mips list but the sendmail on
> is rejecting my email with "access denied".  I don't have
> any open relays and I'm not a spammer :-)  I can't even send email
> to the postmaster...

<Prev in Thread] Current Thread [Next in Thread>
  • Re: float crash, Kevin D. Kissell <=