Module Name:    src
Committed By:   matt
Date:           Wed Apr  6 05:35:37 UTC 2011

Modified Files:
        src/sys/arch/mips/mips: pmap_tlb.c

Log Message:
Fix a bug with pmap_remove_all and pmap_deactivate.  Should prevent any
pmap_activate from allocating an ASID while doing pmap_remove_all XXX.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/mips/pmap_tlb.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/mips/mips/pmap_tlb.c
diff -u src/sys/arch/mips/mips/pmap_tlb.c:1.3 src/sys/arch/mips/mips/pmap_tlb.c:1.4
--- src/sys/arch/mips/mips/pmap_tlb.c:1.3	Tue Mar 15 07:32:53 2011
+++ src/sys/arch/mips/mips/pmap_tlb.c	Wed Apr  6 05:35:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.3 2011/03/15 07:32:53 matt Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.4 2011/04/06 05:35:37 matt Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.3 2011/03/15 07:32:53 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.4 2011/04/06 05:35:37 matt Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -806,9 +806,11 @@
 #ifdef MULTIPROCESSOR
 	/*
 	 * The kernel pmap is aways onproc and active and must never have
-	 * those bits cleared.
+	 * those bits cleared.  If pmap_remove_all was called, it has already
+	 * deactivated the pmap and thusly onproc will be 0 so there's nothing
+	 * to do.
 	 */
-	if (pm != pmap_kernel()) {
+	if (pm != pmap_kernel() && pm->pm_onproc != 0) {
 		struct cpu_info * const ci = curcpu();
 		struct pmap_tlb_info * const ti = ci->ci_tlb_info;
 		const uint32_t cpu_mask = 1 << cpu_index(ci);

Reply via email to