Module Name:    src
Committed By:   cherry
Date:           Sat Nov 22 06:45:08 UTC 2014

Modified Files:
        src/sys/arch/x86/x86: pmap.c

Log Message:
Wait until all cpus are online, before using the codepath
which syncs all per-cpu cached copies of L4 tables.
(On both x86_64 and i386/pae)

This avoids an early bootup mutex use before mutex init situation.

Reported by manu@


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/sys/arch/x86/x86/pmap.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/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.184 src/sys/arch/x86/x86/pmap.c:1.185
--- src/sys/arch/x86/x86/pmap.c:1.184	Tue Oct 14 06:59:58 2014
+++ src/sys/arch/x86/x86/pmap.c	Sat Nov 22 06:45:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.184 2014/10/14 06:59:58 bouyer Exp $	*/
+/*	$NetBSD: pmap.c,v 1.185 2014/11/22 06:45:08 cherry Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.184 2014/10/14 06:59:58 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.185 2014/11/22 06:45:08 cherry Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -4187,8 +4187,7 @@ pmap_alloc_level(pd_entry_t * const *pde
 			pmap_pte_set(&pdep[i], pte);
 #if defined(PAE) || defined(__x86_64__)
 			if (level == PTP_LEVELS && i >= PDIR_SLOT_KERN) {
-				if (__predict_true(
-				    cpu_info_primary.ci_flags & CPUF_PRESENT)) {
+			  if (__predict_true(mp_online == true)) {
 					/* update per-cpu PMDs on all cpus */
 					xen_kpm_sync(pmap_kernel(), i);
 				} else {

Reply via email to