linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: Add emulation for fpureg-mem unaligned access

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH] MIPS: Add emulation for fpureg-mem unaligned access
From: Lluís Batlle i Rossell <viric@viric.name>
Date: Tue, 31 Jul 2012 16:07:23 +0200
Cc: linux-mips@linux-mips.org, loongson-dev@googlegroups.com
In-reply-to: <20120731134001.GA14151@linux-mips.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Mail-followup-to: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org, loongson-dev@googlegroups.com
References: <20120615234641.6938B58FE7C@mail.viric.name> <20120731134001.GA14151@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.20 (2009-06-14)
On Tue, Jul 31, 2012 at 03:40:01PM +0200, Ralf Baechle wrote:
> On Sat, Jun 16, 2012 at 12:22:53AM +0200, Lluis Batlle i Rossell wrote:
> 
> > Reusing most of the code from lw,ld,sw,sd emulation,
> > I add the emulation for lwc1,ldc1,swc1,sdc1.
> > 
> > This avoids the direct SIGBUS sent to userspace processes that have
> > misaligned memory accesses.
> > 
> > I've tested the change in Loongson2F, with an own test program, and
> > WebKit 1.4.0, as both were killed by sigbus without this patch.
> 
> A misaligned FPU access is a strong indication for broken, non-portable
> software.  which means you're likely trying to fix the wrong issue.  It's
> quite intentional that there is no unaligned handling for the FPU in the
> kernel - and afaics there isn't for any other MIPS UNIX.

Ah, I had no idea it was intentional. 

Maybe there could be a cleaner declaration of that intention, though. The only
code there was "I herewith declare: this does not happen.  So send SIGBUS."

Thank you,
Lluís.

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