Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/vax/vax Ensure that the kernel do not try to alloca...



details:   https://anonhg.NetBSD.org/src/rev/6349fa2ea50d
branches:  trunk
changeset: 374031:6349fa2ea50d
user:      ragge <ragge%NetBSD.org@localhost>
date:      Sun Mar 26 12:21:09 2023 +0000

description:
Ensure that the kernel do not try to allocate a S0 segment larger than 1G,
since the hardware prohibits that.

diffstat:

 sys/arch/vax/vax/pmap.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 5ef0bc1d51ee -r 6349fa2ea50d sys/arch/vax/vax/pmap.c
--- a/sys/arch/vax/vax/pmap.c   Sun Mar 26 10:32:38 2023 +0000
+++ b/sys/arch/vax/vax/pmap.c   Sun Mar 26 12:21:09 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.195 2022/12/11 18:02:40 oster Exp $    */
+/*     $NetBSD: pmap.c,v 1.196 2023/03/26 12:21:09 ragge Exp $    */
 /*
  * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.195 2022/12/11 18:02:40 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.196 2023/03/26 12:21:09 ragge Exp $");
 
 #include "opt_ddb.h"
 #include "opt_cputype.h"
@@ -276,6 +276,15 @@ pmap_bootstrap(void)
                usrptsize = (avail_end/(20 * PPTESZ)) * VAX_NBPG;
                
        kvmsize = calc_kvmsize(usrptsize);
+       /*
+        * Ensure that not more than 1G is allocated, since that is 
+        * max size of S0 space.
+        * Also note that for full S0 space the SLR should be 0x200000,
+        * since the comparison in the vax microcode is >= SLR.
+        */
+#define        S0SPACE (1*1024*1024*1024)
+       if (kvmsize > S0SPACE)
+               kvmsize = S0SPACE;
        sysptsize = kvmsize >> VAX_PGSHIFT;
        /*
         * Virtual_* and avail_* is used for mapping of system page table.



Home | Main Index | Thread Index | Old Index