From 0e620e3db39f58118e3e8148f2fc82ffb451e67c Mon Sep 17 00:00:00 2001 From: Niklas Hallqvist Date: Tue, 10 Apr 2001 06:59:14 +0000 Subject: Fix for machines which need to enlarge the kernel address space, at least 1GB i386 machines needs this. The fix is heavily based on Jason Thorpe's found in NetBSD. Here is his original commit message: Instead of checking vm_physmem[].pgs to determine if uvm_page_init() has completed, add a boolean uvm.page_init_done, and test against that. Use this same boolean (rather than pmap_initialized) in pmap_growkernel() to determine if we are being called via uvm_page_init() to grow the kernel address space. This fixes a problem on some i386 configurations where pmap_init() itself was needing to have the kernel page table grown, and since pmap_initialized was not yet set to TRUE, pmap_growkernel() was choosing the wrong code path. --- sys/arch/i386/i386/pmap.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sys/arch/i386') diff --git a/sys/arch/i386/i386/pmap.c b/sys/arch/i386/i386/pmap.c index 28ec9a8ab5e..31f86a086c6 100644 --- a/sys/arch/i386/i386/pmap.c +++ b/sys/arch/i386/i386/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.38 2001/03/22 23:36:51 niklas Exp $ */ +/* $OpenBSD: pmap.c,v 1.39 2001/04/10 06:59:13 niklas Exp $ */ /* $NetBSD: pmap.c,v 1.84 2000/02/21 02:01:24 chs Exp $ */ /* @@ -3658,7 +3658,7 @@ pmap_growkernel(maxkvaddr) for (/*null*/ ; nkpde < needed_kpde ; nkpde++) { - if (pmap_initialized == FALSE) { + if (uvm.page_init_done == FALSE) { /* * we're growing the kernel pmap early (from @@ -3677,6 +3677,12 @@ pmap_growkernel(maxkvaddr) continue; } + /* + * THIS *MUST* BE CODED SO AS TO WORK IN THE + * pmap_initialized == FALSE CASE! WE MAY BE + * INVOKED WHILE pmap_init() IS RUNNING! + */ + if (pmap_alloc_ptp(kpm, PDSLOT_KERN + nkpde, FALSE) == NULL) { panic("pmap_growkernel: alloc ptp failed"); } -- cgit v1.2.3