From ac401975581daf1e4e353898f7441eeb668ba304 Mon Sep 17 00:00:00 2001 From: Eric Dong Date: Thu, 17 Aug 2017 11:33:30 +0800 Subject: UefiCpuPkg/CpuCommonFeaturesLib: Add CPUID MCA support check Add CPUID check to see if the CPU supports the Machine Check Architecture before accessing the Machine Check Architecture related MSRs. Cc: Michael Kinney Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong Reviewed-by: Ruiyu Ni --- UefiCpuPkg/Library/CpuCommonFeaturesLib/Lmce.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'UefiCpuPkg/Library/CpuCommonFeaturesLib') diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Lmce.c b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Lmce.c index 65e5cd3ca5..bf7e26b851 100644 --- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Lmce.c +++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Lmce.c @@ -41,6 +41,10 @@ LmceSupport ( { MSR_IA32_MCG_CAP_REGISTER McgCap; + if (!McaSupport (ProcessorNumber, CpuInfo, ConfigData)) { + return FALSE; + } + McgCap.Uint64 = AsmReadMsr64 (MSR_IA32_MCG_CAP); if (ProcessorNumber == 0) { DEBUG ((EFI_D_INFO, "LMCE eanble = %x\n", (BOOLEAN) (McgCap.Bits.MCG_LMCE_P != 0))); -- cgit v1.2.3