Module Name: src
Committed By: ragge
Date: Sun Mar 26 12:21:09 UTC 2023
Modified Files:
src/sys/arch/vax/vax: pmap.c
Log Message:
Ensure that the kernel do not try to allocate a S0 segment larger than 1G,
since the hardware prohibits that.
To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/sys/arch/vax/vax/pmap.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/vax/vax/pmap.c
diff -u src/sys/arch/vax/vax/pmap.c:1.195 src/sys/arch/vax/vax/pmap.c:1.196
--- src/sys/arch/vax/vax/pmap.c:1.195 Sun Dec 11 18:02:40 2022
+++ src/sys/arch/vax/vax/pmap.c Sun Mar 26 12:21:09 2023
@@ -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.