Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Sep 2019 21:54:09 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r351727 - head/sys/amd64/amd64
Message-ID:  <201909022154.x82Ls9Ed070497@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Mon Sep  2 21:54:08 2019
New Revision: 351727
URL: https://svnweb.freebsd.org/changeset/base/351727

Log:
  Replace PMAP_LARGEMAP_MAX_ADDRESS() with a more general predicate.
  
  No functional change intended.
  
  Reviewed by:	kib
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

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

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Mon Sep  2 21:52:18 2019	(r351726)
+++ head/sys/amd64/amd64/pmap.c	Mon Sep  2 21:54:08 2019	(r351727)
@@ -424,8 +424,8 @@ static int pmap_flags = PMAP_PDE_SUPERPAGE;	/* flags f
 
 static vmem_t *large_vmem;
 static u_int lm_ents;
-#define	PMAP_LARGEMAP_MAX_ADDRESS()			\
-    (LARGEMAP_MIN_ADDRESS + NBPML4 * (u_long)lm_ents)
+#define	PMAP_ADDRESS_IN_LARGEMAP(va)	((va) >= LARGEMAP_MIN_ADDRESS && \
+	(va) < LARGEMAP_MIN_ADDRESS + NBPML4 * (u_long)lm_ents)
 
 int pmap_pcid_enabled = 1;
 SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH,
@@ -3091,8 +3091,7 @@ pmap_kextract(vm_offset_t va)
 
 	if (va >= DMAP_MIN_ADDRESS && va < DMAP_MAX_ADDRESS) {
 		pa = DMAP_TO_PHYS(va);
-	} else if (LARGEMAP_MIN_ADDRESS <= va &&
-	    va < PMAP_LARGEMAP_MAX_ADDRESS()) {
+	} else if (PMAP_ADDRESS_IN_LARGEMAP(va)) {
 		pa = pmap_large_map_kextract(va);
 	} else {
 		pde = *vtopde(va);
@@ -9022,7 +9021,7 @@ pmap_large_map_kextract(vm_offset_t va)
 	pd_entry_t *pde, pd;
 	pt_entry_t *pte, pt;
 
-	KASSERT(LARGEMAP_MIN_ADDRESS <= va && va < PMAP_LARGEMAP_MAX_ADDRESS(),
+	KASSERT(PMAP_ADDRESS_IN_LARGEMAP(va),
 	    ("not largemap range %#lx", (u_long)va));
 	pdpe = pmap_large_map_pdpe(va);
 	pdp = *pdpe;
@@ -9164,8 +9163,8 @@ pmap_large_unmap(void *svaa, vm_size_t len)
 		return;
 
 	SLIST_INIT(&spgf);
-	KASSERT(LARGEMAP_MIN_ADDRESS <= sva &&
-	    sva + len <= PMAP_LARGEMAP_MAX_ADDRESS(),
+	KASSERT(PMAP_ADDRESS_IN_LARGEMAP(sva) &&
+	    PMAP_ADDRESS_IN_LARGEMAP(sva + len - 1),
 	    ("not largemap range %#lx %#lx", (u_long)svaa, (u_long)svaa + len));
 	PMAP_LOCK(kernel_pmap);
 	for (va = sva; va < sva + len; va += inc) {



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