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.
This commit is contained in:
parent
5d257be455
commit
dc80cc068b
@ -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
|
# Makefile for NetBSD
|
||||||
#
|
#
|
||||||
@ -54,7 +54,7 @@ CWARNFLAGS+= -Wno-main
|
|||||||
.endif
|
.endif
|
||||||
CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS}
|
CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS}
|
||||||
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||||
LINKFLAGS= -Ttext F0100000 -e start
|
LINKFLAGS= -Ttext c0100000 -e start
|
||||||
.if (${OBJECT_FMT} == "ELF")
|
.if (${OBJECT_FMT} == "ELF")
|
||||||
#LINKFLAGS+= -N
|
#LINKFLAGS+= -N
|
||||||
.else
|
.else
|
||||||
|
@ -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.
|
* Copyright (c) 1990 The Regents of the University of California.
|
||||||
@ -76,8 +76,8 @@
|
|||||||
#define PGOFSET (NBPG-1) /* byte offset into page */
|
#define PGOFSET (NBPG-1) /* byte offset into page */
|
||||||
#define NPTEPG (NBPG/(sizeof (pt_entry_t)))
|
#define NPTEPG (NBPG/(sizeof (pt_entry_t)))
|
||||||
|
|
||||||
#define KERNBASE 0xf0000000 /* start of kernel virtual space */
|
#define KERNBASE 0xc0000000 /* start of kernel virtual space */
|
||||||
#define KERNTEXTOFF 0xf0100000 /* start of kernel text */
|
#define KERNTEXTOFF 0xc0100000 /* start of kernel text */
|
||||||
#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
|
#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
|
||||||
|
|
||||||
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
|
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
|
||||||
|
@ -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:
|
* are described by PDEs in the PDP. the PDEs are defined as follows:
|
||||||
*
|
*
|
||||||
* (ranges are inclusive -> exclusive, just like vm_map_entry start/end)
|
* (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
|
* PDE#s VA range usage
|
||||||
* 0->959 0x0 -> 0xefc00000 user address space, note that the
|
* 0->767 0x0 -> 0xbfc00000 user address space, note that the
|
||||||
* max user address is 0xefbfe000
|
* max user address is 0xbfbfe000
|
||||||
* the final two pages in the last 4MB
|
* the final two pages in the last 4MB
|
||||||
* used to be reserved for the UAREA
|
* used to be reserved for the UAREA
|
||||||
* but now are no longer used
|
* but now are no longer used
|
||||||
* 959 0xefc00000-> recursive mapping of PDP (used for
|
* 768 0xbfc00000-> recursive mapping of PDP (used for
|
||||||
* 0xf0000000 linear mapping of PTPs)
|
* 0xc0000000 linear mapping of PTPs)
|
||||||
* 960->1023 0xf0000000-> kernel address space (constant
|
* 768->1023 0xc0000000-> kernel address space (constant
|
||||||
* 0xffc00000 across all pmap's/processes)
|
* 0xffc00000 across all pmap's/processes)
|
||||||
* 1023 0xffc00000-> "alternate" recursive PDP mapping
|
* 1023 0xffc00000-> "alternate" recursive PDP mapping
|
||||||
* <end> (for other pmaps)
|
* <end> (for other pmaps)
|
||||||
@ -80,18 +80,18 @@
|
|||||||
* 4MB range is the PTE that maps VA 0xffffe000 (the last page in a 4GB
|
* 4MB range is the PTE that maps VA 0xffffe000 (the last page in a 4GB
|
||||||
* address).
|
* 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
|
* the kernel is always mapped in every process. these values are loaded
|
||||||
* into the PD at pmap creation time.
|
* into the PD at pmap creation time.
|
||||||
*
|
*
|
||||||
* at any one time only one pmap can be active on a processor. this is
|
* 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
|
* 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
|
* 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:
|
* PTE for a virtual address, all it has to do is the following:
|
||||||
*
|
*
|
||||||
* address of PTE = (959 * 4MB) + (VA / NBPG) * sizeof(pt_entry_t)
|
* address of PTE = (767 * 4MB) + (VA / NBPG) * sizeof(pt_entry_t)
|
||||||
* = 0xefc00000 + (VA / 4096) * 4
|
* = 0xbfc00000 + (VA / 4096) * 4
|
||||||
*
|
*
|
||||||
* what happens if the pmap layer is asked to perform an operation
|
* 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
|
* 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
|
* | 0| -> PTP#0 that maps VA 0x0 -> 0x400000
|
||||||
* | |
|
* | |
|
||||||
* | |
|
* | |
|
||||||
* | 959| -> points back to PDP (%cr3) mapping VA 0xefc00000 -> 0xf0000000
|
* | 767| -> points back to PDP (%cr3) mapping VA 0xbfc00000 -> 0xc0000000
|
||||||
* | 960| -> first kernel PTP (maps 0xf0000000 -> 0xf0400000)
|
* | 768| -> first kernel PTP (maps 0xc0000000 -> 0xf0400000)
|
||||||
* | |
|
* | |
|
||||||
* |1023| -> points to alternate pmap's PDP (maps 0xffc00000 -> end)
|
* |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"
|
* 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:
|
||||||
*
|
*
|
||||||
* 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
|
* | 767| -> maps contents of PTP#767 (the PDP) at VA 0xbffbf000
|
||||||
* | 960| -> maps contents of first kernel PTP
|
* | 768| -> maps contents of first kernel PTP
|
||||||
* | |
|
* | |
|
||||||
* |1023|
|
* |1023|
|
||||||
* +----+
|
* +----+
|
||||||
@ -148,8 +148,8 @@
|
|||||||
* the following defines identify the slots used as described above.
|
* the following defines identify the slots used as described above.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define PDSLOT_PTE ((KERNBASE/NBPD)-1) /* 959: for recursive PDP map */
|
#define PDSLOT_PTE ((KERNBASE/NBPD)-1) /* 767: for recursive PDP map */
|
||||||
#define PDSLOT_KERN (KERNBASE/NBPD) /* 960: start of kernel space */
|
#define PDSLOT_KERN (KERNBASE/NBPD) /* 768: start of kernel space */
|
||||||
#define PDSLOT_APTE ((unsigned)1023) /* 1023: alternative recursive slot */
|
#define PDSLOT_APTE ((unsigned)1023) /* 1023: alternative recursive slot */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -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.
|
* Copyright (c) 1990 The Regents of the University of California.
|
||||||
@ -105,13 +105,13 @@
|
|||||||
|
|
||||||
/* user/kernel map constants */
|
/* user/kernel map constants */
|
||||||
#define VM_MIN_ADDRESS ((vaddr_t)0)
|
#define VM_MIN_ADDRESS ((vaddr_t)0)
|
||||||
/* PTDPTDI<<PDSHIFT - UPAGES*NBPG */
|
/* (PDSLOT_PTE << PDSHIFT) - UPAGES*NBPG */
|
||||||
#define VM_MAXUSER_ADDRESS ((vaddr_t)0xefbfe000)
|
#define VM_MAXUSER_ADDRESS ((vaddr_t)0xbfbfe000)
|
||||||
/* PTDPTDI<<PDSHIFT + PTDPTDI<<PGSHIFT */
|
/* (PDSLOT_PTE << PDSHIFT) + (PDSLOT_PTE << PGSHIFT) */
|
||||||
#define VM_MAX_ADDRESS ((vaddr_t)0xeffbf000)
|
#define VM_MAX_ADDRESS ((vaddr_t)0xbfeff000)
|
||||||
/* KPTDI<<PDSHIFT */
|
/* PDSLOT_KERN << PDSHIFT */
|
||||||
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xf0000000)
|
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xc0000000)
|
||||||
/* APTDPTDI<<PDSHIFT */
|
/* PDSLOT_APTE << PDSHIFT */
|
||||||
#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xffc00000)
|
#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xffc00000)
|
||||||
|
|
||||||
/* XXX max. amount of KVM to be used by buffers. */
|
/* XXX max. amount of KVM to be used by buffers. */
|
||||||
|
Loading…
Reference in New Issue
Block a user