Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Dec 2010 17:40: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: r216845 - head/sys/i386/i386
Message-ID:  <201012311740.oBVHeV1s083581@svn.freebsd.org>

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

Log:
  Make i386_set_ldt work on i386/XEN, step 3/5.
  
  Synchronize reality with comment: The user_ldt_alloc function is supposed to
  return with dt_lock held.  Due to broken locking in i386/xen/pmap.c, we drop
  dt_lock during the call to pmap_map_readonly and then pick it up again; this
  can be removed once the Xen pmap locking is fixed.
  
  MFC after:	3 days

Modified:
  head/sys/i386/i386/sys_machdep.c

Modified: head/sys/i386/i386/sys_machdep.c
==============================================================================
--- head/sys/i386/i386/sys_machdep.c	Fri Dec 31 17:39:58 2010	(r216844)
+++ head/sys/i386/i386/sys_machdep.c	Fri Dec 31 17:40:30 2010	(r216845)
@@ -450,6 +450,7 @@ user_ldt_alloc(struct mdproc *mdp, int l
         new_ldt->ldt_refcnt = 1; 
         new_ldt->ldt_active = 0; 
  
+	mtx_lock_spin(&dt_lock);
         if ((pldt = mdp->md_ldt)) { 
                 if (len > pldt->ldt_len) 
                         len = pldt->ldt_len; 
@@ -458,8 +459,10 @@ user_ldt_alloc(struct mdproc *mdp, int l
         } else { 
                 bcopy(ldt, new_ldt->ldt_base, PAGE_SIZE); 
         } 
+        mtx_unlock_spin(&dt_lock);  /* XXX kill once pmap locking fixed. */
         pmap_map_readonly(kernel_pmap, (vm_offset_t)new_ldt->ldt_base, 
                           new_ldt->ldt_len*sizeof(union descriptor)); 
+        mtx_lock_spin(&dt_lock);  /* XXX kill once pmap locking fixed. */
         return (new_ldt);
 } 
 #else



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