From owner-p4-projects@FreeBSD.ORG Mon Nov 12 01:37:55 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 90420B83; Mon, 12 Nov 2012 01:37:55 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 520FCB81 for ; Mon, 12 Nov 2012 01:37:55 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 36E018FC08 for ; Mon, 12 Nov 2012 01:37:55 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id qAC1btAr039170 for ; Mon, 12 Nov 2012 01:37:55 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id qAC1bs1U039167 for perforce@freebsd.org; Mon, 12 Nov 2012 01:37:54 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 12 Nov 2012 01:37:54 GMT Message-Id: <201211120137.qAC1bs1U039167@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219754 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 01:37:55 -0000 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) {