]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg RegisterCpuFeaturesLib: Add error handling.
authorEric Dong <eric.dong@intel.com>
Fri, 14 Jul 2017 02:23:48 +0000 (10:23 +0800)
committerEric Dong <eric.dong@intel.com>
Thu, 20 Jul 2017 06:11:14 +0000 (14:11 +0800)
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 <eric.dong@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c

index e91a4388b4ec70beeda2995174d6a47117754829..7a7673035dfaecd3d594f6d09c69f8b5c9fc3282 100644 (file)
@@ -536,7 +536,14 @@ AnalysisProcessorFeatures (
         }\r
       } else {\r
         Status = CpuFeatureInOrder->InitializeFunc (ProcessorNumber, CpuInfo, CpuFeatureInOrder->ConfigData, FALSE);\r
-        ASSERT_EFI_ERROR (Status);\r
+        if (EFI_ERROR (Status)) {\r
+          if (CpuFeatureInOrder->FeatureName != NULL) {\r
+            DEBUG ((DEBUG_WARN, "Warning :: Failed to enable Feature Name = %a.\n", CpuFeatureInOrder->FeatureName));\r
+          } else {\r
+            DEBUG ((DEBUG_WARN, "Warning :: Failed to enable Feature Mask = "));\r
+            DumpCpuFeatureMask (CpuFeatureInOrder->FeatureMask);\r
+          }\r
+        }\r
       }\r
       Entry = Entry->ForwardLink;\r
     }\r