Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/56274 )
Change subject: soc/amd/picasso: check length of mca_bank_name array ......................................................................
soc/amd/picasso: check length of mca_bank_name array
The length of mca_bank_name should match the return value of mca_get_bank_count which gets the number of MCA banks from an MSR.
TEST=No error message on serial console on amd/mandolin
Change-Id: Ibdad51a7ef27266e110dfbb43188361952618342 Signed-off-by: Felix Held felix-coreboot@felixheld.de Reviewed-on: https://review.coreboot.org/c/coreboot/+/56274 Reviewed-by: Raul Rangel rrangel@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/amd/picasso/mca.c 1 file changed, 3 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Raul Rangel: Looks good to me, approved
diff --git a/src/soc/amd/picasso/mca.c b/src/soc/amd/picasso/mca.c index fcc9d3e..ade8c50 100644 --- a/src/soc/amd/picasso/mca.c +++ b/src/soc/amd/picasso/mca.c @@ -184,6 +184,9 @@ struct mca_bank_status mci; const unsigned int num_banks = mca_get_bank_count();
+ if (ARRAY_SIZE(mca_bank_name) != num_banks) + printk(BIOS_WARNING, "CPU has an unexpected number of MCA banks!\n"); + for (unsigned int i = 0 ; i < num_banks ; i++) { mci.bank = i; mci.sts = rdmsr(MCAX_STATUS_MSR(i));