From owner-svn-src-all@FreeBSD.ORG Thu Mar 29 02:04:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 964811065674; Thu, 29 Mar 2012 02:04:16 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80CBC8FC1B; Thu, 29 Mar 2012 02:04:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2T24G5H070213; Thu, 29 Mar 2012 02:04:16 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2T24Glj070210; Thu, 29 Mar 2012 02:04:16 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203290204.q2T24Glj070210@svn.freebsd.org> From: Juli Mallett Date: Thu, 29 Mar 2012 02:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233638 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2012 02:04:16 -0000 Author: jmallett Date: Thu Mar 29 02:04:15 2012 New Revision: 233638 URL: http://svn.freebsd.org/changeset/base/233638 Log: Disable FP instruction emulation by default on !o32 because of ABI concerns. Note that in practice this isn't needed because we get a coprocessor unusable exception first, but that's actually something like a bug. Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Thu Mar 29 02:03:06 2012 (r233637) +++ head/sys/mips/mips/trap.c Thu Mar 29 02:04:15 2012 (r233638) @@ -290,6 +290,20 @@ static int allow_unaligned_acc = 1; SYSCTL_INT(_vm, OID_AUTO, allow_unaligned_acc, CTLFLAG_RW, &allow_unaligned_acc, 0, "Allow unaligned accesses"); +/* + * FP emulation is assumed to work on O32, but the code is outdated and crufty + * enough that it's a more sensible default to have it disabled when using + * other ABIs. At the very least, it needs a lot of help in using + * type-semantic ABI-oblivious macros for everything it does. + */ +#if defined(__mips_o32) +static int emulate_fp = 1; +#else +static int emulate_fp = 0; +#endif +SYSCTL_INT(_machdep, OID_AUTO, emulate_fp, CTLFLAG_RW, + &allow_unaligned_acc, 0, "Emulate unimplemented FPU instructions"); + static int emulate_unaligned_access(struct trapframe *frame, int mode); extern void fswintrberr(void); /* XXX */ @@ -988,6 +1002,11 @@ dofault: #endif case T_FPE + T_USER: + if (!emulate_fp) { + i = SIGILL; + addr = trapframe->pc; + break; + } MipsFPTrap(trapframe->sr, trapframe->cause, trapframe->pc); goto out;