PERFORCE change 130550 for review

Oleksandr Tymoshenko gonzo at FreeBSD.org
Sun Dec 9 08:59:02 PST 2007


http://perforce.freebsd.org/chv.cgi?CH=130550

Change 130550 by gonzo at 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:


More information about the p4-projects mailing list