Date: Mon, 12 Nov 2012 01:37:54 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 219754 for review Message-ID: <201211120137.qAC1bs1U039167@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@219754?ac=10 Change 219754 by rwatson@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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211120137.qAC1bs1U039167>