Module Name:    src
Committed By:   martin
Date:           Sat Jun  5 10:27:10 UTC 2021

Modified Files:
        src/sys/arch/arm/arm32 [netbsd-9]: arm32_boot.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1279):

        sys/arch/arm/arm32/arm32_boot.c: revision 1.42
        sys/arch/arm/arm32/arm32_boot.c: revision 1.43

G/C

 -

Mirror the changes around passing pages to UVM in aarch64_machdep.c:

Two fixes for loading free pages into UVM

- Only consider a boot_physmem (inner loop) range that has its end
   (bp_end) after the bootconfig.dram (outer loop) range start (start).
   This was harmless as a later condition correctly checks there is only
   something to do if start < bp_end.

- Stop processing boot_physmem ranges if all the bootconfig.dram range has
   been passed to UVM.  This fixes a boot problem for simon@

Copy a comment over and do the VPRINTF before the uvm_page_physload in
the same way as aarch64_machdep.c as well.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.33.4.1 src/sys/arch/arm/arm32/arm32_boot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm32/arm32_boot.c
diff -u src/sys/arch/arm/arm32/arm32_boot.c:1.33 src/sys/arch/arm/arm32/arm32_boot.c:1.33.4.1
--- src/sys/arch/arm/arm32/arm32_boot.c:1.33	Sat Mar 16 10:05:40 2019
+++ src/sys/arch/arm/arm32/arm32_boot.c	Sat Jun  5 10:27:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_boot.c,v 1.33 2019/03/16 10:05:40 skrll Exp $	*/
+/*	$NetBSD: arm32_boot.c,v 1.33.4.1 2021/06/05 10:27:10 martin Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -122,7 +122,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: arm32_boot.c,v 1.33 2019/03/16 10:05:40 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: arm32_boot.c,v 1.33.4.1 2021/06/05 10:27:10 martin Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_cputypes.h"
@@ -264,15 +264,21 @@ initarm_common(vaddr_t kvm_base, vsize_t
 			continue;
 		}
 		VPRINTF("\n");
+
+		/*
+		 * This assumes the bp list is sorted in ascending
+		 * order.
+		 */
 		paddr_t segend = end;
-		for (size_t j = 0; j < nbp; j++ /*, start = segend, segend = end */) {
+		for (size_t j = 0; j < nbp && start < end; j++) {
 			paddr_t bp_start = bp[j].bp_start;
 			paddr_t bp_end = bp_start + bp[j].bp_pages;
 
 			VPRINTF("   bp %2zu start %08lx  end %08lx\n",
 			    j, ptoa(bp_start), ptoa(bp_end));
+
 			KASSERT(bp_start < bp_end);
-			if (start > bp_end || segend < bp_start)
+			if (start >= bp_end || segend < bp_start)
 				continue;
 
 			if (start < bp_start)
@@ -284,11 +290,13 @@ initarm_common(vaddr_t kvm_base, vsize_t
 				}
 				vm_freelist = bp[j].bp_freelist;
 
-				uvm_page_physload(start, segend, start, segend,
-				    vm_freelist);
 				VPRINTF("         start %08lx  end %08lx"
 				    "... loading in freelist %d\n", ptoa(start),
 				    ptoa(segend), vm_freelist);
+
+				uvm_page_physload(start, segend, start, segend,
+				    vm_freelist);
+
 				start = segend;
 				segend = end;
 			}

Reply via email to