From owner-p4-projects@FreeBSD.ORG Sat Jul 28 11:54:53 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CDD1A1065670; Sat, 28 Jul 2012 11:54:51 +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 86CD0106566B for ; Sat, 28 Jul 2012 11:54:51 +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 6ED5A8FC0C for ; Sat, 28 Jul 2012 11:54:51 +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 q6SBspIu040742 for ; Sat, 28 Jul 2012 11:54:51 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 q6SBspO6040739 for perforce@freebsd.org; Sat, 28 Jul 2012 11:54:51 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 28 Jul 2012 11:54:51 GMT Message-Id: <201207281154.q6SBspO6040739@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 To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 215043 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 11:54:53 -0000 http://p4web.freebsd.org/@@215043?ac=10 Change 215043 by rwatson@rwatson_svr_ctsrd_mipsbuild on 2012/07/28 11:54:48 Clarify a comment in FreeBSD/mips's low-level exception handling: the SAVE_CPU() and RESTORE_CPU() macros are used only when taking an exception in kernel model, in which case they place the kernel register frame on the stack for further processing (and restore it before continuing). Annotate that one case of SAVE_CPU() is used to save the kernel frame before entering the kernel debugger on a stack overflow. In the future we might want to do something with CP2 EPCC here. No action is required in the mean time, however. Affected files ... .. //depot/projects/ctsrd/cheribsd/src/sys/mips/mips/exception.S#8 edit Differences ... ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/mips/exception.S#8 (text+ko) ==== @@ -262,7 +262,7 @@ #endif /* - * Save CPU and CP0 register state. + * Save CPU and CP0 register state when taking an exception in kernel mode. * * This is straightforward except for saving the exception program * counter. The ddb backtrace code looks for the first instruction @@ -1035,6 +1035,12 @@ REG_S zero, CALLFRAME_SP(sp) move ra, k0 + /* + * XXXCHERI: This SAVE_CPU preserves a kernel register frame before + * entering the kernel debugger on kernel stack overflow. In the + * future, we may want to do something with CP2 EPCC here (e.g., save + * it?). + */ SAVE_CPU /*