2006-01-20 Till Straumann <strauman@slac.stanford.edu>

* mpc6xx/mmu/pte121.c: consistency check now warns instead
    of reporting an error when coming across a non 1:1 VSID;
    fix: triv121IsRangeMapped() needs to convert segment offset
    into a page index if the vsid argument is non-special.
This commit is contained in:
Till Straumann
2006-01-21 01:46:07 +00:00
parent 4398f42c88
commit 0f1590b49b
2 changed files with 37 additions and 9 deletions

View File

@@ -1,3 +1,9 @@
2006-01-20 Till Straumann <strauman@slac.stanford.edu>
* mpc6xx/mmu/pte121.c: consistency check now warns instead
of reporting an error when coming across a non 1:1 VSID;
fix: triv121IsRangeMapped() needs to convert segment offset
into a page index if the vsid argument is non-special.
2006-01-05 Till Straumann <strauman@slac.stanford.edu> 2006-01-05 Till Straumann <strauman@slac.stanford.edu>
* shared/include/cpuIdent.c: Accept PPC_PSIM as a * shared/include/cpuIdent.c: Accept PPC_PSIM as a
known variant. known variant.

View File

@@ -694,6 +694,7 @@ triv121PgTblConsistency (Triv121PgTbl pt, int pass, int expected)
int i; int i;
unsigned v, m; unsigned v, m;
int warn = 0; int warn = 0;
int errs = 0;
static int maxw = 20; /* mute after detecting this many errors */ static int maxw = 20; /* mute after detecting this many errors */
PRINTF ("Checking page table at 0x%08x (size %i==0x%x)\n", PRINTF ("Checking page table at 0x%08x (size %i==0x%x)\n",
@@ -734,12 +735,16 @@ triv121PgTblConsistency (Triv121PgTbl pt, int pass, int expected)
/* never reached */ ; /* never reached */ ;
#endif #endif
if ((*lp & (0xfffff0 << 7)) || *(lp + 1) & 0xe00 if ( /* T.S: allow any VSID... (*lp & (0xfffff0 << 7)) || */ (*(lp + 1) & 0xe00)
|| (pte->v && pte->marked)) { || (pte->v && pte->marked)) {
/* check for vsid (without segment bits) == 0, unused bits == 0, valid && marked */ /* check for vsid (without segment bits) == 0, unused bits == 0, valid && marked */
sprintf (buf, "invalid VSID , unused bits or v && m"); sprintf (buf, "unused bits or v && m");
err = 1; err = 1;
} else { } else {
if ( (*lp & (0xfffff0 << 7)) ) {
sprintf(buf,"(warning) non-1:1 VSID found");
err = 2;
}
if (pte->v) if (pte->v)
v++; v++;
if (pte->marked) if (pte->marked)
@@ -751,13 +756,23 @@ triv121PgTblConsistency (Triv121PgTbl pt, int pass, int expected)
pass, (unsigned) pte, i, i); pass, (unsigned) pte, i, i);
PRINTF ("Reason: %s\n", buf); PRINTF ("Reason: %s\n", buf);
dumpPte (pte); dumpPte (pte);
if ( err & 2 ) {
warn++; warn++;
} else {
errs++;
}
maxw--; maxw--;
} }
} }
if (errs) {
PRINTF ("%i errors %s", errs, warn ? "and ":"");
}
if (warn) { if (warn) {
PRINTF ("%i errors found; currently %i entries marked, %i are valid\n", PRINTF ("%i warnings ",warn);
warn, m, v); }
if (errs || warn) {
PRINTF ("found; currently %i entries marked, %i are valid\n",
m, v);
} }
v += m; v += m;
if (maxw && expected >= 0 && expected != v) { if (maxw && expected >= 0 && expected != v) {
@@ -963,9 +978,9 @@ dumpPteg (unsigned long vsid, unsigned long pi, unsigned long hash)
} }
#endif #endif
/* Verify that a range of EAs is mapped the page table /* Verify that a range of addresses is mapped the page table.
* (if vsid has one of the special values -- otherwise, * start/end are segment offsets or EAs (if vsid has one of
* start/end are page indices). * the special values), respectively.
* *
* RETURNS: address of the first page for which no * RETURNS: address of the first page for which no
* PTE was found (i.e. page index * page size) * PTE was found (i.e. page index * page size)
@@ -974,12 +989,19 @@ dumpPteg (unsigned long vsid, unsigned long pi, unsigned long hash)
* [which is not page aligned and hence is not * [which is not page aligned and hence is not
* a valid page address]. * a valid page address].
*/ */
unsigned long unsigned long
triv121IsRangeMapped (long vsid, unsigned long start, unsigned long end) triv121IsRangeMapped (long vsid, unsigned long start, unsigned long end)
{ {
unsigned pi;
start &= ~((1 << LD_PG_SIZE) - 1); start &= ~((1 << LD_PG_SIZE) - 1);
while (start < end) { while (start < end) {
if (!alreadyMapped (&pgTbl, vsid, start)) if ( TRIV121_SEG_VSID != vsid && TRIV121_121_VSID != vsid )
pi = PI121(start);
else
pi = start;
if (!alreadyMapped (&pgTbl, vsid, pi))
return start; return start;
start += 1 << LD_PG_SIZE; start += 1 << LD_PG_SIZE;
} }