Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/x86 Sync cpu_boot_secondary_processors() with x...



details:   https://anonhg.NetBSD.org/src/rev/9ada835c5e36
branches:  trunk
changeset: 834029:9ada835c5e36
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Tue Jul 24 12:24:45 2018 +0000

description:
Sync cpu_boot_secondary_processors() with x86/x86/cpu.c:
explicitely wait for all CPUs to be registered in kcpuset_running.

diffstat:

 sys/arch/xen/x86/cpu.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r 59111adc9e08 -r 9ada835c5e36 sys/arch/xen/x86/cpu.c
--- a/sys/arch/xen/x86/cpu.c    Tue Jul 24 10:08:43 2018 +0000
+++ b/sys/arch/xen/x86/cpu.c    Tue Jul 24 12:24:45 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.122 2018/06/23 10:30:22 jdolecek Exp $       */
+/*     $NetBSD: cpu.c,v 1.123 2018/07/24 12:24:45 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.122 2018/06/23 10:30:22 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.123 2018/07/24 12:24:45 bouyer Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -583,7 +583,11 @@
 cpu_boot_secondary_processors(void)
 {
        struct cpu_info *ci;
+       kcpuset_t *cpus;
        u_long i;
+
+       kcpuset_create(&cpus, true);
+       kcpuset_set(cpus, cpu_index(curcpu()));
        for (i = 0; i < maxcpus; i++) {
                ci = cpu_lookup(i);
                if (ci == NULL)
@@ -595,7 +599,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