aboutsummaryrefslogtreecommitdiff
path: root/hw/phb4.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2018-08-21 14:27:14 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-09-13 18:32:17 +1000
commitecd2b6cd20a0fb5600fc5dfb20383d57e9c2f24e (patch)
tree4abb91b3e03d687638088d6d8b09b0e0d02f66ee /hw/phb4.c
parent54ac06ff404bf13d0a8035985ff67e0610213f5a (diff)
downloadskiboot-ecd2b6cd20a0fb5600fc5dfb20383d57e9c2f24e.zip
skiboot-ecd2b6cd20a0fb5600fc5dfb20383d57e9c2f24e.tar.gz
skiboot-ecd2b6cd20a0fb5600fc5dfb20383d57e9c2f24e.tar.bz2
phb4: Don't try to access non-existent PEST entries
[ Upstream commit cfecc3960c00ea9a9871c2358d8710c5d2c6539b ] In a POWER9 chip, some PHB4s have 256 PEs, some have 512. Currently, the diagnostics code retrieves 512 unconditionally, which is wrong and causes us to incorrectly report bogus values for the "high" PEs on the small PHBs. Use the actual number of implemented PEs instead Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hw/phb4.c')
-rw-r--r--hw/phb4.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/phb4.c b/hw/phb4.c
index 8367bba..3a4cc85 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -1921,13 +1921,13 @@ static void phb4_read_phb_status(struct phb4 *p,
*/
pPEST = (uint64_t *)p->tbl_pest;
phb4_ioda_sel(p, IODA3_TBL_PESTA, 0, true);
- for (i = 0; i < OPAL_PHB4_NUM_PEST_REGS; i++) {
+ for (i = 0; i < p->max_num_pes; i++) {
stat->pestA[i] = phb4_read_reg_asb(p, PHB_IODA_DATA0);
stat->pestA[i] |= pPEST[2 * i];
}
phb4_ioda_sel(p, IODA3_TBL_PESTB, 0, true);
- for (i = 0; i < OPAL_PHB4_NUM_PEST_REGS; i++) {
+ for (i = 0; i < p->max_num_pes; i++) {
stat->pestB[i] = phb4_read_reg_asb(p, PHB_IODA_DATA0);
stat->pestB[i] |= pPEST[2 * i + 1];
}
@@ -2012,7 +2012,7 @@ static void phb4_eeh_dump_regs(struct phb4 *p)
PHBERR(p, " phbRegbErrorLog0 = %016llx\n", s->phbRegbErrorLog0);
PHBERR(p, " phbRegbErrorLog1 = %016llx\n", s->phbRegbErrorLog1);
- for (i = 0; i < OPAL_PHB4_NUM_PEST_REGS; i++) {
+ for (i = 0; i < p->max_num_pes; i++) {
if (!s->pestA[i] && !s->pestB[i])
continue;
PHBERR(p, " PEST[%03d] = %016llx %016llx\n",