public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] UefiCpuPkg CpuCommonFeaturesLib: Remove CPU generation check
@ 2019-05-16 10:33 Zeng, Star
  2019-05-16 13:06 ` Laszlo Ersek
  0 siblings, 1 reply; 9+ messages in thread
From: Zeng, Star @ 2019-05-16 10:33 UTC (permalink / raw)
  To: devel; +Cc: Star Zeng, Laszlo Ersek, Eric Dong, Ruiyu Ni, Chandana Kumar

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1679

The checking to CpuInfo->CpuIdVersionInfoEcx.Bits.AESNI is enough,
the checking to CPU generation could be removed, then the code
could be reused by more platforms.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Chandana Kumar <chandana.c.kumar@intel.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c
index b79446ba3ca9..4a56eec1b267 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c
@@ -57,15 +57,9 @@ AesniSupport (
   MSR_SANDY_BRIDGE_FEATURE_CONFIG_REGISTER   *MsrFeatureConfig;
 
   if (CpuInfo->CpuIdVersionInfoEcx.Bits.AESNI == 1) {
-    if (IS_SANDY_BRIDGE_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
-        IS_SILVERMONT_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
-        IS_XEON_5600_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
-        IS_XEON_E7_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
-        IS_XEON_PHI_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel)) {
-      MsrFeatureConfig = (MSR_SANDY_BRIDGE_FEATURE_CONFIG_REGISTER *) ConfigData;
-      ASSERT (MsrFeatureConfig != NULL);
-      MsrFeatureConfig[ProcessorNumber].Uint64 = AsmReadMsr64 (MSR_SANDY_BRIDGE_FEATURE_CONFIG);
-    }
+    MsrFeatureConfig = (MSR_SANDY_BRIDGE_FEATURE_CONFIG_REGISTER *) ConfigData;
+    ASSERT (MsrFeatureConfig != NULL);
+    MsrFeatureConfig[ProcessorNumber].Uint64 = AsmReadMsr64 (MSR_SANDY_BRIDGE_FEATURE_CONFIG);
     return TRUE;
   }
   return FALSE;
-- 
2.21.0.windows.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-05-18  5:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-16 10:33 [PATCH] UefiCpuPkg CpuCommonFeaturesLib: Remove CPU generation check Zeng, Star
2019-05-16 13:06 ` Laszlo Ersek
2019-05-16 14:51   ` [edk2-devel] " Zeng, Star
2019-05-17  1:01     ` Dong, Eric
2019-05-17  1:04     ` Ni, Ray
2019-05-17  3:05       ` Zeng, Star
2019-05-17 12:13         ` Laszlo Ersek
2019-05-17 13:10         ` Ni, Ray
2019-05-18  5:51           ` Zeng, Star

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox