Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mips/mips Initialise md_upte for the new lwp



details:   https://anonhg.NetBSD.org/src/rev/60f42f90be5e
branches:  trunk
changeset: 346987:60f42f90be5e
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue Aug 09 09:02:10 2016 +0000

description:
Initialise md_upte for the new lwp
KASSERT that we're always direct mapped when we expect to be

diffstat:

 sys/arch/mips/mips/vm_machdep.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 5aa3d997edb6 -r 60f42f90be5e sys/arch/mips/mips/vm_machdep.c
--- a/sys/arch/mips/mips/vm_machdep.c   Tue Aug 09 08:59:08 2016 +0000
+++ b/sys/arch/mips/mips/vm_machdep.c   Tue Aug 09 09:02:10 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.151 2016/08/09 08:59:08 skrll Exp $   */
+/*     $NetBSD: vm_machdep.c,v 1.152 2016/08/09 09:02:10 skrll Exp $   */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.151 2016/08/09 08:59:08 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.152 2016/08/09 09:02:10 skrll Exp $");
 
 #include "opt_ddb.h"
 #include "opt_coredump.h"
@@ -116,6 +116,10 @@
 
        l2->l_md.md_utf = tf;
 #if (USPACE > PAGE_SIZE) || !defined(_LP64)
+       CTASSERT(__arraycount(l2->l_md.md_upte) >= UPAGES);
+       for (u_int i = 0; i < __arraycount(l2->l_md.md_upte); i++) {
+               l2->l_md.md_upte[i] = 0;
+       }
        if (!pmap_md_direct_mapped_vaddr_p(ua2)) {
                CTASSERT((PGSHIFT == 12) == (UPAGES == 2));
                pt_entry_t * const pte = pmap_pte_lookup(pmap_kernel(), ua2);
@@ -128,6 +132,8 @@
                        l2->l_md.md_upte[i] = pte[i] & ~x;
                }
        }
+#else
+       KASSERT(pmap_md_direct_mapped_vaddr_p(ua2));
 #endif
        /*
         * Rig kernel stack so that it would start out in lwp_trampoline()



Home | Main Index | Thread Index | Old Index