Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/sparc64 check for TLB_V bit for valid tte e...



details:   https://anonhg.NetBSD.org/src/rev/3e0037b7dc51
branches:  trunk
changeset: 752355:3e0037b7dc51
user:      mrg <mrg%NetBSD.org@localhost>
date:      Wed Feb 24 10:11:53 2010 +0000

description:
check for TLB_V bit for valid tte entries, not against zero.
KASSERT() the 3rd call to pseg_get() in pmap_page_cache() like the other 2.

diffstat:

 sys/arch/sparc64/sparc64/pmap.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (53 lines):

diff -r 425fdb876124 -r 3e0037b7dc51 sys/arch/sparc64/sparc64/pmap.c
--- a/sys/arch/sparc64/sparc64/pmap.c   Wed Feb 24 09:49:36 2010 +0000
+++ b/sys/arch/sparc64/sparc64/pmap.c   Wed Feb 24 10:11:53 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.253 2010/02/24 09:49:36 mrg Exp $   */
+/*     $NetBSD: pmap.c,v 1.254 2010/02/24 10:11:53 mrg Exp $   */
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.253 2010/02/24 09:49:36 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.254 2010/02/24 10:11:53 mrg Exp $");
 
 #undef NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define        HWREF
@@ -1320,7 +1320,7 @@
        /* Align with the start of a page table */
        for (kbreak &= (-1 << PDSHIFT); kbreak < maxkvaddr;
             kbreak += (1 << PDSHIFT)) {
-               if (pseg_get(pm, kbreak))
+               if (pseg_get(pm, kbreak) & TLB_V)
                        continue;
 
                pa = 0;
@@ -1578,7 +1578,7 @@
 #endif
 
                data = pseg_get(pm, va);
-               if (data == 0) {
+               if ((data & TLB_V) == 0) {
                        continue;
                }
 
@@ -1948,7 +1948,7 @@
 #endif
 
                data = pseg_get(pm, va);
-               if (data == 0) {
+               if ((data & TLB_V) == 0) {
                        continue;
                }
 
@@ -3344,6 +3344,7 @@
 
                        /* Disable caching */
                        data = pseg_get(pv->pv_pmap, va);
+                       KASSERT(data & TLB_V);
                        rv = pseg_set(pv->pv_pmap, va, data & ~TLB_CV, 0);
                        if (rv & 1)
                                panic("pmap_page_cache: pseg_set needs"



Home | Main Index | Thread Index | Old Index