Module Name:    src
Committed By:   snj
Date:           Thu Apr 30 20:29:56 UTC 2009

Modified Files:
        src/sys/arch/amd64/amd64 [netbsd-3]: pmap.c

Log Message:
Apply patch (requested by bouyer in ticket #2012):
Fix a pmap race.


To generate a diff of this commit:
cvs rdiff -u -r1.15.8.2 -r1.15.8.3 src/sys/arch/amd64/amd64/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/amd64/amd64/pmap.c
diff -u src/sys/arch/amd64/amd64/pmap.c:1.15.8.2 src/sys/arch/amd64/amd64/pmap.c:1.15.8.3
--- src/sys/arch/amd64/amd64/pmap.c:1.15.8.2	Tue Feb 14 13:29:38 2006
+++ src/sys/arch/amd64/amd64/pmap.c	Thu Apr 30 20:29:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.15.8.2 2006/02/14 13:29:38 tron Exp $	*/
+/*	$NetBSD: pmap.c,v 1.15.8.3 2009/04/30 20:29:56 snj Exp $	*/
 
 /*
  *
@@ -108,7 +108,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.15.8.2 2006/02/14 13:29:38 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.15.8.3 2009/04/30 20:29:56 snj Exp $");
 
 #ifndef __x86_64__
 #include "opt_cputype.h"
@@ -2480,6 +2480,8 @@
 
 		/* atomically save the old PTE and zap! it */
 		opte = pmap_pte_set(pte, 0);
+		if (!pmap_valid_entry(opte))
+			continue;
 
 		if (opte & PG_W)
 			pmap->pm_stats.wired_count--;
@@ -2562,6 +2564,8 @@
 
 	/* atomically save the old PTE and zap! it */
 	opte = pmap_pte_set(pte, 0);
+	if (!pmap_valid_entry(opte))
+		return(FALSE);
 
 	if (opte & PG_W)
 		pmap->pm_stats.wired_count--;

Reply via email to