Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Dec 2010 17:39:31 +0000 (UTC)
From:      Colin Percival <cperciva@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216843 - head/sys/i386/xen
Message-ID:  <201012311739.oBVHdVvo083480@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cperciva
Date: Fri Dec 31 17:39:31 2010
New Revision: 216843
URL: http://svn.freebsd.org/changeset/base/216843

Log:
  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

Modified:
  head/sys/i386/xen/pmap.c

Modified: head/sys/i386/xen/pmap.c
==============================================================================
--- head/sys/i386/xen/pmap.c	Fri Dec 31 15:16:18 2010	(r216842)
+++ head/sys/i386/xen/pmap.c	Fri Dec 31 17:39:31 2010	(r216843)
@@ -3647,7 +3647,9 @@ pmap_map_readonly(pmap_t pmap, vm_offset
 	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_offse
 		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);
 	}
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012311739.oBVHdVvo083480>