diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2018-08-21 14:27:14 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2018-09-13 15:19:36 +1000 |
commit | cfecc3960c00ea9a9871c2358d8710c5d2c6539b (patch) | |
tree | 0f65fd185c3f835d365fb8752fa852ef2b49e531 /hw/phb4.c | |
parent | ea4e422f6343925ad3acb2aac421c5236684b00e (diff) | |
download | talos-skiboot-cfecc3960c00ea9a9871c2358d8710c5d2c6539b.tar.gz talos-skiboot-cfecc3960c00ea9a9871c2358d8710c5d2c6539b.zip |
phb4: Don't try to access non-existent PEST entries
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>
Diffstat (limited to 'hw/phb4.c')
-rw-r--r-- | hw/phb4.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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]; } @@ -2141,7 +2141,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[%03x] = %016llx %016llx\n", |