PERFORCE change 102998 for review

John Birrell jb at FreeBSD.org
Wed Aug 2 06:47:33 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=102998

Change 102998 by jb at jb_freebsd2 on 2006/08/02 06:47:22

	Save the %pc and %tick registers in the per-cpu structure for debug
	purposes while trying to track down the problem of the wandering
	CPU taking up gardening.
	
	In the sun4v_stable tree, this change actually stopped the panic
	from happening, but that can't be because anything is fixed here...
	just that something has changed.

Affected files ...

.. //depot/projects/dtrace/src/sys/sun4v/sun4v/interrupt.S#4 edit

Differences ...

==== //depot/projects/dtrace/src/sys/sun4v/sun4v/interrupt.S#4 (text+ko) ====

@@ -29,6 +29,7 @@
 __FBSDID("$FreeBSD: src/sys/sparc64/sparc64/interrupt.S,v 1.8 2005/04/16 15:05:56 marius Exp $");
 
 #include "opt_simulator.h"
+#include "opt_trap_trace.h"
 #include <machine/hypervisorvar.h>
 #include <machine/asi.h>
 #include <machine/asmacros.h>
@@ -437,6 +438,25 @@
 	membar	#Sync
 	GET_PCPU_PHYS_SCRATCH(%g6)
 	wr	%g0, ASI_REAL, %asi
+
+#ifdef TRAP_TRACING
+	/* pcpu->pad[0] = %pc */
+	rd	%pc, %g4
+	stxa	%g4, [PCPU(PAD)]%asi
+
+	/* pcpu->pad[1] = %tick */
+	rdpr	%tick, %g4
+	stxa    %g4, [PCPU(PAD) + 8]%asi
+
+	/*
+	 * Increment a counter which might help us notice if we're
+	 * stuck in a loop. pcpu->pad[2] = count
+	 */
+	ldxa	[PCPU(PAD) + 16]%asi, %g4
+	add	%g4, 1, %g4
+	stxa    %g4, [PCPU(PAD) + 16]%asi
+#endif
+
 	lda	[PCPU(CPUMASK)]%asi, %g4
 	lda	[%g3]%asi, %g1
 1:	or	%g1, %g4, %g2


More information about the p4-projects mailing list