Revert "UefiCpuPkg: Check invalid RegisterCpuFeature parameter"
authorEric Dong <eric.dong@intel.com>
Thu, 21 Dec 2017 11:46:51 +0000 (19:46 +0800)
committerEric Dong <eric.dong@intel.com>
Wed, 27 Dec 2017 07:31:33 +0000 (15:31 +0800)
This reverts commit 5c59537c1092a1372913274636a8d766fdd97e61.

Current code already has function IsCpuFeatureSupported to do
the feature validation, not need this check logic anymore.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song <binx.song@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c

index fc3ccda..9331e49 100644 (file)
 #define CPU_FEATURE_APIC_TPR_UPDATE_MESSAGE         (32+9)\r
 #define CPU_FEATURE_ENERGY_PERFORMANCE_BIAS         (32+10)\r
 #define CPU_FEATURE_PPIN                            (32+11)\r
 #define CPU_FEATURE_APIC_TPR_UPDATE_MESSAGE         (32+9)\r
 #define CPU_FEATURE_ENERGY_PERFORMANCE_BIAS         (32+10)\r
 #define CPU_FEATURE_PPIN                            (32+11)\r
-//\r
-// Currently, CPU_FEATURE_PROC_TRACE is the MAX feature we support.\r
-// If you define a feature bigger than it, please also replace it\r
-// in RegisterCpuFeatureLibIsFeatureValid function.\r
-//\r
 #define CPU_FEATURE_PROC_TRACE                      (32+12)\r
 \r
 #define CPU_FEATURE_BEFORE_ALL                      BIT27\r
 #define CPU_FEATURE_PROC_TRACE                      (32+12)\r
 \r
 #define CPU_FEATURE_BEFORE_ALL                      BIT27\r
index 6ec26e1..dd6a82b 100644 (file)
@@ -80,34 +80,6 @@ DumpCpuFeature (
   }\r
 }\r
 \r
   }\r
 }\r
 \r
-/**\r
-  Determines if the CPU feature is valid.\r
-\r
-  @param[in]  Feature        Pointer to CPU feature\r
-\r
-  @retval TRUE  The CPU feature is valid.\r
-  @retval FALSE The CPU feature is invalid.\r
-**/\r
-BOOLEAN\r
-RegisterCpuFeatureLibIsFeatureValid (\r
-  IN UINT32        Feature\r
-  )\r
-{\r
-  UINT32      Data;\r
-\r
-  Data = Feature;\r
-  Data &= ~(CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER | CPU_FEATURE_BEFORE_ALL | CPU_FEATURE_AFTER_ALL);\r
-  //\r
-  // Currently, CPU_FEATURE_PROC_TRACE is the MAX feature we support.\r
-  // If you define a feature bigger than it, please replace it at below.\r
-  //\r
-  if (Data > CPU_FEATURE_PROC_TRACE) {\r
-    DEBUG ((DEBUG_ERROR, "Invalid CPU feature: 0x%x ", Feature));\r
-    return FALSE;\r
-  }\r
-  return TRUE;\r
-}\r
-\r
 /**\r
   Determines if the feature bit mask is in dependent CPU feature bit mask buffer.\r
 \r
 /**\r
   Determines if the feature bit mask is in dependent CPU feature bit mask buffer.\r
 \r
@@ -472,7 +444,6 @@ RegisterCpuFeature (
 \r
   VA_START (Marker, InitializeFunc);\r
   Feature = VA_ARG (Marker, UINT32);\r
 \r
   VA_START (Marker, InitializeFunc);\r
   Feature = VA_ARG (Marker, UINT32);\r
-  ASSERT (RegisterCpuFeatureLibIsFeatureValid(Feature));\r
   while (Feature != CPU_FEATURE_END) {\r
     ASSERT ((Feature & (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER))\r
                     != (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER));\r
   while (Feature != CPU_FEATURE_END) {\r
     ASSERT ((Feature & (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER))\r
                     != (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER));\r