From dc80cc068b8311a767e579dc315bb0f576b31c99 Mon Sep 17 00:00:00 2001 From: thorpej Date: Fri, 11 Feb 2000 07:00:11 +0000 Subject: [PATCH] Move KERNBASE to 0xc0000000, giving the kernel a more-or-less full 1G of virtual address space, leaving userland with 3G, and update comments to match the new reality. We knew we were going to have to bite this bullet eventually, and there are a couple of outstanding PRs related to this issue (9389 and 9313). Complete solution to those PRs is going to involve some sort of run-time decision on how large kmem_map should be, as well as changing some data structure allocation strategies in UVM. However, this change will at least allow the PR submitter to simply throw resources at the problem. --- sys/arch/i386/conf/Makefile.i386 | 4 +-- sys/arch/i386/include/param.h | 6 ++--- sys/arch/i386/include/pmap.h | 42 ++++++++++++++++---------------- sys/arch/i386/include/vmparam.h | 16 ++++++------ 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/sys/arch/i386/conf/Makefile.i386 b/sys/arch/i386/conf/Makefile.i386 index 76d40d39dc1a..bd6cb2f49a31 100644 --- a/sys/arch/i386/conf/Makefile.i386 +++ b/sys/arch/i386/conf/Makefile.i386 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.i386,v 1.103 2000/02/01 05:25:32 tsutsui Exp $ +# $NetBSD: Makefile.i386,v 1.104 2000/02/11 07:00:11 thorpej Exp $ # Makefile for NetBSD # @@ -54,7 +54,7 @@ CWARNFLAGS+= -Wno-main .endif CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE -LINKFLAGS= -Ttext F0100000 -e start +LINKFLAGS= -Ttext c0100000 -e start .if (${OBJECT_FMT} == "ELF") #LINKFLAGS+= -N .else diff --git a/sys/arch/i386/include/param.h b/sys/arch/i386/include/param.h index a0eb3f35d6b8..65de7a25b6af 100644 --- a/sys/arch/i386/include/param.h +++ b/sys/arch/i386/include/param.h @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.38 1999/12/04 21:20:34 ragge Exp $ */ +/* $NetBSD: param.h,v 1.39 2000/02/11 07:00:13 thorpej Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -76,8 +76,8 @@ #define PGOFSET (NBPG-1) /* byte offset into page */ #define NPTEPG (NBPG/(sizeof (pt_entry_t))) -#define KERNBASE 0xf0000000 /* start of kernel virtual space */ -#define KERNTEXTOFF 0xf0100000 /* start of kernel text */ +#define KERNBASE 0xc0000000 /* start of kernel virtual space */ +#define KERNTEXTOFF 0xc0100000 /* start of kernel text */ #define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT) #define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ diff --git a/sys/arch/i386/include/pmap.h b/sys/arch/i386/include/pmap.h index 52481e20a8e2..d5f03a9b78e1 100644 --- a/sys/arch/i386/include/pmap.h +++ b/sys/arch/i386/include/pmap.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.42 1999/07/28 01:07:59 thorpej Exp $ */ +/* $NetBSD: pmap.h,v 1.43 2000/02/11 07:00:13 thorpej Exp $ */ /* * @@ -57,17 +57,17 @@ * are described by PDEs in the PDP. the PDEs are defined as follows: * * (ranges are inclusive -> exclusive, just like vm_map_entry start/end) - * (the following assumes that KERNBASE is 0xf0000000) + * (the following assumes that KERNBASE is 0xc0000000) * * PDE#s VA range usage - * 0->959 0x0 -> 0xefc00000 user address space, note that the - * max user address is 0xefbfe000 + * 0->767 0x0 -> 0xbfc00000 user address space, note that the + * max user address is 0xbfbfe000 * the final two pages in the last 4MB * used to be reserved for the UAREA * but now are no longer used - * 959 0xefc00000-> recursive mapping of PDP (used for - * 0xf0000000 linear mapping of PTPs) - * 960->1023 0xf0000000-> kernel address space (constant + * 768 0xbfc00000-> recursive mapping of PDP (used for + * 0xc0000000 linear mapping of PTPs) + * 768->1023 0xc0000000-> kernel address space (constant * 0xffc00000 across all pmap's/processes) * 1023 0xffc00000-> "alternate" recursive PDP mapping * (for other pmaps) @@ -80,18 +80,18 @@ * 4MB range is the PTE that maps VA 0xffffe000 (the last page in a 4GB * address). * - * all pmap's PD's must have the same values in slots 960->1023 so that + * all pmap's PD's must have the same values in slots 768->1023 so that * the kernel is always mapped in every process. these values are loaded * into the PD at pmap creation time. * * at any one time only one pmap can be active on a processor. this is * the pmap whose PDP is pointed to by processor register %cr3. this pmap * will have all its PTEs mapped into memory at the recursive mapping - * point (slot #959 as show above). when the pmap code wants to find the + * point (slot #767 as show above). when the pmap code wants to find the * PTE for a virtual address, all it has to do is the following: * - * address of PTE = (959 * 4MB) + (VA / NBPG) * sizeof(pt_entry_t) - * = 0xefc00000 + (VA / 4096) * 4 + * address of PTE = (767 * 4MB) + (VA / NBPG) * sizeof(pt_entry_t) + * = 0xbfc00000 + (VA / 4096) * 4 * * what happens if the pmap layer is asked to perform an operation * on a pmap that is not the one which is currently active? in that @@ -107,25 +107,25 @@ * | 0| -> PTP#0 that maps VA 0x0 -> 0x400000 * | | * | | - * | 959| -> points back to PDP (%cr3) mapping VA 0xefc00000 -> 0xf0000000 - * | 960| -> first kernel PTP (maps 0xf0000000 -> 0xf0400000) + * | 767| -> points back to PDP (%cr3) mapping VA 0xbfc00000 -> 0xc0000000 + * | 768| -> first kernel PTP (maps 0xc0000000 -> 0xf0400000) * | | * |1023| -> points to alternate pmap's PDP (maps 0xffc00000 -> end) * +----+ * - * note that the PDE#959 VA (0xefc00000) is defined as "PTE_BASE" + * note that the PDE#767 VA (0xbfc00000) is defined as "PTE_BASE" * note that the PDE#1023 VA (0xffc00000) is defined as "APTE_BASE" * - * starting at VA 0xefc00000 the current active PDP (%cr3) acts as a + * starting at VA 0xbfc00000 the current active PDP (%cr3) acts as a * PTP: * - * PTP#959 == PDP(%cr3) => maps VA 0xefc00000 -> 0xf0000000 + * PTP#767 == PDP(%cr3) => maps VA 0xbfc00000 -> 0xc0000000 * +----+ - * | 0| -> maps the contents of PTP#0 at VA 0xefc00000->0xefc01000 + * | 0| -> maps the contents of PTP#0 at VA 0xbfc00000->0xbfc01000 * | | * | | - * | 959| -> maps contents of PTP#959 (the PDP) at VA 0xeffbf000 - * | 960| -> maps contents of first kernel PTP + * | 767| -> maps contents of PTP#767 (the PDP) at VA 0xbffbf000 + * | 768| -> maps contents of first kernel PTP * | | * |1023| * +----+ @@ -148,8 +148,8 @@ * the following defines identify the slots used as described above. */ -#define PDSLOT_PTE ((KERNBASE/NBPD)-1) /* 959: for recursive PDP map */ -#define PDSLOT_KERN (KERNBASE/NBPD) /* 960: start of kernel space */ +#define PDSLOT_PTE ((KERNBASE/NBPD)-1) /* 767: for recursive PDP map */ +#define PDSLOT_KERN (KERNBASE/NBPD) /* 768: start of kernel space */ #define PDSLOT_APTE ((unsigned)1023) /* 1023: alternative recursive slot */ /* diff --git a/sys/arch/i386/include/vmparam.h b/sys/arch/i386/include/vmparam.h index 0e76c39dedcc..07aac762d607 100644 --- a/sys/arch/i386/include/vmparam.h +++ b/sys/arch/i386/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.34 2000/01/26 09:44:11 tsutsui Exp $ */ +/* $NetBSD: vmparam.h,v 1.35 2000/02/11 07:00:13 thorpej Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -105,13 +105,13 @@ /* user/kernel map constants */ #define VM_MIN_ADDRESS ((vaddr_t)0) -/* PTDPTDI<