From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: star.zeng@intel.com) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by groups.io with SMTP; Tue, 21 May 2019 20:26:36 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 May 2019 20:26:35 -0700 X-ExtLoop1: 1 Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.158.82]) by fmsmga008.fm.intel.com with ESMTP; 21 May 2019 20:26:34 -0700 From: "Zeng, Star" To: devel@edk2.groups.io Cc: Star Zeng , Laszlo Ersek , Eric Dong , Ruiyu Ni , Chandana Kumar , Kevin Li Subject: [PATCH] UefiCpuPkg CpuCommFeaturesLib: Fix ASSERT if LMCE is supported Date: Wed, 22 May 2019 11:26:32 +0800 Message-Id: <20190522032632.89416-1-star.zeng@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. BTW: A typo in LmceInitialize is also fixed. Change-Id: I32b63ba649fc2977e155181a6263009e359742ed Cc: Laszlo Ersek Cc: Eric Dong Cc: Ruiyu Ni Cc: Chandana Kumar Cc: Kevin Li Signed-off-by: Star Zeng --- UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.c | 2 +- UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.c b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.c index 738b57dc87f9..9ddc6ce9d476 100644 --- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.c +++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.c @@ -214,7 +214,7 @@ CpuCommonFeaturesLibConstructor ( if (IsCpuFeatureSupported (CPU_FEATURE_LMCE)) { Status = RegisterCpuFeature ( "LMCE", - NULL, + FeatureControlGetConfigData, LmceSupport, LmceInitialize, CPU_FEATURE_LMCE, diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c b/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c index 9ee559130080..2528e0044ecb 100644 --- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c +++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c @@ -322,7 +322,7 @@ LmceInitialize ( MSR_IA32_FEATURE_CONTROL_REGISTER *MsrRegister; // - // The scope of FastStrings bit in the MSR_IA32_MISC_ENABLE is core for below processor type, only program + // The scope of LcmeOn bit in the MSR_IA32_MISC_ENABLE is core for below processor type, only program // MSR_IA32_MISC_ENABLE for thread 0 in each core. // if (IS_SILVERMONT_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) || -- 2.21.0.windows.1