From 852b3935c9f21746d91d06f9f195e5969a302925 Mon Sep 17 00:00:00 2001 From: Eric Dong Date: Fri, 14 Jul 2017 10:23:48 +0800 Subject: [PATCH] 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 --- .../RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; } -- 2.39.2