Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/56245 )
Change subject: soc/intel/common/block/cpu/cpulib: use mca_get_bank_count() ......................................................................
soc/intel/common/block/cpu/cpulib: use mca_get_bank_count()
Use the common mca_get_bank_count function instead of open-coding the functionality to get the MCA bank number. Also re-type the num_banks variable from signed in to unsigned int, since the number of MCA bank is always positive, and make it constant.
Change-Id: I449c74629ff16057c4559d7fd3620208230560f5 Signed-off-by: Felix Held felix-coreboot@felixheld.de Reviewed-on: https://review.coreboot.org/c/coreboot/+/56245 Reviewed-by: Raul Rangel rrangel@chromium.org Reviewed-by: Patrick Rudolph siro@das-labor.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/intel/common/block/cpu/cpulib.c 1 file changed, 1 insertion(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Rudolph: Looks good to me, approved Raul Rangel: Looks good to me, approved
diff --git a/src/soc/intel/common/block/cpu/cpulib.c b/src/soc/intel/common/block/cpu/cpulib.c index 9e95b0f..a245824 100644 --- a/src/soc/intel/common/block/cpu/cpulib.c +++ b/src/soc/intel/common/block/cpu/cpulib.c @@ -338,12 +338,10 @@ { msr_t msr; int i; - int num_banks; + const unsigned int num_banks = mca_get_bank_count();
printk(BIOS_DEBUG, "Clearing out pending MCEs\n");
- msr = rdmsr(IA32_MCG_CAP); - num_banks = msr.lo & 0xff; msr.lo = msr.hi = 0;
for (i = 0; i < num_banks; i++) {