From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.92.21.67]) by mx.groups.io with SMTP id smtpd.web12.2435.1663811122113833630 for ; Wed, 21 Sep 2022 18:45:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=Vs9OGO2/; spf=pass (domain: outlook.com, ip: 40.92.21.67, mailfrom: christopher.zurcher@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e4Y5RbYirvUr/Sxv3TP6LK/phZ5HAPuseLeljADbbr4z+2zIcAPX66MkbK2G2dXQGguFtEVQYEzjSlKMSU8shY3X612jjlU63w7gms4XyORL/TT6Sa7ql/RNOtDQzMAfxaDHajgYYBUvIQfxM3cXqq1EfPyxtt77DEb0XumQfln6NrLB0kILHmI8s4M2lwj2D+zKNEZ+aOhHBM06k5fBYrLEHJNE0HaZiRshYP48KWDL+ct0r3xGMe37tRuGNsIf6F5jvGOlYq1WG4Aop0UVhgTeiiCS3nr7mh4ypCuts5+DRY1cUn1X1Sl0M8o7Dalflu+Op3v2Azg1kF/Ohh3RPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2sZr/BwLPficuujxhxDHzp9veqKR37fqXnOM9oQIZco=; b=MAc+v7IQzZE4hZ/9KiAqW8mAqcygUgmkDOLAsBDOO+qcSieo8HSTKcpgCa9+s9adHNUvJFr8bWALUzwP/7SDfvbX7GFuXvGP+9kFmQaf+Mk7ku6fgKfHFpBRtErNBQjJDTl7TZuyzhFBFWTi+fwPI7+5kxnIdwA5G89YnRop/XU4h9SQnHO3W4U6MCCDHpKCKw5nYfBTVFrTlYpdbNbHnR5jCTS35v8Mowf3yyhcngPIhu7N5cORdC/41RrZ5hgWbysnW70fdCKHTsulbDPM5c25L0H3bMHS8mlraUjiLqJHYj+rN1Jp+gceLOM/E3l6x92xggYMT1Y0DYW+u2Q6kg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2sZr/BwLPficuujxhxDHzp9veqKR37fqXnOM9oQIZco=; b=Vs9OGO2/wixx0di9JBFwBMud76chJ3pI5cNX1YJzHaNcGU7XfnWj8xkyF+XPRbrGpT03O2YxuBwOuZbAybMLt72Fdhgjq7CxVdz41x8a4ujOpUW33YmaDj60IXcloIfc2GHBtND/70/m/yQsGuAWr410hC0Eu3xf+LuUL8zbCjfsi0o9ZjdHwBzJbMNMdpp/aipozMNLubz6quZuI32q0tT8PfY06at3d6Zr9pdJSW1qciKBEWJ3nRkw0CAxLjBjtduW6N9stNFCf2CTDIdLK4rS+p2hmwdaSjl3d4Vh5O0wIpgbV5NTVUAriy6hml9/uJGSiW6H2Ya5AAr7DlPcIg== Received: from BY3PR06MB8018.namprd06.prod.outlook.com (2603:10b6:a03:3c1::7) by BN7PR06MB3874.namprd06.prod.outlook.com (2603:10b6:406:8c::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14; Thu, 22 Sep 2022 01:45:20 +0000 Received: from BY3PR06MB8018.namprd06.prod.outlook.com ([fe80::833:c01:765e:a1f8]) by BY3PR06MB8018.namprd06.prod.outlook.com ([fe80::833:c01:765e:a1f8%4]) with mapi id 15.20.5654.017; Thu, 22 Sep 2022 01:45:20 +0000 From: "Christopher Zurcher" To: "devel@edk2.groups.io" , "jiewen.yao@intel.com" , Christopher Zurcher CC: "Li, Yi1" , "Wang, Jian J" , "Lu, Xiaoyu1" , "Jiang, Guomin" Subject: Re: [edk2-devel] [PATCH v1 0/3] CryptoPkg/OpensslLib: Add native instruction support for IA32 Thread-Topic: [edk2-devel] [PATCH v1 0/3] CryptoPkg/OpensslLib: Add native instruction support for IA32 Thread-Index: AQHYzfheptyDuCFRp0ioipL+EyYW163qnvVggAAO+UA= Date: Thu, 22 Sep 2022 01:45:20 +0000 Message-ID: References: <20220921202541.3691-1-christopher.zurcher@microsoft.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=c08d6594-f562-4878-a533-ecacfb2262ff;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2022-09-22T01:45:04Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; x-tmn: [wqstYXgto2GiGdd1FLB1G65bFZxKYsWfa9iRkNcZl4vpYllFIU1ol6n23Q/ycJ6Y] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BY3PR06MB8018:EE_|BN7PR06MB3874:EE_ x-ms-office365-filtering-correlation-id: 1ec4c579-0668-444c-a568-08da9c3c1bab x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SkhZ/7KYzPmxa9o1qMEljrDEFbf/+yTuhgCzOMKc6ImwUMPTc8Kj5G7xH3AYdpqpy1ivi43GkIAXDQIT+jTT165iqGLi4sumJpPOj/UTCp3GQQfw9IxesXm6jpu79IaxeN2lRLpa17hoMdh2a0NYrc6YTCfC+wDnzBaGBXMSO0CZL5i0xjs19I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lYaUYMSkk?= =?us-ascii?Q?AM/r3YVxcq4KilKSz79tjo6y6x08KYiRQNWEJtKy/o1WuhxSBXmZ83RrddBA?= =?us-ascii?Q?MHNHAQjz7lBHxyOQYk4Vch+d1CsxvVh7u+KOof0AU6MN11kRBhcbm5zL9Tfq?= =?us-ascii?Q?aFc/F+0=3D?= MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY3PR06MB8018.namprd06.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 1ec4c579-0668-444c-a568-08da9c3c1bab X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Sep 2022 01:45:20.2081 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR06MB3874 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I have verified performance gains and functional integrity in SHA256, SHA38= 4, and SHA512 hashing as well as AES encryption on Intel hardware as well a= s QEMU. The assembly implementations included with this patch are limited t= o SHA and AES to reduce size impact, and to match the currently-available a= ccelerations in the X64 equivalent library. These flows have also been vali= dated on in-market hardware. Previous benchmarking of this code demonstrate= d a 12x speed improvement for SHA256 compared to the base algorithm. Thanks, Christopher Zurcher -----Original Message----- From: devel@edk2.groups.io On Behalf Of Yao, Jiewen Sent: Wednesday, September 21, 2022 17:54 To: Christopher Zurcher ; devel@edk2.groups.io Cc: Li, Yi1 ; Wang, Jian J ; Lu, X= iaoyu1 ; Jiang, Guomin Subject: Re: [edk2-devel] [PATCH v1 0/3] CryptoPkg/OpensslLib: Add native i= nstruction support for IA32 Thanks. Would you please add more detailed description on what test you have done? e.g. Real platform? Unit Test? Etc. > -----Original Message----- > From: Christopher Zurcher > Sent: Thursday, September 22, 2022 4:26 AM > To: devel@edk2.groups.io > Cc: Li, Yi1 ; Yao, Jiewen ;=20 > Wang, Jian J ; Lu, Xiaoyu1=20 > ; Jiang, Guomin > Subject: [PATCH v1 0/3] CryptoPkg/OpensslLib: Add native instruction=20 > support for IA32 >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3654 > PR: https://github.com/tianocore/edk2/pull/3352 >=20 > This patch adds support for building the native instruction algorithms=20 > for the IA32 architecture in OpensslLib. The base variant has been=20 > tested with VS2019 and CLANGPDB toolchains, and a GCC variant is also pro= vided. >=20 > The implementation here follows the previous implementation of X64=20 > native instructions as committed in 878a92a887. >=20 > Cc: Yi Li > Cc: Jiewen Yao > Cc: Jian J Wang > Cc: Xiaoyu Lu > Cc: Guomin Jiang >=20 > Christopher Zurcher (3): > CryptoPkg/OpensslLib: Add native instruction support for IA32 > CryptoPkg/OpensslLib: Commit the auto-generated assembly files for > IA32 > CryptoPkg/OpensslLib: Update generated files for native X64 >=20 > CryptoPkg/CryptoPkg.ci.yaml | 4 + > CryptoPkg/Library/OpensslLib/IA32/crypto/aes/aesni-x86.nasm | 3212 > +++++++++++++++++++ > CryptoPkg/Library/OpensslLib/IA32/crypto/aes/vpaes-x86.nasm | 651 > ++++ > CryptoPkg/Library/OpensslLib/IA32/crypto/modes/ghash-x86.nasm | 700 > ++++ > CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha1-586.nasm | 1394 > ++++++++ > CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha256-586.nasm | 3364 > ++++++++++++++++++++ > CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha512-586.nasm | 579 > ++++ > CryptoPkg/Library/OpensslLib/IA32/crypto/x86cpuid.nasm | 433 +++ > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/aesni-x86.S | 3247 > +++++++++++++++++++ > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/vpaes-x86.S | 670 > ++++ > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/modes/ghash-x86.S | 703 > ++++ > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha1-586.S | 1389 > ++++++++ > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha256-586.S | 3356 > +++++++++++++++++++ > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha512-586.S | 574 > ++++ > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/x86cpuid.S | 449 +++ > CryptoPkg/Library/OpensslLib/OpensslLibIa32.inf | 699 +++= + > CryptoPkg/Library/OpensslLib/OpensslLibIa32Gcc.inf | 699 +++= + > CryptoPkg/Library/OpensslLib/OpensslLibX64.inf | 53 + > CryptoPkg/Library/OpensslLib/OpensslLibX64Gcc.inf | 53 + > CryptoPkg/Library/OpensslLib/UefiAsm.conf | 18 + > CryptoPkg/Library/OpensslLib/process_files.pl | 12 + > 21 files changed, 22259 insertions(+) create mode 100644=20 > CryptoPkg/Library/OpensslLib/IA32/crypto/aes/aesni-x86.nasm > create mode 100644 > CryptoPkg/Library/OpensslLib/IA32/crypto/aes/vpaes-x86.nasm > create mode 100644 > CryptoPkg/Library/OpensslLib/IA32/crypto/modes/ghash-x86.nasm > create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha1- > 586.nasm > create mode 100644 > CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha256-586.nasm > create mode 100644 > CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha512-586.nasm > create mode 100644 > CryptoPkg/Library/OpensslLib/IA32/crypto/x86cpuid.nasm > create mode 100644 > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/aesni-x86.S > create mode 100644 > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/vpaes-x86.S > create mode 100644 > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/modes/ghash-x86.S > create mode 100644 > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha1-586.S > create mode 100644 > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha256-586.S > create mode 100644 > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha512-586.S > create mode 100644 > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/x86cpuid.S > create mode 100644 CryptoPkg/Library/OpensslLib/OpensslLibIa32.inf > create mode 100644 CryptoPkg/Library/OpensslLib/OpensslLibIa32Gcc.inf >=20 > -- > 2.29.2.windows.2