Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm Fix a bug where the kernel was never grown to accomo...



details:   https://anonhg.NetBSD.org/src/rev/7ea3587fba6f
branches:  trunk
changeset: 781388:7ea3587fba6f
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Sep 03 14:21:24 2012 +0000

description:
Fix a bug where the kernel was never grown to accomodate the kmem VA space
since that happens before the kernel_map is set.

diffstat:

 sys/uvm/uvm_km.c |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 8d9b611d8835 -r 7ea3587fba6f sys/uvm/uvm_km.c
--- a/sys/uvm/uvm_km.c  Mon Sep 03 13:23:13 2012 +0000
+++ b/sys/uvm/uvm_km.c  Mon Sep 03 14:21:24 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_km.c,v 1.128 2012/07/09 11:19:34 matt Exp $        */
+/*     $NetBSD: uvm_km.c,v 1.129 2012/09/03 14:21:24 matt Exp $        */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -152,7 +152,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_km.c,v 1.128 2012/07/09 11:19:34 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_km.c,v 1.129 2012/09/03 14:21:24 matt Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -323,6 +323,20 @@
 
        kernel_map = &kernel_map_store;
 
+#ifdef PMAP_GROWKERNEL
+       /*
+        * Since we just set kernel_map, the check in uvm_map_prepare to grow the
+        * kernel's VA space never happened so we must do it here.  If the kernel
+        * pmap can't map the requested space, then allocate more resources for it.
+        */
+       if (uvm_maxkaddr < kmembase + kmemsize) {
+               uvm_maxkaddr = pmap_growkernel(kmembase + kmemsize);
+               if (uvm_maxkaddr < kmembase + kmemsize)
+                       panic("%s: pmap_growkernel(%#"PRIxVADDR") failed",
+                           __func__, kmembase + kmemsize);
+       }
+#endif
+
        pool_subsystem_init();
        vmem_bootstrap();
 



Home | Main Index | Thread Index | Old Index