Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Feb 2014 20:26:22 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r261996 - stable/10/sys/ia64/ia64
Message-ID:  <201402162026.s1GKQMqO027671@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Sun Feb 16 20:26:22 2014
New Revision: 261996
URL: http://svnweb.freebsd.org/changeset/base/261996

Log:
  MFC r259244:
  Allow pmap_remove_pages() to be called for physical maps not
  associated with the current thread.

Modified:
  stable/10/sys/ia64/ia64/pmap.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/ia64/ia64/pmap.c
==============================================================================
--- stable/10/sys/ia64/ia64/pmap.c	Sun Feb 16 20:13:18 2014	(r261995)
+++ stable/10/sys/ia64/ia64/pmap.c	Sun Feb 16 20:26:22 2014	(r261996)
@@ -2118,19 +2118,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++) {
@@ -2170,8 +2167,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?201402162026.s1GKQMqO027671>