summaryrefslogtreecommitdiff
path: root/src/soc/amd/picasso
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-04-22 00:01:55 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-04-23 22:05:41 +0000
commit0ced2e85ba61e0ee859e4ba04cbe8a3dcccd20ac (patch)
treea0c6f226766d0a05b9ee045bb57d0ff467834bb4 /src/soc/amd/picasso
parent46dc1fbd48a4bf18998251428909dc3c2c867d12 (diff)
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 <felix-coreboot@felixheld.de> Change-Id: Ibb042635d917dfcb2121849e2913aa62eca09dd0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/52583 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Diffstat (limited to 'src/soc/amd/picasso')
-rw-r--r--src/soc/amd/picasso/mca.c6
1 files changed, 3 insertions, 3 deletions
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 <amdblocks/msr_zen.h>
#include <amdblocks/reset.h>
#include <cpu/x86/msr.h>
#include <acpi/acpi.h>
@@ -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);