Module Name: src
Committed By: maxv
Date: Fri Nov 25 11:57:36 UTC 2016
Modified Files:
src/sys/arch/amd64/amd64: machdep.c
src/sys/arch/x86/x86: x86_machdep.c
Log Message:
Initialize the module map limits in amd64, not x86.
For the record: normally we could enable this code on Xen, since the
bootstrap layout is globally the same. But there appears to be an issue
in xen_locore, since any kenter in the area after kern_end triggers a
KASSERT because the va is already busy.
To generate a diff of this commit:
cvs rdiff -u -r1.233 -r1.234 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.76 -r1.77 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.233 src/sys/arch/amd64/amd64/machdep.c:1.234
--- src/sys/arch/amd64/amd64/machdep.c:1.233 Thu Nov 17 16:26:08 2016
+++ src/sys/arch/amd64/amd64/machdep.c Fri Nov 25 11:57:36 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.233 2016/11/17 16:26:08 maxv Exp $ */
+/* $NetBSD: machdep.c,v 1.234 2016/11/25 11:57:36 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.233 2016/11/17 16:26:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.234 2016/11/25 11:57:36 maxv Exp $");
/* #define XENDEBUG_LOW */
@@ -1610,6 +1610,12 @@ init_x86_64(paddr_t first_avail)
/* End of the virtual space we have created so far. */
kern_end = KERNBASE + first_avail;
+#ifndef XEN
+ /* The area for the module map. */
+ module_start = kern_end;
+ module_end = KERNBASE + NKL2_KIMG_ENTRIES * NBPD_L2;
+#endif
+
/*
* Call pmap initialization to make new kernel address space.
* We must do this before loading pages into the VM system.
Index: src/sys/arch/x86/x86/x86_machdep.c
diff -u src/sys/arch/x86/x86/x86_machdep.c:1.76 src/sys/arch/x86/x86/x86_machdep.c:1.77
--- src/sys/arch/x86/x86/x86_machdep.c:1.76 Tue Nov 15 15:00:56 2016
+++ src/sys/arch/x86/x86/x86_machdep.c Fri Nov 25 11:57:36 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: x86_machdep.c,v 1.76 2016/11/15 15:00:56 maxv Exp $ */
+/* $NetBSD: x86_machdep.c,v 1.77 2016/11/25 11:57:36 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.76 2016/11/15 15:00:56 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.77 2016/11/25 11:57:36 maxv Exp $");
#include "opt_modular.h"
#include "opt_physmem.h"
@@ -849,14 +849,6 @@ init_x86_vm(paddr_t pa_kend)
x86_freelists[i].freelist = VM_FREELIST_DEFAULT;
}
-#ifdef amd64
- extern vaddr_t kern_end;
- extern vaddr_t module_start, module_end;
-
- module_start = kern_end;
- module_end = KERNBASE + NKL2_KIMG_ENTRIES * NBPD_L2;
-#endif
-
/*
* Now, load the memory clusters (which have already been rounded and
* truncated) into the VM system.