PERFORCE change 211452 for review

Robert Watson rwatson at FreeBSD.org
Sun May 20 22:07:20 UTC 2012


http://p4web.freebsd.org/@@211452?ac=10

Change 211452 by rwatson at rwatson_svr_ctsrd_mipsbuild on 2012/05/20 22:06:14

	As a debugging aid, cause capability coprocessor usability faults
	to enter the kernel debugger.  I'm not running into this currently,
	but might do in the future.

Affected files ...

.. //depot/projects/ctsrd/cheribsd/src/sys/mips/mips/trap.c#3 edit
.. //depot/projects/ctsrd/cheribsd/src/sys/sys/kdb.h#2 edit

Differences ...

==== //depot/projects/ctsrd/cheribsd/src/sys/mips/mips/trap.c#3 (text+ko) ====

@@ -831,11 +831,13 @@
 		goto err;
 		break;
 	case T_COP_UNUSABLE:
-#ifdef CPU_CHERI
-	/* XXXRW: CP2 state management here. */
+		cop = (trapframe->cause & MIPS_CR_COP_ERR) >> MIPS_CR_COP_ERR_SHIFT;
+#if defined(CPU_CHERI) && defined(DDB)
+		/* XXXRW: CP2 state management here. */
+		if (cop == 2)
+			kdb_enter(KDB_WHY_CHERI, "T_COP_UNUSABLE exception");
 #endif
 #ifdef	CPU_CNMIPS
-		cop = (trapframe->cause & MIPS_CR_COP_ERR) >> MIPS_CR_COP_ERR_SHIFT;
 		/* Handle only COP2 exception */
 		if (cop != 2)
 			goto err;
@@ -873,6 +875,12 @@
 
 	case T_COP_UNUSABLE + T_USER:
 		cop = (trapframe->cause & MIPS_CR_COP_ERR) >> MIPS_CR_COP_ERR_SHIFT;
+#if defined(CPU_CHERI) && defined(DDB)
+		/* XXXRW: CP2 state management here. */
+		if (cop == 2)
+			kdb_enter(KDB_WHY_CHERI,
+			    "T_COP_UNUSABLE + T_USER exception");
+#endif
 		if (cop == 1) {
 #if !defined(CPU_HAVEFPU)
 		/* FP (COP1) instruction */
@@ -888,9 +896,6 @@
 			goto out;
 #endif
 		}
-#ifdef CPU_CHERI
-		/* XXXRW: CP2 state management here. */
-#endif
 #ifdef	CPU_CNMIPS
 		else  if (cop == 2) {
 			addr = trapframe->pc;

==== //depot/projects/ctsrd/cheribsd/src/sys/sys/kdb.h#2 (text+ko) ====

@@ -109,6 +109,7 @@
 #define	KDB_WHY_POWERPC		"powerpc"	/* Unhandled powerpc intr. */
 #define	KDB_WHY_UNIONFS		"unionfs"	/* Unionfs bug. */
 #define	KDB_WHY_DTRACE		"dtrace"	/* DTrace action entered debugger. */
+#define	KDB_WHY_CHERI		"cheri"		/* CHERI MIPS coprocessor. */
 
 /* Return values for kdb_alt_break */
 #define	KDB_REQ_DEBUGGER	1	/* User requested Debugger */


More information about the p4-projects mailing list