]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/CpuCommonFeaturesLib: Add CPUID MCA support check
authorEric Dong <eric.dong@intel.com>
Thu, 17 Aug 2017 03:33:30 +0000 (11:33 +0800)
committerEric Dong <eric.dong@intel.com>
Mon, 28 Aug 2017 07:23:21 +0000 (15:23 +0800)
Add CPUID check to see if the CPU supports the Machine Check
Architecture before accessing the Machine Check Architecture
related MSRs.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
UefiCpuPkg/Library/CpuCommonFeaturesLib/Lmce.c

index 65e5cd3ca52472e4d8a0e42df388e6d7d2b10189..bf7e26b8513e18337618e583159bf08fc08f283d 100644 (file)
@@ -41,6 +41,10 @@ LmceSupport (
 {\r
   MSR_IA32_MCG_CAP_REGISTER    McgCap;\r
 \r
+  if (!McaSupport (ProcessorNumber, CpuInfo, ConfigData)) {\r
+    return FALSE;\r
+  }\r
+\r
   McgCap.Uint64 = AsmReadMsr64 (MSR_IA32_MCG_CAP);\r
   if (ProcessorNumber == 0) {\r
     DEBUG ((EFI_D_INFO, "LMCE eanble = %x\n", (BOOLEAN) (McgCap.Bits.MCG_LMCE_P != 0)));\r