PERFORCE change 215043 for review

Robert Watson rwatson at FreeBSD.org
Sat Jul 28 11:54:53 UTC 2012


http://p4web.freebsd.org/@@215043?ac=10

Change 215043 by rwatson at 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
 
 	/*


More information about the p4-projects mailing list