Source-Changes-HG archive

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

[src/netbsd-10]: src/sys/arch/vax Pull up following revision(s) (requested by...



details:   https://anonhg.NetBSD.org/src/rev/1c81ada64e81
branches:  netbsd-10
changeset: 376514:1c81ada64e81
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Jun 21 19:09:07 2023 +0000

description:
Pull up following revision(s) (requested by abs in ticket #201):

        sys/arch/vax/vax/pmap.c: revision 1.196
        sys/arch/vax/include/trap.h: revision 1.25

Change CASMAGIC to 0xFEDABABE so that it cannot accidentally end up in
valid kernel memory.  Due to the VARM accesses above S0 should always
give a ptelen trap.

Bug found by Kalvis Duckmanton.


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

diffstat:

 sys/arch/vax/include/trap.h |   4 ++--
 sys/arch/vax/vax/pmap.c     |  13 +++++++++++--
 2 files changed, 13 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r 1c15fc957d29 -r 1c81ada64e81 sys/arch/vax/include/trap.h
--- a/sys/arch/vax/include/trap.h       Wed Jun 21 19:02:18 2023 +0000
+++ b/sys/arch/vax/include/trap.h       Wed Jun 21 19:09:07 2023 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: trap.h,v 1.24 2011/07/03 02:18:20 matt Exp $     */
+/*      $NetBSD: trap.h,v 1.24.84.1 2023/06/21 19:09:07 martin Exp $     */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -74,7 +74,7 @@
 #define        AFLT_FLTUND     0xa     /* floating underflow */
 
 /* Used by RAS to detect an interrupted CAS */
-#define        CASMAGIC        0xBEDABABE /* high end of S0 space */
+#define        CASMAGIC        0xFEDABABE /* always invalid space */
 
 /* Trap's coming from user mode */
 #define        T_USER  0x100
diff -r 1c15fc957d29 -r 1c81ada64e81 sys/arch/vax/vax/pmap.c
--- a/sys/arch/vax/vax/pmap.c   Wed Jun 21 19:02:18 2023 +0000
+++ b/sys/arch/vax/vax/pmap.c   Wed Jun 21 19:09:07 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.195.2.1 2023/06/21 19:09:07 martin 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.195.2.1 2023/06/21 19:09:07 martin 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