Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Sep 2019 22:26:01 +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: r351800 - in head/sys/amd64: amd64 include
Message-ID:  <201909032226.x83MQ1xu067042@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Sep  3 22:26:01 2019
New Revision: 351800
URL: https://svnweb.freebsd.org/changeset/base/351800

Log:
  Fix some nits in pmap_page_array_startup().
  
  - Use ptoa() instead of the archaic ctob().
  - Use pagezero() to zero a PDP page.
  - Remove PA_MIN_ADDRESS, orphaned by r351742.
  - Remove unneeded parens and an unnecessary control flow statement.
  
  Reported by:	alc
  Reviewed by:	alc, kib
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D21495

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/amd64/include/vmparam.h

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Tue Sep  3 22:01:12 2019	(r351799)
+++ head/sys/amd64/amd64/pmap.c	Tue Sep  3 22:26:01 2019	(r351800)
@@ -3850,22 +3850,21 @@ pmap_page_array_startup(long pages)
 	end = va + pages * sizeof(struct vm_page);
 	while (va < end) {
 		pfn = first_page + (va - start) / sizeof(struct vm_page);
-		domain = _vm_phys_domain(ctob(pfn));
+		domain = _vm_phys_domain(ptoa(pfn));
 		pdpe = pmap_pdpe(kernel_pmap, va);
 		if ((*pdpe & X86_PG_V) == 0) {
 			pa = vm_phys_early_alloc(domain, PAGE_SIZE);
 			dump_add_page(pa);
-			bzero((void *)PHYS_TO_DMAP(pa), PAGE_SIZE);
+			pagezero((void *)PHYS_TO_DMAP(pa));
 			*pdpe = (pdp_entry_t)(pa | X86_PG_V | X86_PG_RW |
 			    X86_PG_A | X86_PG_M);
-			continue; /* try again */
 		}
 		pde = pmap_pdpe_to_pde(pdpe, va);
 		if ((*pde & X86_PG_V) != 0)
 			panic("Unexpected pde");
 		pa = vm_phys_early_alloc(domain, NBPDR);
 		for (i = 0; i < NPDEPG; i++)
-			dump_add_page(pa + (i * PAGE_SIZE));
+			dump_add_page(pa + i * PAGE_SIZE);
 		newpdir = (pd_entry_t)(pa | X86_PG_V | X86_PG_RW | X86_PG_A |
 		    X86_PG_M | PG_PS | pg_g | pg_nx);
 		pde_store(pde, newpdir);

Modified: head/sys/amd64/include/vmparam.h
==============================================================================
--- head/sys/amd64/include/vmparam.h	Tue Sep  3 22:01:12 2019	(r351799)
+++ head/sys/amd64/include/vmparam.h	Tue Sep  3 22:26:01 2019	(r351800)
@@ -176,8 +176,6 @@
 #define	DMAP_MIN_ADDRESS	KVADDR(DMPML4I, 0, 0, 0)
 #define	DMAP_MAX_ADDRESS	KVADDR(DMPML4I + NDMPML4E, 0, 0, 0)
 
-#define	PA_MIN_ADDRESS		KVADDR(PAPML4I, 0, 0, 0)
-
 #define	LARGEMAP_MIN_ADDRESS	KVADDR(LMSPML4I, 0, 0, 0)
 #define	LARGEMAP_MAX_ADDRESS	KVADDR(LMEPML4I + 1, 0, 0, 0)
 



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