Module Name:    src
Committed By:   reinoud
Date:           Wed Jan  4 15:10:45 UTC 2012

Modified Files:
        src/sys/arch/usermode/usermode: pmap.c

Log Message:
don't try to unmap pv entries with munmap() that are / were already unmapped


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/usermode/usermode/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/usermode/usermode/pmap.c
diff -u src/sys/arch/usermode/usermode/pmap.c:1.94 src/sys/arch/usermode/usermode/pmap.c:1.95
--- src/sys/arch/usermode/usermode/pmap.c:1.94	Wed Jan  4 11:56:58 2012
+++ src/sys/arch/usermode/usermode/pmap.c	Wed Jan  4 15:10:45 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.94 2012/01/04 11:56:58 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.95 2012/01/04 15:10:45 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk <rein...@netbsd.org>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.94 2012/01/04 11:56:58 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.95 2012/01/04 15:10:45 reinoud Exp $");
 
 #include "opt_memsize.h"
 #include "opt_kmempages.h"
@@ -758,6 +758,12 @@ pmap_page_deactivate(struct pv_entry *pv
 	uint32_t map_flags;
 	void *addr;
 
+	/* don't try to unmap pv entries that are already unmapped */
+	if (!tlb[pv->pv_lpn])
+		return;
+	if (tlb[pv->pv_lpn]->pv_mmap_ppl == THUNK_PROT_NONE)
+		return;
+
 	map_flags = THUNK_MAP_FILE | THUNK_MAP_FIXED | THUNK_MAP_SHARED;
 	addr = thunk_mmap((void *) va, PAGE_SIZE, THUNK_PROT_NONE,
 		map_flags, mem_fh, pa);

Reply via email to