Module Name: src
Committed By: riz
Date: Thu Jul 5 17:52:54 UTC 2012
Modified Files:
src/sys/arch/x86/x86 [netbsd-6]: cpu.c
Log Message:
Pull up following revision(s) (requested by chs in ticket #400):
sys/arch/x86/x86/cpu.c: revision 1.100
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.
To generate a diff of this commit:
cvs rdiff -u -r1.96.8.2 -r1.96.8.3 src/sys/arch/x86/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/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.96.8.2 src/sys/arch/x86/x86/cpu.c:1.96.8.3
--- src/sys/arch/x86/x86/cpu.c:1.96.8.2 Wed May 9 03:22:53 2012
+++ src/sys/arch/x86/x86/cpu.c Thu Jul 5 17:52:54 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.96.8.2 2012/05/09 03:22:53 riz Exp $ */
+/* $NetBSD: cpu.c,v 1.96.8.3 2012/07/05 17:52:54 riz Exp $ */
/*-
* Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.96.8.2 2012/05/09 03:22:53 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.96.8.3 2012/07/05 17:52:54 riz Exp $");
#include "opt_ddb.h"
#include "opt_mpbios.h" /* for MPDEBUG */
@@ -589,12 +589,15 @@ void
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 @@ 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;