Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Oct 2019 21:07:18 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r353664 - in head/sys: arm/arm arm/include sparc64/include sparc64/sparc64
Message-ID:  <201910162107.x9GL7I8u003262@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Oct 16 21:07:18 2019
New Revision: 353664
URL: https://svnweb.freebsd.org/changeset/base/353664

Log:
  Port r353622 to sparc64 and arm v4.
  
  Noted by:	alc
  Reviewed by:	alc, jeff, markj
  Sponsored by:	The FreeBSD Foundation
  Differential revision:	https://reviews.freebsd.org/D22056

Modified:
  head/sys/arm/arm/pmap-v4.c
  head/sys/arm/include/pmap.h
  head/sys/sparc64/include/pmap.h
  head/sys/sparc64/sparc64/pmap.c

Modified: head/sys/arm/arm/pmap-v4.c
==============================================================================
--- head/sys/arm/arm/pmap-v4.c	Wed Oct 16 18:33:31 2019	(r353663)
+++ head/sys/arm/arm/pmap-v4.c	Wed Oct 16 21:07:18 2019	(r353664)
@@ -2979,8 +2979,12 @@ pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_page
 		pa = systempage.pv_pa;
 		m = NULL;
 	} else {
-		if ((m->oflags & VPO_UNMANAGED) == 0)
-			VM_PAGE_OBJECT_BUSY_ASSERT(m);
+		if ((m->oflags & VPO_UNMANAGED) == 0) {
+			if ((flags & PMAP_ENTER_QUICK_LOCKED) == 0)
+				VM_PAGE_OBJECT_BUSY_ASSERT(m);
+			else
+				VM_OBJECT_ASSERT_LOCKED(m->object);
+		}
 		pa = VM_PAGE_TO_PHYS(m);
 	}
 	nflags = 0;
@@ -3253,7 +3257,8 @@ pmap_enter_object(pmap_t pmap, vm_offset_t start, vm_o
 	PMAP_LOCK(pmap);
 	while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) {
 		pmap_enter_locked(pmap, start + ptoa(diff), m, prot &
-		    (VM_PROT_READ | VM_PROT_EXECUTE), PMAP_ENTER_NOSLEEP);
+		    (VM_PROT_READ | VM_PROT_EXECUTE), PMAP_ENTER_NOSLEEP |
+		    PMAP_ENTER_QUICK_LOCKED);
 		m = TAILQ_NEXT(m, listq);
 	}
 	rw_wunlock(&pvh_global_lock);
@@ -3276,7 +3281,7 @@ pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_
 	rw_wlock(&pvh_global_lock);
  	PMAP_LOCK(pmap);
 	pmap_enter_locked(pmap, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE),
-	    PMAP_ENTER_NOSLEEP);
+	    PMAP_ENTER_NOSLEEP | PMAP_ENTER_QUICK_LOCKED);
 	rw_wunlock(&pvh_global_lock);
  	PMAP_UNLOCK(pmap);
 }

Modified: head/sys/arm/include/pmap.h
==============================================================================
--- head/sys/arm/include/pmap.h	Wed Oct 16 18:33:31 2019	(r353663)
+++ head/sys/arm/include/pmap.h	Wed Oct 16 21:07:18 2019	(r353664)
@@ -75,5 +75,7 @@ pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src
 	return (0);
 }
 
+#define	PMAP_ENTER_QUICK_LOCKED	0x10000000
+
 #endif	/* _KERNEL */
 #endif	/* !_MACHINE_PMAP_H_ */

Modified: head/sys/sparc64/include/pmap.h
==============================================================================
--- head/sys/sparc64/include/pmap.h	Wed Oct 16 18:33:31 2019	(r353663)
+++ head/sys/sparc64/include/pmap.h	Wed Oct 16 21:07:18 2019	(r353664)
@@ -50,6 +50,7 @@
 #include <machine/tte.h>
 
 #define	PMAP_CONTEXT_MAX	8192
+#define	PMAP_ENTER_QUICK_LOCKED	0x10000000
 
 typedef	struct pmap *pmap_t;
 

Modified: head/sys/sparc64/sparc64/pmap.c
==============================================================================
--- head/sys/sparc64/sparc64/pmap.c	Wed Oct 16 18:33:31 2019	(r353663)
+++ head/sys/sparc64/sparc64/pmap.c	Wed Oct 16 21:07:18 2019	(r353664)
@@ -1500,8 +1500,12 @@ pmap_enter_locked(pmap_t pm, vm_offset_t va, vm_page_t
 
 	rw_assert(&tte_list_global_lock, RA_WLOCKED);
 	PMAP_LOCK_ASSERT(pm, MA_OWNED);
-	if ((m->oflags & VPO_UNMANAGED) == 0)
-		VM_PAGE_OBJECT_BUSY_ASSERT(m);
+	if ((m->oflags & VPO_UNMANAGED) == 0) {
+		if ((flags & PMAP_ENTER_QUICK_LOCKED) == 0)
+			VM_PAGE_OBJECT_BUSY_ASSERT(m);
+		else
+			VM_OBJECT_ASSERT_LOCKED(m->object);
+	}
 	PMAP_STATS_INC(pmap_nenter);
 	pa = VM_PAGE_TO_PHYS(m);
 	wired = (flags & PMAP_ENTER_WIRED) != 0;
@@ -1649,7 +1653,8 @@ pmap_enter_object(pmap_t pm, vm_offset_t start, vm_off
 	PMAP_LOCK(pm);
 	while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) {
 		pmap_enter_locked(pm, start + ptoa(diff), m, prot &
-		    (VM_PROT_READ | VM_PROT_EXECUTE), 0, 0);
+		    (VM_PROT_READ | VM_PROT_EXECUTE),
+		    PMAP_ENTER_QUICK_LOCKED, 0);
 		m = TAILQ_NEXT(m, listq);
 	}
 	rw_wunlock(&tte_list_global_lock);
@@ -1663,7 +1668,7 @@ pmap_enter_quick(pmap_t pm, vm_offset_t va, vm_page_t 
 	rw_wlock(&tte_list_global_lock);
 	PMAP_LOCK(pm);
 	pmap_enter_locked(pm, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE),
-	    0, 0);
+	    PMAP_ENTER_QUICK_LOCKED, 0);
 	rw_wunlock(&tte_list_global_lock);
 	PMAP_UNLOCK(pm);
 }



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