Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 in cpu_boot_secondary_processors(), wait un...



details:   https://anonhg.NetBSD.org/src/rev/9bb894e403ab
branches:  trunk
changeset: 779960:9bb894e403ab
user:      chs <chs%NetBSD.org@localhost>
date:      Mon Jul 02 01:05:48 2012 +0000

description:
in cpu_boot_secondary_processors(), wait until all the other CPUs
have registered themselves in kcpuset_running before returning.
recent changes to the TLB invalidation xcall code assume that
any CPU which will receive a broadcast IPI is registered in
kcpuset_running, so ensure that is true by waiting here.

diffstat:

 sys/arch/x86/x86/cpu.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r 732928816800 -r 9bb894e403ab sys/arch/x86/x86/cpu.c
--- a/sys/arch/x86/x86/cpu.c    Sun Jul 01 23:21:06 2012 +0000
+++ b/sys/arch/x86/x86/cpu.c    Mon Jul 02 01:05:48 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.99 2012/06/12 17:14:19 yamt Exp $    */
+/*     $NetBSD: cpu.c,v 1.100 2012/07/02 01:05:48 chs Exp $    */
 
 /*-
  * Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.99 2012/06/12 17:14:19 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.100 2012/07/02 01:05:48 chs Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"                /* for MPDEBUG */
@@ -589,12 +589,15 @@
 cpu_boot_secondary_processors(void)
 {
        struct cpu_info *ci;
+       kcpuset_t *cpus;
        u_long i;
 
        /* Now that we know the number of CPUs, patch the text segment. */
        x86_patch(false);
 
-       for (i=0; i < maxcpus; i++) {
+       kcpuset_create(&cpus, true);
+       kcpuset_set(cpus, cpu_index(curcpu()));
+       for (i = 0; i < maxcpus; i++) {
                ci = cpu_lookup(i);
                if (ci == NULL)
                        continue;
@@ -605,7 +608,11 @@
                if (ci->ci_flags & (CPUF_BSP|CPUF_SP|CPUF_PRIMARY))
                        continue;
                cpu_boot_secondary(ci);
+               kcpuset_set(cpus, cpu_index(ci));
        }
+       while (!kcpuset_match(cpus, kcpuset_running))
+               ;
+       kcpuset_destroy(cpus);
 
        x86_mp_online = true;
 



Home | Main Index | Thread Index | Old Index