[Top] [All Lists]

Re: [patch] linux: Report the faulting FPU instruction

To: "Maciej W. Rozycki" <>
Subject: Re: [patch] linux: Report the faulting FPU instruction
From: Ralf Baechle <>
Date: Tue, 27 Nov 2001 12:13:37 +1100
In-reply-to: <>; from on Mon, Nov 26, 2001 at 04:28:34PM +0100
References: <>
User-agent: Mutt/1.2.5i
On Mon, Nov 26, 2001 at 04:28:34PM +0100, Maciej W. Rozycki wrote:

>  I believe it's desireable to point to the faulting instruction upon an
> FPU trap and not the following one.  Why?  First, the FPU restores the
> state from before attempting to exectute the instruction.  Second, with
> the current approach state is lost -- consider instructions in branch/jump
> delay slots.  Third, erroneous execution is possible if SIG_FPE's handler
> is set to "ignore" by mistake.
>  The following patch implements the described approach.  It should not
> affect standard handlers which use setjmp()/longjmp(), but it should
> enable a smarter interpreting handler or just better diagnostics.  Both
> the hardware and the emulator are handled.  Tested successfully with gdb
> on an R3k, an R4k and the emulator. 

The problem you found in the FPU emulator is a fairly generic one.  We
got other exception handlers which in error case will still skip over
the instruction.  What also isn't handled properly is the case of sending
a signal to the application.  In such a case sigreturn() should do the
the compute_return_epc() thing ...


<Prev in Thread] Current Thread [Next in Thread>