Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm/pmap Remove the #if defined(__mips_n64) && PAGE_SIZE...



details:   https://anonhg.NetBSD.org/src/rev/448bb9e83904
branches:  trunk
changeset: 942940:448bb9e83904
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Aug 22 15:32:36 2020 +0000

description:
Remove the #if defined(__mips_n64) && PAGE_SIZE == 8192 and make the
check MI - all PTs are PAGE_SIZE aligned

diffstat:

 sys/uvm/pmap/pmap_segtab.c |  22 +++++++++-------------
 1 files changed, 9 insertions(+), 13 deletions(-)

diffs (50 lines):

diff -r afb47fc36186 -r 448bb9e83904 sys/uvm/pmap/pmap_segtab.c
--- a/sys/uvm/pmap/pmap_segtab.c        Sat Aug 22 15:25:50 2020 +0000
+++ b/sys/uvm/pmap/pmap_segtab.c        Sat Aug 22 15:32:36 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_segtab.c,v 1.21 2020/08/22 13:59:16 skrll Exp $   */
+/*     $NetBSD: pmap_segtab.c,v 1.22 2020/08/22 15:32:36 skrll Exp $   */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_segtab.c,v 1.21 2020/08/22 13:59:16 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_segtab.c,v 1.22 2020/08/22 15:32:36 skrll Exp $");
 
 /*
  *     Manages physical address maps.
@@ -171,6 +171,13 @@
 static void
 pmap_check_ptes(pt_entry_t *pte, const char *caller)
 {
+       /*
+        * All pte arrays should be page aligned.
+        */
+       if (((uintptr_t)pte & PAGE_MASK) != 0) {
+               panic("%s: pte entry at %p not page aligned", caller, pte);
+       }
+
 #ifdef DEBUG
        for (size_t i = 0; i < NPTEPG; i++)
                if (!pte_zero_p(pte[i])) {
@@ -283,17 +290,6 @@
                        continue;
                pmap_check_ptes(pte, __func__);
 
-#if defined(__mips_n64) && PAGE_SIZE == 8192
-               /*
-                * XXX This is evil.  If vinc is 1000000 we are in
-                * the last level, and this pte should be page aligned.
-                */
-               if (vinc == 0x1000000 && ((uintptr_t)pte & PAGE_MASK) != 0) {
-                       panic("%s: pte entry at %p not page aligned",
-                           __func__, pte);
-               }
-#endif
-
                /*
                 * If our caller wants a callback, do so.
                 */



Home | Main Index | Thread Index | Old Index