diff options
author | cperciva <cperciva@FreeBSD.org> | 2010-12-26 13:05:43 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2010-12-26 13:05:43 +0000 |
commit | 290c1ef87ffbfdb591c830fd2874a87241390022 (patch) | |
tree | c63ea18889d765f821c0bca20cd173124d52bc64 /sys/i386/xen/pmap.c | |
parent | a2053caad03d51e2d0a788d4910f7e1a81145981 (diff) | |
download | FreeBSD-src-290c1ef87ffbfdb591c830fd2874a87241390022.zip FreeBSD-src-290c1ef87ffbfdb591c830fd2874a87241390022.tar.gz |
Lock the vm page queue mutex in pmap_pte_release around the call
to PMAP_SET_VA; this fixes a mutex-not-held panic when a process
which called mlock(2) exits, and parallels a change made in
pmap_pte 10 months ago (svn r204160).
Note: The locking in this code is utterly broken. We should not
be using the VM page queue mutex to protect the queue of pending
Xen page mapping hypervisor calls. Even if it made sense to do
so, this commit and r204160 introduce LORs between the vm page
queue mutex and PMAP2mutex.
(However, a possible deadlock is better than a guaranteed panic,
and this change will hopefully make life easier for whoever fixes
the Xen pmap locking in the future.)
PR: kern/140313
MFC after: 3 days
Diffstat (limited to 'sys/i386/xen/pmap.c')
-rw-r--r-- | sys/i386/xen/pmap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/i386/xen/pmap.c b/sys/i386/xen/pmap.c index b63089d..9d72ad5 100644 --- a/sys/i386/xen/pmap.c +++ b/sys/i386/xen/pmap.c @@ -1015,7 +1015,9 @@ pmap_pte_release(pt_entry_t *pte) if ((pt_entry_t *)((vm_offset_t)pte & ~PAGE_MASK) == PADDR2) { CTR1(KTR_PMAP, "pmap_pte_release: pte=0x%jx", *PMAP2); + vm_page_lock_queues(); PT_SET_VA(PMAP2, 0, TRUE); + vm_page_unlock_queues(); mtx_unlock(&PMAP2mutex); } } |