Skip to content

Commit

Permalink
hw/phb4: Add a helper to dump the PELT-V
Browse files Browse the repository at this point in the history
The "Partitionable Endpoint Lookup Table (Vector)" is used by the PHB
when processing EEH events. The PELT-V defines which PEs should be
additionally frozen in the event of an error being flagged on a
given PE. Knowing the state of the PELT-V is sometimes useful for
debugging PHB issues so this patch adds a helper to dump it.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
oohal authored and stewartsmith committed Jul 26, 2018
1 parent 2710351 commit d1ac168
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions hw/phb4.c
Original file line number Diff line number Diff line change
Expand Up @@ -1933,6 +1933,46 @@ static void phb4_read_phb_status(struct phb4 *p,
}
}

static void __unused phb4_dump_peltv(struct phb4 *p)
{
int stride = p->max_num_pes / 64;
uint64_t *tbl = (void *) p->tbl_peltv;
unsigned int pe;

PHBERR(p, "PELT-V: base addr: %p size: %llx (%d PEs, stride = %d)\n",
tbl, p->tbl_peltv_size, p->max_num_pes, stride);

for (pe = 0; pe < p->max_num_pes; pe++) {
unsigned int i, j;
uint64_t sum = 0;

i = pe * stride;

/*
* Only print an entry if there's bits set in the PE's
* PELT-V entry. There's a few hundred possible PEs and
* generally only a handful will be in use.
*/

for (j = 0; j < stride; j++)
sum |= tbl[i + j];
if (!sum)
continue; /* unused PE, skip it */

if (p->max_num_pes == 512) {
PHBERR(p, "PELT-V[%03x] = "
"%016llx %016llx %016llx %016llx"
"%016llx %016llx %016llx %016llx\n", pe,
tbl[i + 0], tbl[i + 1], tbl[i + 2], tbl[i + 3],
tbl[i + 4], tbl[i + 5], tbl[i + 6], tbl[i + 7]);
} else if (p->max_num_pes == 256) {
PHBERR(p, "PELT-V[%03x] = "
"%016llx %016llx %016llx %016llx\n", pe,
tbl[i + 0], tbl[i + 1], tbl[i + 2], tbl[i + 3]);
}
}
}

static void phb4_eeh_dump_regs(struct phb4 *p)
{
struct OpalIoPhb4ErrorData *s;
Expand Down

0 comments on commit d1ac168

Please sign in to comment.