Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jan 2019 23:17:09 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r342854 - head/sys/vm
Message-ID:  <201901072317.x07NH98N032471@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Mon Jan  7 23:17:09 2019
New Revision: 342854
URL: https://svnweb.freebsd.org/changeset/base/342854

Log:
  Fix regression in r331368, that broke dumping of UMA startup pages
  when WITNESS is present.
  
  Discussed with:	markj

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Mon Jan  7 22:10:48 2019	(r342853)
+++ head/sys/vm/vm_page.c	Mon Jan  7 23:17:09 2019	(r342854)
@@ -553,6 +553,9 @@ vm_page_startup(vm_offset_t vaddr)
 	vm_paddr_t biggestsize, last_pa, pa;
 	u_long pagecount;
 	int biggestone, i, segind;
+#ifdef WITNESS
+	int witness_size;
+#endif
 #if defined(__i386__) && defined(VM_PHYSSEG_DENSE)
 	long ii;
 #endif
@@ -620,11 +623,11 @@ vm_page_startup(vm_offset_t vaddr)
 	uma_startup((void *)mapped, boot_pages);
 
 #ifdef WITNESS
-	end = new_end;
-	new_end = end - round_page(witness_startup_count());
-	mapped = pmap_map(&vaddr, new_end, end,
+	witness_size = round_page(witness_startup_count());
+	new_end -= witness_size;
+	mapped = pmap_map(&vaddr, new_end, new_end + witness_size,
 	    VM_PROT_READ | VM_PROT_WRITE);
-	bzero((void *)mapped, end - new_end);
+	bzero((void *)mapped, witness_size);
 	witness_startup((void *)mapped);
 #endif
 
@@ -656,9 +659,9 @@ vm_page_startup(vm_offset_t vaddr)
 #endif
 #if defined(__aarch64__) || defined(__amd64__) || defined(__mips__)
 	/*
-	 * Include the UMA bootstrap pages and vm_page_dump in a crash dump.
-	 * When pmap_map() uses the direct map, they are not automatically 
-	 * included.
+	 * Include the UMA bootstrap pages, witness pages and vm_page_dump
+	 * in a crash dump.  When pmap_map() uses the direct map, they are
+	 * not automatically included.
 	 */
 	for (pa = new_end; pa < end; pa += PAGE_SIZE)
 		dump_add_page(pa);



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