diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-04-14 14:54:31 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-04-14 14:54:31 +0000 |
commit | e0b605cca2b7134ae5f30ae041062a1fcfbaecf3 (patch) | |
tree | 38f540c0f2ae24451aff3387ae055a6884d1006c /sys | |
parent | c4813b1b50dfc0a81e0e407a20c1c16212b6d970 (diff) |
Crank KVM from a ridiculous pedro-sized 256MB to 1GB; needed for upcoming MI
changes.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/mips64/include/vmparam.h | 7 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/pmap.c | 33 |
2 files changed, 17 insertions, 23 deletions
diff --git a/sys/arch/mips64/include/vmparam.h b/sys/arch/mips64/include/vmparam.h index 96dbe3f748c..274951eec2d 100644 --- a/sys/arch/mips64/include/vmparam.h +++ b/sys/arch/mips64/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.10 2005/08/07 07:29:44 miod Exp $ */ +/* $OpenBSD: vmparam.h,v 1.11 2007/04/14 14:54:28 miod Exp $ */ /* $NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp $ */ /* @@ -105,14 +105,11 @@ #define VM_MAX_ADDRESS ((vaddr_t)0x80000000) #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xc0000000) #endif +#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)-PAGE_SIZE) #define VM_NFREELIST 1 #define VM_FREELIST_DEFAULT 0 -/* Kernel page table size is variable. */ -extern vaddr_t virtual_end; -#define VM_MAX_KERNEL_ADDRESS virtual_end - /* virtual sizes (bytes) for various kernel submaps */ #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) diff --git a/sys/arch/mips64/mips64/pmap.c b/sys/arch/mips64/mips64/pmap.c index d0353dd837c..f63117266a3 100644 --- a/sys/arch/mips64/mips64/pmap.c +++ b/sys/arch/mips64/mips64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.21 2007/04/14 14:52:39 miod Exp $ */ +/* $OpenBSD: pmap.c,v 1.22 2007/04/14 14:54:30 miod Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -125,8 +125,7 @@ struct pmap kernel_pmap_store; psize_t mem_size; /* memory size in bytes */ vaddr_t virtual_start; /* VA of first avail page (after kernel bss)*/ -vaddr_t virtual_end = /* VA of last avail page (end of kernel AS) */ - VM_MIN_KERNEL_ADDRESS + 65536 /* minimal Sysmapsize */ * PAGE_SIZE; +vaddr_t virtual_end; /* VA of last avail page (end of kernel AS) */ struct segtab *free_segtab; /* free list kept locally */ u_int tlbpid_gen = 1; /* TLB PID generation count */ @@ -142,25 +141,23 @@ u_int Sysmapsize; /* number of pte's in Sysmap */ void pmap_bootstrap() { - int i; + u_int i; pt_entry_t *spte; - /* * Create a mapping table for kernel virtual memory. This * table is a linear table in contrast to the user process * mapping tables which are built with segment/page tables. - * Create at least 256MB of map even if physmem is smaller. + * Create 1GB of map (this will only use 1MB of memory). */ - if (physmem < 65536) - Sysmapsize = 65536; - else - Sysmapsize = physmem; - virtual_start = VM_MIN_KERNEL_ADDRESS; - virtual_end = VM_MIN_KERNEL_ADDRESS + Sysmapsize * NBPG; + virtual_end = VM_MAX_KERNEL_ADDRESS; + + Sysmapsize = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / + PAGE_SIZE + 1; /* + 1 to be even */ - Sysmap = (pt_entry_t *)uvm_pageboot_alloc(sizeof(pt_entry_t) * Sysmapsize); + Sysmap = (pt_entry_t *) + uvm_pageboot_alloc(sizeof(pt_entry_t) * Sysmapsize); pool_init(&pmap_pmap_pool, sizeof(struct pmap), 0, 0, 0,"pmappl", NULL); pool_init(&pmap_pv_pool, sizeof(struct pv_entry), 0, 0, 0,"pvpl", NULL); @@ -176,7 +173,7 @@ pmap_bootstrap() * Entry HI G bits are ANDed together they will produce * a global bit to store in the tlb. */ - for(i = 0, spte = Sysmap; i < Sysmapsize; i++, spte++) + for (i = 0, spte = Sysmap; i < Sysmapsize; i++, spte++) spte->pt_entry = PG_G; } @@ -423,7 +420,7 @@ pmap_remove(pmap_t pmap, vaddr_t sva, vaddr_t eva) /* remove entries from kernel pmap */ #ifdef DIAGNOSTIC - if (sva < VM_MIN_KERNEL_ADDRESS || eva > virtual_end) + if (sva < VM_MIN_KERNEL_ADDRESS || eva < sva) panic("pmap_remove: kva not in range"); #endif pte = kvtopte(sva); @@ -571,7 +568,7 @@ pmap_protect(pmap_t pmap, vaddr_t sva, vaddr_t eva, vm_prot_t prot) * read-only. */ #ifdef DIAGNOSTIC - if (sva < VM_MIN_KERNEL_ADDRESS || eva > virtual_end) + if (sva < VM_MIN_KERNEL_ADDRESS || eva < sva) panic("pmap_protect: kva not in range"); #endif pte = kvtopte(sva); @@ -644,7 +641,7 @@ pmap_enter(pmap_t pmap, vaddr_t va, paddr_t pa, vm_prot_t prot, int flags) #ifdef DIAGNOSTIC if (pmap == pmap_kernel()) { stat_count(enter_stats.kernel); - if (va < VM_MIN_KERNEL_ADDRESS || va >= virtual_end) + if (va < VM_MIN_KERNEL_ADDRESS) panic("pmap_enter: kva %p", va); } else { stat_count(enter_stats.user); @@ -854,7 +851,7 @@ pmap_extract(pmap_t pmap, vaddr_t va, paddr_t *pa) *pa = (long)KSEG0_TO_PHYS(va); } else { #ifdef DIAGNOSTIC - if (va < VM_MIN_KERNEL_ADDRESS || va >= virtual_end) { + if (va < VM_MIN_KERNEL_ADDRESS) { panic("pmap_extract(%p, %p)", pmap, va); } #endif |