Module Name: src
Committed By: bouyer
Date: Tue Jul 24 12:24:45 UTC 2018
Modified Files:
src/sys/arch/xen/x86: cpu.c
Log Message:
Sync cpu_boot_secondary_processors() with x86/x86/cpu.c:
explicitely wait for all CPUs to be registered in kcpuset_running.
To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/arch/xen/x86/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/xen/x86/cpu.c
diff -u src/sys/arch/xen/x86/cpu.c:1.122 src/sys/arch/xen/x86/cpu.c:1.123
--- src/sys/arch/xen/x86/cpu.c:1.122 Sat Jun 23 10:30:22 2018
+++ src/sys/arch/xen/x86/cpu.c Tue Jul 24 12:24:45 2018
@@ -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 @@ void
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 @@ cpu_boot_secondary_processors(void)
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;
}