Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/mpc6xx Fix bug in pte_spill (wasn't searchi...



details:   https://anonhg.NetBSD.org/src/rev/9602af162811
branches:  trunk
changeset: 517025:9602af162811
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Nov 05 06:44:11 2001 +0000

description:
Fix bug in pte_spill (wasn't searching the right pvo_table list for the
victim PTE is the PTE was a secondary entry).

diffstat:

 sys/arch/powerpc/mpc6xx/pmap.c |  30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)

diffs (51 lines):

diff -r a047d0f7ab6e -r 9602af162811 sys/arch/powerpc/mpc6xx/pmap.c
--- a/sys/arch/powerpc/mpc6xx/pmap.c    Mon Nov 05 06:24:55 2001 +0000
+++ b/sys/arch/powerpc/mpc6xx/pmap.c    Mon Nov 05 06:44:11 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.32 2001/11/05 06:24:55 matt Exp $   */
+/*     $NetBSD: pmap.c,v 1.33 2001/11/05 06:44:11 matt Exp $   */
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -676,7 +676,7 @@
                 * We also need the pvo entry of the victim we are replacing
                 * so save the R & C bits of the PTE.
                 */
-               if (victim_pvo == NULL &&
+               if ((pt->pte_hi & PTE_HID) == 0 && victim_pvo == NULL &&
                    pmap_pte_compare(pt, &pvo->pvo_pte)) {
                        victim_pvo = pvo;
                        if (source_pvo != NULL)
@@ -687,8 +687,30 @@
        if (source_pvo == NULL)
                return 0;
 
-       if (victim_pvo == NULL)
-               panic("pmap_pte_spill: victim pte (%p) has no pvo entry!", pt);
+       if (victim_pvo == NULL) {
+               if ((pt->pte_hi & PTE_HID) == 0)
+                       panic("pmap_pte_spill: victim p-pte (%p) has "
+                           "no pvo entry!", pt);
+               /*
+                * If this is a secondary PTE, we need to search
+                * its primary pvo bucket for the matching PVO.
+                */
+               LIST_FOREACH(pvo, &pmap_pvo_table[ptegidx ^ pmap_pteg_mask],
+                   pvo_olink) {
+                       PMAP_PVO_CHECK(pvo);            /* sanity check */
+                       /*
+                        * We also need the pvo entry of the victim we are
+                        * replacing so save the R & C bits of the PTE.
+                        */
+                       if (pmap_pte_compare(pt, &pvo->pvo_pte)) {
+                               victim_pvo = pvo;
+                               break;
+                       }
+               }
+               if (victim_pvo == NULL)
+                       panic("pmap_pte_spill: victim s-pte (%p) has "
+                           "no pvo entry!", pt);
+       }
 
        /*
         * We are invalidating the TLB entry for the EA for the



Home | Main Index | Thread Index | Old Index