Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/usermode/usermode don't try to unmap pv entries wit...



details:   https://anonhg.NetBSD.org/src/rev/c6206bdcacae
branches:  trunk
changeset: 772450:c6206bdcacae
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Wed Jan 04 15:10:45 2012 +0000

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

diffstat:

 sys/arch/usermode/usermode/pmap.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r daaec25aa8d8 -r c6206bdcacae sys/arch/usermode/usermode/pmap.c
--- a/sys/arch/usermode/usermode/pmap.c Wed Jan 04 14:53:57 2012 +0000
+++ b/sys/arch/usermode/usermode/pmap.c Wed Jan 04 15:10:45 2012 +0000
@@ -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 <reinoud%NetBSD.org@localhost>
@@ -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 @@
        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);



Home | Main Index | Thread Index | Old Index