PERFORCE change 219754 for review

Robert Watson rwatson at FreeBSD.org
Mon Nov 12 01:37:55 UTC 2012


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

Change 219754 by rwatson at rwatson_zenith_cl_cam_ac_uk on 2012/11/12 01:37:04

	When printing an instruction that has triggered an invalid
	instruction exception, use the saved EPCC for userspace to
	interpret the PC, rather than the active KDC.  This is not
	quite right, as interrupts are enabled so we might use the
	wrong EPCC, but that is fairly unlikely and allows us to
	make useful progress in the mean time.  Comment along these
	lines.

Affected files ...

.. //depot/projects/ctsrd/cheribsd/src/sys/mips/mips/trap.c#12 edit

Differences ...

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

@@ -880,7 +880,21 @@
 	case T_RES_INST + T_USER:
 		{
 			InstFmt inst;
+#ifdef CPU_CHERI
+			uint32_t i;
+
+			/*
+			 * XXXRW: We really need a cfuword(), and also to use
+			 * a frame-extracted EPCC rather than the live one, as
+			 * we may have taken a further exception if interrupts
+			 * are enabled.  However, this helps with debugging in
+			 * the mean time.
+			 */
+			CHERI_CLW(i, trapframe->pc, 0, CHERI_CR_EPCC);
+			inst = *(InstFmt *)(&i);
+#else
 			inst = *(InstFmt *)(intptr_t)trapframe->pc;
+#endif
 			switch (inst.RType.op) {
 			case OP_SPECIAL3:
 				switch (inst.RType.func) {


More information about the p4-projects mailing list