]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/CpuCommonFeaturesLib: Aesni.c uses BIT0 and BIT1 reversedly
authorStar Zeng <star.zeng@intel.com>
Thu, 14 Mar 2019 02:10:21 +0000 (10:10 +0800)
committerStar Zeng <star.zeng@intel.com>
Mon, 18 Mar 2019 01:14:15 +0000 (09:14 +0800)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1621

According to Intel SDM as below, the BIT0 should be treated as
lock bit, and BIT1 should be treated as disable(1)/enable(0) bit.

"11b: AES instructions are not available until next
RESET.
Otherwise, AES instructions are available.
If the configuration is not 01b, AES
instructions can be mis-configured if a privileged agent
unintentionally writes 11b"

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>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c

index 56b1b551d9778f54e3ff86b0ba3f77f61299bb47..3f7c933e51f4a0152938bf8c568557d63087d472 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   AESNI feature.\r
 \r
-  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -123,7 +123,7 @@ AesniInitialize (
         MSR_SANDY_BRIDGE_FEATURE_CONFIG,\r
         MSR_SANDY_BRIDGE_FEATURE_CONFIG_REGISTER,\r
         Bits.AESConfiguration,\r
-        BIT1 | ((State) ? 0 : BIT0)\r
+        BIT0 | ((State) ? 0 : BIT1)\r
         );\r
     }\r
   }\r