From: Eric Dong Date: Fri, 14 Jul 2017 02:23:48 +0000 (+0800) Subject: UefiCpuPkg RegisterCpuFeaturesLib: Add error handling. X-Git-Tag: edk2-stable201903~3794 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=852b3935c9f21746d91d06f9f195e5969a302925 UefiCpuPkg RegisterCpuFeaturesLib: Add error handling. Disable CPU feature may return error, add error handling code to handle it instead of assert it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong Reviewed-by: Jeff Fan --- diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c index e91a4388b4..7a7673035d 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c @@ -536,7 +536,14 @@ AnalysisProcessorFeatures ( } } else { Status = CpuFeatureInOrder->InitializeFunc (ProcessorNumber, CpuInfo, CpuFeatureInOrder->ConfigData, FALSE); - ASSERT_EFI_ERROR (Status); + if (EFI_ERROR (Status)) { + if (CpuFeatureInOrder->FeatureName != NULL) { + DEBUG ((DEBUG_WARN, "Warning :: Failed to enable Feature Name = %a.\n", CpuFeatureInOrder->FeatureName)); + } else { + DEBUG ((DEBUG_WARN, "Warning :: Failed to enable Feature Mask = ")); + DumpCpuFeatureMask (CpuFeatureInOrder->FeatureMask); + } + } } Entry = Entry->ForwardLink; }