Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/booke Don't use TLB1 entries for device acc...



details:   https://anonhg.NetBSD.org/src/rev/eac7fe7ebd38
branches:  trunk
changeset: 766677:eac7fe7ebd38
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Jun 29 23:15:55 2011 +0000

description:
Don't use TLB1 entries for device access if they are writethrough or not
cache-inhibited.

diffstat:

 sys/arch/powerpc/booke/e500_tlb.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r 1f8686662706 -r eac7fe7ebd38 sys/arch/powerpc/booke/e500_tlb.c
--- a/sys/arch/powerpc/booke/e500_tlb.c Wed Jun 29 21:53:10 2011 +0000
+++ b/sys/arch/powerpc/booke/e500_tlb.c Wed Jun 29 23:15:55 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: e500_tlb.c,v 1.5 2011/06/23 05:42:27 matt Exp $        */
+/*     $NetBSD: e500_tlb.c,v 1.6 2011/06/29 23:15:55 matt Exp $        */
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: e500_tlb.c,v 1.5 2011/06/23 05:42:27 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_tlb.c,v 1.6 2011/06/29 23:15:55 matt Exp $");
 
 #include <sys/param.h>
 
@@ -689,9 +689,13 @@
 
        /*
         * See if we have a TLB entry for the pa.  If completely falls within
-        * mark the reference and return the pa.
+        * mark the reference and return the pa.  But only if the tlb entry
+        * is not cacheable.
         */
-       if (xtlb && pa + len <= xtlb->e_tlb.tlb_va + xtlb->e_tlb.tlb_size) {
+       if (xtlb
+           && pa + len <= xtlb->e_tlb.tlb_va + xtlb->e_tlb.tlb_size
+           && ((xtlb->e_tlb.tlb_pte & PTE_W) == 0
+               || (xtlb->e_tlb.tlb_pte & PTE_I) == PTE_I)) {
                xtlb->e_refcnt++;
                return (void *) pa;
        }



Home | Main Index | Thread Index | Old Index