Module Name:    src
Committed By:   mrg
Date:           Sun Feb 20 11:41:20 UTC 2011

Modified Files:
        src/sys/arch/sparc/sparc: cpu.c

Log Message:
add some #if 0'ed code to turn the xcall() timeout into a hard panic.
probably put this under DIAGNOSTIC when it is later properly working.


To generate a diff of this commit:
cvs rdiff -u -r1.231 -r1.232 src/sys/arch/sparc/sparc/cpu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc/sparc/cpu.c
diff -u src/sys/arch/sparc/sparc/cpu.c:1.231 src/sys/arch/sparc/sparc/cpu.c:1.232
--- src/sys/arch/sparc/sparc/cpu.c:1.231	Sun Feb 20 10:02:01 2011
+++ src/sys/arch/sparc/sparc/cpu.c	Sun Feb 20 11:41:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.231 2011/02/20 10:02:01 mrg Exp $ */
+/*	$NetBSD: cpu.c,v 1.232 2011/02/20 11:41:20 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.231 2011/02/20 10:02:01 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.232 2011/02/20 11:41:20 mrg Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_lockdebug.h"
@@ -742,6 +742,30 @@
 	if (i < 0)
 		printf_nolog("%s\n", errbuf);
 	mutex_spin_exit(&xpmsg_mutex);
+
+#if 0
+	if (!timeout)
+		return;
+
+	/*
+	 * Let's make this a hard panic for now, and figure out why it happens.
+	 *
+	 * We call mp_pause_cpus() so we can capture their state *now* as opposed
+	 * to after we've written all the below to the console.
+	 */
+#ifdef DDB
+	mp_pause_cpus_ddb();
+#else
+	mp_pause_cpus();
+#endif
+	printf_nolog("xcall(cpu%d,%p) from %p: couldn't ping cpus:",
+	    cpu_number(), fasttrap ? trap : func, __builtin_return_address(0));
+	for (CPU_INFO_FOREACH(n, cpi))
+		if ((failed_cpuset & (1 << n)) == 0)
+			printf_nolog(" cpu%d", cpi->ci_cpuid);
+	printf_nolog("%s\n", i == 10000000 ? " [hard 10M timeout]" : "");
+	panic("failed to ping cpus");
+#endif
 }
 
 /*

Reply via email to