Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/alpha Fix a bug in TBI optimization uncovered by th...



details:   https://anonhg.NetBSD.org/src/rev/546a094e615e
branches:  trunk
changeset: 471716:546a094e615e
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Apr 09 00:38:10 1999 +0000

description:
Fix a bug in TBI optimization uncovered by the "access_type" changes.  Thanks
to Bernd Ernesti for providing crash dumps to Charles Hannum who tracked
it down.

diffstat:

 sys/arch/alpha/alpha/pmap.c  |  25 +++++++++++++------------
 sys/arch/alpha/include/pte.h |   8 +++-----
 2 files changed, 16 insertions(+), 17 deletions(-)

diffs (90 lines):

diff -r 1ca48c93ee48 -r 546a094e615e sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c       Fri Apr 09 00:22:43 1999 +0000
+++ b/sys/arch/alpha/alpha/pmap.c       Fri Apr 09 00:38:10 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.88 1999/03/29 05:31:24 mycroft Exp $ */
+/* $NetBSD: pmap.c,v 1.89 1999/04/09 00:38:10 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -155,7 +155,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.88 1999/03/29 05:31:24 mycroft Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.89 1999/04/09 00:38:10 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1569,7 +1569,7 @@
        vm_prot_t access_type;
 {
        boolean_t managed;
-       pt_entry_t *pte, npte;
+       pt_entry_t *pte, npte, opte;
        paddr_t opa;
        boolean_t tflush = TRUE;
        boolean_t hadasm = FALSE;       /* XXX gcc -Wuninitialized */
@@ -1663,6 +1663,9 @@
                pte = pmap_l3pte(pmap, va, l2pte);
        }
 
+       /* Remember all of the old PTE; used for TBI check later. */
+       opte = *pte;
+
        /*
         * Check to see if the old mapping is valid.  If not, validate the
         * new one immediately.
@@ -1715,15 +1718,6 @@
                }
 
                /*
-                * Check to see if the PALcode portion of the
-                * PTE is the same.  If so, no TLB invalidation
-                * is necessary.
-                */
-               if (PG_PALCODE(pmap_pte_prot(pte)) ==
-                   PG_PALCODE(pte_prot(pmap, prot)))
-                       tflush = FALSE;
-
-               /*
                 * Set the PTE.
                 */
                goto validate;
@@ -1803,6 +1797,13 @@
 #endif
 
        /*
+        * If the PALcode portion of the new PTE is the same as the
+        * old PTE, no TBI is necessary.
+        */
+       if (PG_PALCODE(opte) == PG_PALCODE(npte))
+               tflush = FALSE;
+
+       /*
         * Set the new PTE.
         */
        *pte = npte;
diff -r 1ca48c93ee48 -r 546a094e615e sys/arch/alpha/include/pte.h
--- a/sys/arch/alpha/include/pte.h      Fri Apr 09 00:22:43 1999 +0000
+++ b/sys/arch/alpha/include/pte.h      Fri Apr 09 00:38:10 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pte.h,v 1.25 1998/08/14 16:50:03 thorpej Exp $ */
+/* $NetBSD: pte.h,v 1.26 1999/04/09 00:38:11 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -110,11 +110,9 @@
 
 /*
  * These are the PALcode PTE bits that we care about when checking to see
- * if a PTE has changed in such a way as to require a TBI.  We don't care
- * about the FOx bits because we always remember the state of those bits and
- * set them to mirror what the TB has (they are used for mod/ref emulation).
+ * if a PTE has changed in such a way as to require a TBI.
  */
-#define        PG_PALCODE(x)   ((x) & (ALPHA_PTE_PALCODE & ~(PG_FOR|PG_FOW|PG_FOE)))
+#define        PG_PALCODE(x)   ((x) & ALPHA_PTE_PALCODE)
 
 #if defined(_KERNEL) || defined(__KVM_ALPHA_PRIVATE)
 #define        NPTEPG_SHIFT    (PAGE_SHIFT - PTESHIFT)



Home | Main Index | Thread Index | Old Index