diff options
| author | ragge <ragge@NetBSD.org> | 2023-03-26 12:21:09 +0000 |
|---|---|---|
| committer | ragge <ragge@NetBSD.org> | 2023-03-26 12:21:09 +0000 |
| commit | 8cd451ffd08e46b464f5fa93e3548d8aede30a2c (patch) | |
| tree | 298fc7c6f5925488bb44f717238a8727024bba3c /sys/arch | |
| parent | dadf14f69f47497ba3f13f5068f196aa8c87455f (diff) | |
Ensure that the kernel do not try to allocate a S0 segment larger than 1G,
since the hardware prohibits that.
Diffstat (limited to 'sys/arch')
| -rw-r--r-- | sys/arch/vax/vax/pmap.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/arch/vax/vax/pmap.c b/sys/arch/vax/vax/pmap.c index b0922bba348..a7233a9adcf 100644 --- a/sys/arch/vax/vax/pmap.c +++ b/sys/arch/vax/vax/pmap.c @@ -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. |
