From owner-p4-projects@FreeBSD.ORG Wed Nov 7 01:36:49 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2B08BFC0; Wed, 7 Nov 2012 01:36:49 +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 DBC86FBE for ; Wed, 7 Nov 2012 01:36:48 +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 C11038FC0C for ; Wed, 7 Nov 2012 01:36:48 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id qA71am1w088731 for ; Wed, 7 Nov 2012 01:36:48 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id qA71ame4088728 for perforce@freebsd.org; Wed, 7 Nov 2012 01:36:48 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 7 Nov 2012 01:36:48 GMT Message-Id: <201211070136.qA71ame4088728@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 219636 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: Wed, 07 Nov 2012 01:36:49 -0000 http://p4web.freebsd.org/@@219636?ac=10 Change 219636 by rwatson@rwatson_svr_ctsrd_mipsbuild on 2012/11/07 01:36:08 Improve CPU_CHERI ifdefing for C2E exception handler so that BERI, not just CHERI, kernels build. Print out more information about a userspace C2E exception when one occurs -- what program, etc -- consistent with other exception messages from the kernel (e.g., page fault). Affected files ... .. //depot/projects/ctsrd/cheribsd/src/sys/mips/mips/trap.c#11 edit Differences ... ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/mips/trap.c#11 (text+ko) ==== @@ -129,7 +129,9 @@ static void log_illegal_instruction(const char *, struct trapframe *); static void log_bad_page_fault(char *, struct trapframe *, int); +#ifdef CPU_CHERI static void log_c2e_exception(const char *, struct trapframe *, int); +#endif static void log_frame_dump(struct trapframe *frame); static void get_mapping_info(vm_offset_t, pd_entry_t **, pt_entry_t **); @@ -1550,6 +1552,11 @@ #ifdef SMP printf("cpuid = %d\n", PCPU_GET(cpuid)); #endif + log(LOG_ERR, "%s: pid %d tid %ld (%s), uid %d: CP2 fault " + "(type %#x)\n", + msg, curproc->p_pid, (long)curthread->td_tid, curproc->p_comm, + curproc->p_ucred ? curproc->p_ucred->cr_uid : -1, + trap_type); /* log registers in trap frame */ log_frame_dump(frame);