Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/alpha/alpha There's now some per-cpu initialization...



details:   https://anonhg.NetBSD.org/src/rev/ccbb835facfb
branches:  trunk
changeset: 747227:ccbb835facfb
user:      mhitch <mhitch%NetBSD.org@localhost>
date:      Sun Sep 06 18:06:24 2009 +0000

description:
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.

diffstat:

 sys/arch/alpha/alpha/cpu.c |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (43 lines):

diff -r bb8405ec4109 -r ccbb835facfb sys/arch/alpha/alpha/cpu.c
--- a/sys/arch/alpha/alpha/cpu.c        Sun Sep 06 17:59:09 2009 +0000
+++ b/sys/arch/alpha/alpha/cpu.c        Sun Sep 06 18:06:24 2009 +0000
@@ -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));
        }



Home | Main Index | Thread Index | Old Index