From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 50B3E211DE8E8 for ; Thu, 14 Mar 2019 22:35:12 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Mar 2019 22:35:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,481,1544515200"; d="scan'208";a="282871123" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga004.jf.intel.com with ESMTP; 14 Mar 2019 22:35:10 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 14 Mar 2019 22:35:10 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 14 Mar 2019 22:35:10 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.163]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.252]) with mapi id 14.03.0415.000; Fri, 15 Mar 2019 13:35:08 +0800 From: "Dong, Eric" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: Laszlo Ersek , "Ni, Ray" , "Kumar, Chandana C" Thread-Topic: [PATCH V2] UefiCpuPkg/CpuCommonFeaturesLib: Aesni.c uses BIT0 and BIT1 reversedly Thread-Index: AQHU2h3Nx7eqYfVF4EuLBmZ1TA/fRqYMLWMA Date: Fri, 15 Mar 2019 05:35:07 +0000 Message-ID: References: <20190314042417.3696-1-star.zeng@intel.com> In-Reply-To: <20190314042417.3696-1-star.zeng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH V2] UefiCpuPkg/CpuCommonFeaturesLib: Aesni.c uses BIT0 and BIT1 reversedly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Mar 2019 05:35:13 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong > -----Original Message----- > From: Zeng, Star > Sent: Thursday, March 14, 2019 12:24 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Laszlo Ersek ; > Dong, Eric ; Ni, Ray ; Kumar, > Chandana C > Subject: [PATCH V2] UefiCpuPkg/CpuCommonFeaturesLib: Aesni.c uses BIT0 > and BIT1 reversedly >=20 > V2: > Correct description "disable(0)/enable(1)" to "disable(1)/enable(0)". >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1621 >=20 > 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. >=20 > "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" >=20 > Cc: Laszlo Ersek > Cc: Eric Dong > Cc: Ruiyu Ni > Cc: Chandana Kumar > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c > b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c > index 56b1b551d977..3f7c933e51f4 100644 > --- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c > +++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c > @@ -1,7 +1,7 @@ > /** @file > AESNI feature. >=20 > - Copyright (c) 2017, Intel Corporation. All rights reserved.
> + Copyright (c) 2017 - 2019, Intel Corporation. All rights > + reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the = BSD > License > which accompanies this distribution. The full text of the license may= be > found at @@ -123,7 +123,7 @@ AesniInitialize ( > MSR_SANDY_BRIDGE_FEATURE_CONFIG, > MSR_SANDY_BRIDGE_FEATURE_CONFIG_REGISTER, > Bits.AESConfiguration, > - BIT1 | ((State) ? 0 : BIT0) > + BIT0 | ((State) ? 0 : BIT1) > ); > } > } > -- > 2.21.0.windows.1