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>
This commit is contained in:
Felix Held 2021-04-22 00:01:55 +02:00
parent 46dc1fbd48
commit 0ced2e85ba
1 changed files with 3 additions and 3 deletions

View File

@ -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);