summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2010-12-31 17:39:31 +0000
committercperciva <cperciva@FreeBSD.org>2010-12-31 17:39:31 +0000
commit76aea5c53e3fe97238b6a231f1b509b01b5f98e4 (patch)
tree6056cad2b128bb5178053201ecdb77a7d33ea78b
parent0fd3ac8cbfe356eac52578da3043882fa0a99ff0 (diff)
downloadFreeBSD-src-76aea5c53e3fe97238b6a231f1b509b01b5f98e4.zip
FreeBSD-src-76aea5c53e3fe97238b6a231f1b509b01b5f98e4.tar.gz
Make i386_set_ldt work on i386/XEN, step 1/5.
Lock the vm page queue mutex around calls to pte_store. As with many other uses of the vm page queue mutex in i386/xen/pmap.c, this is bogus and needs to be replaced at some future date by a spin lock dedicated to protecting the queue of pending xen page mapping hypervisor calls. (But for now, bogus locking is better than a panic.) MFC after: 3 days
-rw-r--r--sys/i386/xen/pmap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/i386/xen/pmap.c b/sys/i386/xen/pmap.c
index e956777..e91ebaf 100644
--- a/sys/i386/xen/pmap.c
+++ b/sys/i386/xen/pmap.c
@@ -3647,7 +3647,9 @@ pmap_map_readonly(pmap_t pmap, vm_offset_t va, int len)
for (i = 0; i < npages; i++) {
pt_entry_t *pte;
pte = pmap_pte(pmap, (vm_offset_t)(va + i*PAGE_SIZE));
+ vm_page_lock_queues();
pte_store(pte, xpmap_mtop(*pte & ~(PG_RW|PG_M)));
+ vm_page_unlock_queues();
PMAP_MARK_PRIV(xpmap_mtop(*pte));
pmap_pte_release(pte);
}
@@ -3661,7 +3663,9 @@ pmap_map_readwrite(pmap_t pmap, vm_offset_t va, int len)
pt_entry_t *pte;
pte = pmap_pte(pmap, (vm_offset_t)(va + i*PAGE_SIZE));
PMAP_MARK_UNPRIV(xpmap_mtop(*pte));
+ vm_page_lock_queues();
pte_store(pte, xpmap_mtop(*pte) | (PG_RW|PG_M));
+ vm_page_unlock_queues();
pmap_pte_release(pte);
}
}
OpenPOWER on IntegriCloud