Module Name:    src
Committed By:   mhitch
Date:           Sun Sep  6 18:06:24 UTC 2009

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

Log Message:
There's now some per-cpu initialization that occurs before the secondary
cpus are told to begin running.  Since the seconedary cpus weren't being
added to the cpu_info list until then, that initialization wasn't being
done and resulted in crashes on the secondary cpus.  Add the secondary
cpus to the cpu_info_list after they've been started (but waiting to be
told to start running).  This fixes the problem specifically stated in
PR port-alpha/41106.  MP alphas will now at least boot and begin running,
but will eventually crash in various ways later.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/alpha/alpha/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/alpha/alpha/cpu.c
diff -u src/sys/arch/alpha/alpha/cpu.c:1.85 src/sys/arch/alpha/alpha/cpu.c:1.86
--- src/sys/arch/alpha/alpha/cpu.c:1.85	Sat Mar 14 15:35:59 2009
+++ src/sys/arch/alpha/alpha/cpu.c	Sun Sep  6 18:06:24 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.85 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: cpu.c,v 1.86 2009/09/06 18:06:24 mhitch Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.85 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.86 2009/09/06 18:06:24 mhitch Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -331,6 +331,12 @@
 		 * on its merry way.
 		 */
 		cpu_boot_secondary(ci);
+
+		/*
+		 * Link the processor into the list.
+		 */
+		ci->ci_next = cpu_info_list->ci_next;
+		cpu_info_list->ci_next = ci;
 #else /* ! MULTIPROCESSOR */
 		printf("%s: processor off-line; multiprocessor support "
 		    "not present in kernel\n", sc->sc_dev.dv_xname);
@@ -404,10 +410,8 @@
 		}
 
 		/*
-		 * Link the processor into the list, and launch it.
+		 * Launch the processor.
 		 */
-		ci->ci_next = cpu_info_list->ci_next;
-		cpu_info_list->ci_next = ci;
 		atomic_or_ulong(&ci->ci_flags, CPUF_RUNNING);
 		atomic_or_ulong(&cpus_running, (1U << i));
 	}

Reply via email to