Module Name:    src
Committed By:   uebayasi
Date:           Thu Dec 31 02:36:14 UTC 2009

Modified Files:
        src/sys/arch/arm/arm32: pmap.c

Log Message:
Correct assertions for PMAP_CACHE_VIPT code; if page coloring is disabled
(arm_cache_prefer_mask == 0), pvh_attrs has never PVF_COLORED, so don't assert
it.  No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.206 -r1.207 src/sys/arch/arm/arm32/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/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.206 src/sys/arch/arm/arm32/pmap.c:1.207
--- src/sys/arch/arm/arm32/pmap.c:1.206	Mon Dec 28 15:13:57 2009
+++ src/sys/arch/arm/arm32/pmap.c	Thu Dec 31 02:36:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.206 2009/12/28 15:13:57 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.207 2009/12/31 02:36:14 uebayasi Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -211,7 +211,7 @@
 #include <machine/param.h>
 #include <arm/arm32/katelib.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.206 2009/12/28 15:13:57 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.207 2009/12/31 02:36:14 uebayasi Exp $");
 
 #ifdef PMAP_DEBUG
 
@@ -1919,7 +1919,7 @@
 		KASSERT((pg->mdpage.pvh_attrs & PVF_DMOD) == 0 || (pg->mdpage.pvh_attrs & (PVF_DIRTY|PVF_NC)));
 		KASSERT((rw_mappings == 0) == !(pg->mdpage.pvh_attrs & PVF_WRITE));
 	} else if (!va) {
-		KASSERT(pmap_is_page_colored_p(pg));
+		KASSERT(arm_cache_prefer_mask == 0 || pmap_is_page_colored_p(pg));
 		KASSERT(!(pg->mdpage.pvh_attrs & PVF_WRITE)
 		    || (pg->mdpage.pvh_attrs & PVF_DIRTY));
 		if (rw_mappings == 0) {
@@ -2434,7 +2434,7 @@
 	 */
 	if (pg->mdpage.pvh_attrs & PVF_NC)
 		return;
-	KASSERT(pg->mdpage.pvh_attrs & PVF_COLORED);
+	KASSERT(arm_cache_prefer_mask == 0 || pg->mdpage.pvh_attrs & PVF_COLORED);
 
 	pmap_tlb_flushID_SE(pmap_kernel(), cdstp + va_offset);
 	/*
@@ -2593,7 +2593,7 @@
 		return;
 	}
 #ifdef PMAP_CACHE_VIPT
-	KASSERT(pmap_is_page_colored_p(pg));
+	KASSERT(arm_cache_prefer_mask == 0 || pmap_is_page_colored_p(pg));
 #endif
 
 	/*
@@ -3273,7 +3273,7 @@
 	struct pv_entry *pv;
 
 	simple_lock(&pg->mdpage.pvh_slock);
-	KASSERT(pg->mdpage.pvh_attrs & (PVF_COLORED|PVF_NC));
+	KASSERT(arm_cache_prefer_mask == 0 || pg->mdpage.pvh_attrs & (PVF_COLORED|PVF_NC));
 	KASSERT((pg->mdpage.pvh_attrs & PVF_KMPAGE) == 0);
 
 	pv = pmap_remove_pv(pg, pmap_kernel(), va);
@@ -3371,7 +3371,7 @@
 			KASSERT(pg->mdpage.kro_mappings == 0);
 #ifdef PMAP_CACHE_VIPT
 			KASSERT(pv == NULL);
-			KASSERT((va & PVF_COLORED) == 0);
+			KASSERT(arm_cache_prefer_mask == 0 || (va & PVF_COLORED) == 0);
 			KASSERT((pg->mdpage.pvh_attrs & PVF_NC) == 0);
 			/* if there is a color conflict, evict from cache. */
 			if (pmap_is_page_colored_p(pg)
@@ -4595,7 +4595,7 @@
 #endif
 
 #ifdef PMAP_CACHE_VIPT
-	KASSERT(src_pg->mdpage.pvh_attrs & (PVF_COLORED|PVF_NC));
+	KASSERT(arm_cache_prefer_mask == 0 || src_pg->mdpage.pvh_attrs & (PVF_COLORED|PVF_NC));
 #endif
 	KDASSERT((src & PGOFSET) == 0);
 	KDASSERT((dst & PGOFSET) == 0);

Reply via email to