From 0ced2e85ba61e0ee859e4ba04cbe8a3dcccd20ac Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 22 Apr 2021 00:01:55 +0200 Subject: soc/amd/picasso/mca: fix CTL_MASK MSR access MC0_CTL_MASK is no longer available in fam 17h and newer and will result in a general protection fault when accessed. This register was moved, so use the one that is correct for this CPU generation. BUG=b:186038401 TEST=Mandolin no longer crashes in the machine check error handling path with a general protection fault. Signed-off-by: Felix Held Change-Id: Ibb042635d917dfcb2121849e2913aa62eca09dd0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/52583 Tested-by: build bot (Jenkins) Reviewed-by: Marshall Dawson --- src/soc/amd/picasso/mca.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/soc/amd/picasso/mca.c b/src/soc/amd/picasso/mca.c index 16471b9ea7..0fd2d17cb5 100644 --- a/src/soc/amd/picasso/mca.c +++ b/src/soc/amd/picasso/mca.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include #include #include #include @@ -121,8 +122,7 @@ static void build_bert_mca_error(struct mca_bank *mci) IA32_MC0_CTL + (mci->bank * 4), 4); if (!ctx) goto failed; - ctx = cper_new_ia32x64_context_msr(status, x86_sec, - MC0_CTL_MASK + mci->bank, 1); + ctx = cper_new_ia32x64_context_msr(status, x86_sec, MCA_CTL_MASK_MSR(mci->bank), 1); if (!ctx) goto failed; @@ -176,7 +176,7 @@ void check_mca(void) mci.ctl = rdmsr(IA32_MC0_CTL + (i * 4)); printk(BIOS_WARNING, " MC%d_CTL = %08x_%08x\n", i, mci.ctl.hi, mci.ctl.lo); - mci.cmask = rdmsr(MC0_CTL_MASK + i); + mci.cmask = rdmsr(MCA_CTL_MASK_MSR(i)); printk(BIOS_WARNING, " MC%d_CTL_MASK = %08x_%08x\n", i, mci.cmask.hi, mci.cmask.lo); -- cgit v1.2.3