Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Dec 2013 03:04:00 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r259244 - head/sys/ia64/ia64
Message-ID:  <201312120304.rBC340cW082628@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Thu Dec 12 03:04:00 2013
New Revision: 259244
URL: http://svnweb.freebsd.org/changeset/base/259244

Log:
  Allow pmap_remove_pages() to be called for physical maps not
  associated with the current thread.
  
  Obtained from: alc@

Modified:
  head/sys/ia64/ia64/pmap.c

Modified: head/sys/ia64/ia64/pmap.c
==============================================================================
--- head/sys/ia64/ia64/pmap.c	Thu Dec 12 02:04:59 2013	(r259243)
+++ head/sys/ia64/ia64/pmap.c	Thu Dec 12 03:04:00 2013	(r259244)
@@ -2103,19 +2103,16 @@ pmap_remove_pages(pmap_t pmap)
 {
 	struct pv_chunk *pc, *npc;
 	struct ia64_lpte *pte;
+	pmap_t oldpmap;
 	pv_entry_t pv;
 	vm_offset_t va;
 	vm_page_t m;
 	u_long inuse, bitmask;
 	int allfree, bit, field, idx;
 
-	if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) {
-		printf("warning: %s called with non-current pmap\n",
-		    __func__);
-		return;
-	}
 	rw_wlock(&pvh_global_lock);
 	PMAP_LOCK(pmap);
+	oldpmap = pmap_switch(pmap);
 	TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) {
 		allfree = 1;
 		for (field = 0; field < _NPCM; field++) {
@@ -2155,8 +2152,9 @@ pmap_remove_pages(pmap_t pmap)
 			free_pv_chunk(pc);
 		}
 	}
-	rw_wunlock(&pvh_global_lock);
+	pmap_switch(oldpmap);
 	PMAP_UNLOCK(pmap);
+	rw_wunlock(&pvh_global_lock);
 }
 
 /*



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