]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg CpuCommFeaturesLib: Fix ASSERT if LMCE is supported
authorStar Zeng <star.zeng@intel.com>
Wed, 22 May 2019 03:21:22 +0000 (11:21 +0800)
committerStar Zeng <star.zeng@intel.com>
Thu, 6 Jun 2019 10:52:07 +0000 (18:52 +0800)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1829

There will be ASSERT if LMCE is supported as below.
DXE_ASSERT!: [CpuFeaturesDxe]
  XXX\UefiCpuPkg\Library\CpuCommonFeaturesLib\MachineCheck.c (342):
    ConfigData != ((void *) 0)

The code should get Config Data and FeatureControlGetConfigData
could be used.

This issue is there since the code was added at the commit below.

Revision: 3d6275c1137c9633ce24e31522b71105367bd6a0
Date: 2017/8/4 8:46:41
UefiCpuPkg CpuCommonFeaturesLib: Enable LMCE feature.

The commits below are also related to move the code.

Revision: 023387144299741d727521b425ef443438aecc1f
Date: 2017/9/1 10:12:38
UefiCpuPkg/Lmce.c Remove useless file.

Revision: 306a5bcc6b0170d28b0db10bd359817bb4b1db9f
Date: 2017/8/17 11:40:38
UefiCpuPkg/CpuCommonFeaturesLib: Merge machine check code to same file.

So, the code may not be tested at all on a platform
that supports LMCE.

BTW: A typo in LmceInitialize is also fixed.
The typo is introduced by the commit below.

Revision: d28daaddb3e732468e930a809d3d3943a5de9558
Date: 2018/10/17 9:24:05
UefiCpuPkg/CpuCommonFeaturesLib: Register MSR base on scope Info.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Chandana Kumar <chandana.c.kumar@intel.com>
Cc: Kevin Li <kevin.y.li@intel.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.c
UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c

index 738b57dc87f96fa19fe34a78afbd5d299de17176..9ddc6ce9d4764cfc785b8f7297e5ed2cd06e8e96 100644 (file)
@@ -214,7 +214,7 @@ CpuCommonFeaturesLibConstructor (
   if (IsCpuFeatureSupported (CPU_FEATURE_LMCE)) {\r
     Status = RegisterCpuFeature (\r
                "LMCE",\r
-               NULL,\r
+               FeatureControlGetConfigData,\r
                LmceSupport,\r
                LmceInitialize,\r
                CPU_FEATURE_LMCE,\r
index 9ee5591300804261640eda11a926c7532ad42dae..2528e0044ecbdfacbe1d315f1faaf5593c9f7dd4 100644 (file)
@@ -322,7 +322,7 @@ LmceInitialize (
   MSR_IA32_FEATURE_CONTROL_REGISTER    *MsrRegister;\r
 \r
   //\r
-  // The scope of FastStrings bit in the MSR_IA32_MISC_ENABLE is core for below processor type, only program\r
+  // The scope of LcmeOn bit in the MSR_IA32_MISC_ENABLE is core for below processor type, only program\r
   // MSR_IA32_MISC_ENABLE for thread 0 in each core.\r
   //\r
   if (IS_SILVERMONT_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||\r