Module Name:    src
Committed By:   maxv
Date:           Tue Nov 15 15:00:56 UTC 2016

Modified Files:
        src/sys/arch/amd64/amd64: machdep.c
        src/sys/arch/i386/i386: machdep.c
        src/sys/arch/x86/x86: x86_machdep.c

Log Message:
Initialize kern_end in amd64 instead of x86.


To generate a diff of this commit:
cvs rdiff -u -r1.230 -r1.231 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.763 -r1.764 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/x86/x86/x86_machdep.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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.230 src/sys/arch/amd64/amd64/machdep.c:1.231
--- src/sys/arch/amd64/amd64/machdep.c:1.230	Sat Aug 27 16:17:16 2016
+++ src/sys/arch/amd64/amd64/machdep.c	Tue Nov 15 15:00:56 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.230 2016/08/27 16:17:16 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.231 2016/11/15 15:00:56 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -111,7 +111,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.230 2016/08/27 16:17:16 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.231 2016/11/15 15:00:56 maxv Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -1540,7 +1540,9 @@ init_x86_64(paddr_t first_avail)
 	int x;
 #ifndef XEN
 	int ist;
-#endif /* !XEN */
+#endif
+
+	KASSERT(first_avail % PAGE_SIZE == 0);
 
 #ifdef XEN
 	KASSERT(HYPERVISOR_shared_info != NULL);
@@ -1609,11 +1611,13 @@ init_x86_64(paddr_t first_avail)
 	 */
 	pmap_bootstrap(VM_MIN_KERNEL_ADDRESS);
 
+	/* End of the virtual space we have created so far. */
+	kern_end = KERNBASE + first_avail;
+
 #ifndef XEN
 	/* Internalize the physical pages into the VM system. */
 	init_x86_vm(first_avail);
 #else	/* XEN */
-	kern_end = KERNBASE + first_avail;
 	physmem = xen_start_info.nr_pages;
 
 	uvm_page_physload(atop(avail_start),

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.763 src/sys/arch/i386/i386/machdep.c:1.764
--- src/sys/arch/i386/i386/machdep.c:1.763	Fri Nov 11 11:34:51 2016
+++ src/sys/arch/i386/i386/machdep.c	Tue Nov 15 15:00:55 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.763 2016/11/11 11:34:51 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.764 2016/11/15 15:00:55 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.763 2016/11/11 11:34:51 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.764 2016/11/15 15:00:55 maxv Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -1141,6 +1141,8 @@ init386(paddr_t first_avail)
 	extern u_char biostramp_image[];
 #endif
 
+	KASSERT(first_avail % PAGE_SIZE == 0);
+
 #ifdef XEN
 	XENPRINTK(("HYPERVISOR_shared_info %p (%x)\n", HYPERVISOR_shared_info,
 	    xen_start_info.shared_info));

Index: src/sys/arch/x86/x86/x86_machdep.c
diff -u src/sys/arch/x86/x86/x86_machdep.c:1.75 src/sys/arch/x86/x86/x86_machdep.c:1.76
--- src/sys/arch/x86/x86/x86_machdep.c:1.75	Mon Aug  1 16:07:39 2016
+++ src/sys/arch/x86/x86/x86_machdep.c	Tue Nov 15 15:00:56 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_machdep.c,v 1.75 2016/08/01 16:07:39 maxv Exp $	*/
+/*	$NetBSD: x86_machdep.c,v 1.76 2016/11/15 15:00:56 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.75 2016/08/01 16:07:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.76 2016/11/15 15:00:56 maxv Exp $");
 
 #include "opt_modular.h"
 #include "opt_physmem.h"
@@ -849,14 +849,10 @@ init_x86_vm(paddr_t pa_kend)
 			x86_freelists[i].freelist = VM_FREELIST_DEFAULT;
 	}
 
-	/* Make sure the end of the space used by the kernel is rounded. */
-	pa_kend = round_page(pa_kend);
-
 #ifdef amd64
 	extern vaddr_t kern_end;
 	extern vaddr_t module_start, module_end;
 
-	kern_end = KERNBASE + pa_kend;
 	module_start = kern_end;
 	module_end = KERNBASE + NKL2_KIMG_ENTRIES * NBPD_L2;
 #endif

Reply via email to