Module Name:    src
Committed By:   matt
Date:           Tue May  4 17:14:17 UTC 2010

Modified Files:
        src/sys/arch/mips/mips [matt-nb5-mips64]: pmap_tlb.c

Log Message:
Make sure to deactivate ASIDs on pmap destruction even on UP kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 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.1.2.10 src/sys/arch/mips/mips/pmap_tlb.c:1.1.2.11
--- src/sys/arch/mips/mips/pmap_tlb.c:1.1.2.10	Thu Mar 11 08:19:01 2010
+++ src/sys/arch/mips/mips/pmap_tlb.c	Tue May  4 17:14:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.1.2.10 2010/03/11 08:19:01 matt Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.1.2.11 2010/05/04 17:14:17 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.1.2.10 2010/03/11 08:19:01 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.1.2.11 2010/05/04 17:14:17 matt Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -797,14 +797,16 @@
 		TLBINFO_UNLOCK(ti);
 		atomic_and_ulong(&ci->ci_flags, ~CPUF_USERPMAP);
 	}
+#elif defined(DEBUG)
+	tlb_set_asid(0);
 #endif
 }
 
 void
 pmap_tlb_asid_release_all(struct pmap *pm)
 {
-#ifdef MULTIPROCESSOR
 	KASSERT(pm != pmap_kernel());
+#ifdef MULTIPROCESSOR
 	KASSERT(pm->pm_onproc == 0);
 	for (u_int i = 0; pm->pm_active != 0; i++) {
 		KASSERT(i < pmap_ntlbs);
@@ -817,6 +819,18 @@
 			TLBINFO_UNLOCK(ti);
 		}
 	}
+#else
+	/*
+	 * Handle the case of an UP kernel which only has, at most, one ASID.
+	 * If the pmap has an ASID allocated, free it.
+	 */
+	struct pmap_tlb_info * const ti = curcpu()->ci_tlb_info;
+	struct pmap_asid_info * const pai = PMAP_PAI(pm, ti);
+	TLBINFO_LOCK(ti);
+	if (pai->pai_asid) {
+		pmap_pai_reset(ti, pai, pm);
+	}
+	TLBINFO_UNLOCK(ti);
 #endif /* MULTIPROCESSOR */
 }
 

Reply via email to