summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2004-09-29 19:20:40 +0000
committeralc <alc@FreeBSD.org>2004-09-29 19:20:40 +0000
commit118a3c283b4d55527625f7c225bab927cc6e8a5b (patch)
tree84e879c73d19a080f90e5a8d82f490bd13e57a88 /sys/amd64/include
parent3793e610ff87a0e982b946fb512883efc2a352a3 (diff)
downloadFreeBSD-src-118a3c283b4d55527625f7c225bab927cc6e8a5b.zip
FreeBSD-src-118a3c283b4d55527625f7c225bab927cc6e8a5b.tar.gz
Prevent the unexpected deallocation of a page table page while performing
pmap_copy(). This entails additional locking in pmap_copy() and the addition of a "flags" parameter to the page table page allocator for specifying whether it may sleep when memory is unavailable. (Already, pmap_copy() checks the availability of memory, aborting if it is scarce. In theory, another CPU could, however, allocate memory between pmap_copy()'s check and the call to the page table page allocator, causing the current thread to release its locks and sleep. This change makes this scenario impossible.) Reviewed by: tegge@
Diffstat (limited to 'sys/amd64/include')
-rw-r--r--sys/amd64/include/pmap.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h
index 3640e2f..90da462 100644
--- a/sys/amd64/include/pmap.h
+++ b/sys/amd64/include/pmap.h
@@ -240,7 +240,7 @@ extern struct pmap kernel_pmap_store;
mtx_assert(&(pmap)->pm_mtx, (type))
#define PMAP_LOCK_DESTROY(pmap) mtx_destroy(&(pmap)->pm_mtx)
#define PMAP_LOCK_INIT(pmap) mtx_init(&(pmap)->pm_mtx, "pmap", \
- NULL, MTX_DEF)
+ NULL, MTX_DEF | MTX_DUPOK)
#define PMAP_LOCKED(pmap) mtx_owned(&(pmap)->pm_mtx)
#define PMAP_MTX(pmap) (&(pmap)->pm_mtx)
#define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx)
OpenPOWER on IntegriCloud