Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Feb 2007 00:34:37 GMT
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 114603 for review
Message-ID:  <200702160034.l1G0YbA5029821@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=114603

Change 114603 by gonzo@gonzo_jeeves on 2007/02/16 00:34:11

	o Prevent pmap_remove_pte on invalid pte. This happened
	    when there was no segtab for proviede va.

Affected files ...

.. //depot/projects/mips2/src/sys/mips/mips/pmap.c#20 edit

Differences ...

==== //depot/projects/mips2/src/sys/mips/mips/pmap.c#20 (text+ko) ====

@@ -228,6 +228,13 @@
 
 	if (va < MIPS_KSEG0_START) {
 		pte = pmap_segmap(pmap, va);
+		/* 
+		 * If there is no segtab for this va return NULL 
+		 * to indicate absence of mapping instead of broken 
+		 * pte address.
+		 */
+		if(pte == NULL)
+			return NULL;
 		pte += (va >> PAGE_SHIFT) & (NPTEPG - 1);
 	} else
 		pte = tlb_kern_pte_find(kptmap, va);
@@ -1017,8 +1024,12 @@
 	va = sva;
 	while (count--) {
 		pte = pmap_pte(pmap, va);
-		pmap_remove_pte(pmap, pte, va);
-		tlb_remove(pmap, va);
+		/* NULL means there is no segtab for this area */
+		if(pte != NULL)
+		{
+			pmap_remove_pte(pmap, pte, va);
+			tlb_remove(pmap, va);
+		}
 		va += PAGE_SIZE;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702160034.l1G0YbA5029821>