Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Jul 2012 11:54:51 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 215043 for review
Message-ID:  <201207281154.q6SBspO6040739@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
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
 
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207281154.q6SBspO6040739>