Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 We use only one L4 slot for the direct map, ...



details:   https://anonhg.NetBSD.org/src/rev/e7cc2b9e0628
branches:  trunk
changeset: 346208:e7cc2b9e0628
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Jul 01 11:57:10 2016 +0000

description:
We use only one L4 slot for the direct map, which means that we cannot
map more than 512GB. Panic properly if this limit is reached.

diffstat:

 sys/arch/x86/x86/pmap.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r 16b3ebaa1de0 -r e7cc2b9e0628 sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c   Fri Jul 01 11:44:05 2016 +0000
+++ b/sys/arch/x86/x86/pmap.c   Fri Jul 01 11:57:10 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.202 2016/07/01 11:44:05 maxv Exp $  */
+/*     $NetBSD: pmap.c,v 1.203 2016/07/01 11:57:10 maxv Exp $  */
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.202 2016/07/01 11:44:05 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.203 2016/07/01 11:57:10 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -1509,6 +1509,14 @@
                lastpa = MAX(lastpa, mc->start + mc->size);
        }
 
+       /*
+        * We allocate only one L4 entry for the direct map (PDIR_SLOT_DIRECT),
+        * so we cannot map more than 512GB.
+        */
+       if (lastpa > NBPD_L4) {
+               panic("RAM limit reached: > 512GB not supported");
+       }
+
        /* Allocate L3. */
        dm_pdp = pmap_bootstrap_palloc(1);
 



Home | Main Index | Thread Index | Old Index