Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Dec 2007 16:59:02 GMT
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 130550 for review
Message-ID:  <200712091659.lB9Gx2eZ052995@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=130550

Change 130550 by gonzo@gonzo_jeeves on 2007/12/09 16:58:33

	o Panic in case of bus error/address error exceptions from 
	    kernel land. More sophisticated check should be applied, like
	    check if it's userland address in kernel mode or pure kernel 
	    exception. But on the moment this stub will do the trick and 
	    eliminate deadlock on unaligned access to KVA.

Affected files ...

.. //depot/projects/mips2/src/sys/mips/mips/trap.c#23 edit

Differences ...

==== //depot/projects/mips2/src/sys/mips/mips/trap.c#23 (text+ko) ====

@@ -281,21 +281,17 @@
 		goto done;
 		break;
 
-	case TrAdEL:
-	case TrDBE:
-		if (trap_error == -1/* && trap_addr == badvaddr*/) {
-			/*
-			 * XXX Would like to check trap_addr==badvaddr,
-			 * but it doesn't seem that CPUs set that in the DBE
-			 * case :(
-			 *
-			 * XXX do an onfault thing like other ports?
-			 */
-			trap_error = EINVAL;
-			tf->tf_regs[TF_EPC] += 4;
-			goto done;
-		}
-		call_trapsignal(curthread, SIGSEGV, 0);
+	case TrAdEL + TrUser:
+	case TrAdES + TrUser:
+	case TrDBE + TrUser:
+	case TrIBE + TrUser:
+		/* 
+		 * XXX: On the moment just deliver SIGBUS to userland apps
+		 * and panic if it's kernelland exception. Otherwise we'll
+		 * get alignment issues silently ignored and deadlock as a 
+		 * result.
+		 */
+		call_trapsignal(curthread, SIGBUS, 0);
 		goto done;	
 		break;
 	default:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712091659.lB9Gx2eZ052995>