From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.138.1604350148359275787 for ; Mon, 02 Nov 2020 12:49:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=v6eSW/5j; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: christopher.j.zurcher@intel.com) IronPort-SDR: PRgglYw2ANS2DkZq4z/yN+OzX3xsPgqbrBjbkSzyFfg+v4rQ5VPa7Yk8gJPww5tMb4NoiBfrQt y4TBzOFfAt1A== X-IronPort-AV: E=McAfee;i="6000,8403,9793"; a="230580789" X-IronPort-AV: E=Sophos;i="5.77,445,1596524400"; d="scan'208";a="230580789" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 12:49:07 -0800 IronPort-SDR: ++r9XejbWVeH+pctZokRAEzDI3zMh5WPZzhyJOsUIU0N+VvybNBNpEL0Y6RLwCAfhXz8BdERL8 wIdIuMIv8SBg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,445,1596524400"; d="scan'208";a="362732242" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by FMSMGA003.fm.intel.com with ESMTP; 02 Nov 2020 12:49:06 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 2 Nov 2020 12:49:06 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 2 Nov 2020 12:49:05 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 2 Nov 2020 12:49:05 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.109) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Mon, 2 Nov 2020 12:49:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SdmxsmZMrvxdGuJy5zTOmkMCru75je9AXjxfKOFYyOwt5Q2f+6ny3IDEkvHpZpCW2zF9Z81jLyDjuSCSRgsLrpxWH2vSZpKh9EU5TX9djijfL9jgM4tlhvsByj8rUQXxhZvJ2HcmL5f26KQ+ae6eQMYtUcz8pUE6axlQnZfAS098lXJ5eGTJeOPqpdO8iM3XwzkqnA46Sgfc52+SmuuVbNJv/hv7316C9AWSxDpCkQDAO4RvcrRU41mgK6ssHuQ/Ocq0C4NkZzFCgYpYsmwG8/zwDe5gy6AhKe4zyzsmjv8fSnrLfAV6YXcLvI/AH2do1gihcE1k6AeFWVCq18USrA== 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-SenderADCheck; bh=go7yp9OzZBDyuZ5O2NYalJFNhbQaMIwyDdc8+LrEMzk=; b=cdgUow4O6pHPVq1t5t/sYMrwPMvdinW4TNKd3ScXgxD0TnZsoOpDykDUpfYmRthqYj94Fcc8U1ag2J2M3jBje9aBCFqfqcNBcjponGD0y9zuADNRCgf6QV24QhPvsODrZgvHyBQ4NnpgwU1BWKXdWDpThZRp9a382MwJ+eVCfBNsMyyCoHL0+ACvgvvPQi6W8KdsAjtZxdNCmvSXAI5mGDVAe2t3+qKGUOgO8ap0NsWUH4MLm+/JPMKMw3OMcsQ+DKgoLb9CMLfSqq+r2P0l4mBwlLEI2PwIdOyolyot90/RaIzBIxV2U4GBYUPjzOtkYtZpIs0+f+WnVhhVdsGT6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=go7yp9OzZBDyuZ5O2NYalJFNhbQaMIwyDdc8+LrEMzk=; b=v6eSW/5jlRSVSjERtdaY3IXOWdpD27HMZfnrgqoZI32N0xCeSimDqjc9ON6JSXQ6SYHHgwr5Yze74znfvTdw5pErw2AGnig4jnqhsPQAVeKn1s9jZVtadil+Ew7LTJYWVj6vGn2T64lV47Zi3+3G1MFpQqiZPTSixFmIDCLxfgU= Received: from DM5PR1101MB2123.namprd11.prod.outlook.com (2603:10b6:4:53::10) by DM6PR11MB4026.namprd11.prod.outlook.com (2603:10b6:5:198::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.29; Mon, 2 Nov 2020 20:49:02 +0000 Received: from DM5PR1101MB2123.namprd11.prod.outlook.com ([fe80::8487:e96e:1b9c:d97f]) by DM5PR1101MB2123.namprd11.prod.outlook.com ([fe80::8487:e96e:1b9c:d97f%11]) with mapi id 15.20.3499.030; Mon, 2 Nov 2020 20:49:01 +0000 From: "Zurcher, Christopher J" To: "Yao, Jiewen" , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Lu, XiaoyuX" , "Kinney, Michael D" , "Ard Biesheuvel" Subject: Re: [PATCH v4 0/2] CryptoPkg/OpensslLib: Add native instruction support for X64 Thread-Topic: [PATCH v4 0/2] CryptoPkg/OpensslLib: Add native instruction support for X64 Thread-Index: AQHWrVZlIq8lM7RMjUONmbx0j/6CWamw6x3wgARp3FA= Date: Mon, 2 Nov 2020 20:49:01 +0000 Message-ID: References: <20201028181546.6537-1-christopher.j.zurcher@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [50.53.185.44] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5dcd0da7-144e-4b9f-0051-08d87f70bac3 x-ms-traffictypediagnostic: DM6PR11MB4026: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mFx+Lfi6DdFat0/Qkuobj8dk/fa+LBnFfMu7BikE+nmGNQyRMaGrz2wXoFHVyJQrIODFJ/GMPLdeo7bxea+MOwFruyN0iVdJvBGdrPbdPaXMuDBaO+4j37ae5pb2XGlDLVYVA/+T0VNER9EL35BxbsOZXKAUaP4qt0MkH7EEtaXhiD+lv0z2LOUgxfMuzgEK2uEIyI66X32f6fmEekPCnOyoegHhnZssV3PDB1nG3QijX0gFMtMnZLSAMNY7JHcHKAcxyFmJ4pqxorX21T+chjLlla+eZHV904nMjWRU80jisxPy5DCsvv4uR1HQRy81 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR1101MB2123.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(366004)(39860400002)(396003)(346002)(136003)(71200400001)(64756008)(66446008)(5660300002)(66476007)(9686003)(55016002)(19627235002)(83380400001)(52536014)(2906002)(66946007)(66556008)(316002)(478600001)(110136005)(54906003)(76116006)(6506007)(53546011)(33656002)(186003)(4326008)(7696005)(8936002)(86362001)(26005)(8676002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: Se3KoHh4e+uKzK+bFvQzhgz1SZJuaSGo64+NggcpU0X4NwctBWx5ow6ZJOYslaUwIeEVxSN1cR4qqldpxYnAaIGv/IFnlSmWmQIvEkQIFafZnRdGmfkpDxy5eJ+rb3/5QjodFuTpiNZkFjHyNMDXYPdDnF85PCk7PBbqwjBmPuwQIiOI+/31MAH4e5yz86BWj0bLWb9mtkha81ZUzIxxOPSZCcgxWvdmG3HXq9YlvKmS/y3lqaE0hCdMiO3sKGrzy2laMuwoLshCXxpH4Hm0XIaxmdfOYj6Ly4UkiVRVAozwl96MmVen7fJZGoZYxRmcGKjEss+htc9Gt3uw9SFtVEPgjP9OSMbPFcfkgUQ7h2e93nQVoyfXUnrkV2ARq946wP03zDJQ7RSurug2H+2d1sbFhZH2Lphi5dK9UQD0CswO4k9yjESKb/VbMy5wGiPHBGYvqjkuVTSiIqT810hqNNF+00D3alih7KyuENz4i4QkDZR4rHguwSIa/6cd8+DR6XVmlzeP68G+iJKK8AKFwOPEFSWY4RWJg95nndhvljSslNGK+SN1vJFK2crcXfnmoKxv5QZr3PLYMU0546jMU8AUyGejsmq9lhvwuvCLFPpudM4TbHosW0uYAzzwz5+H9i0YgrznDmn0OtC6u1qQxQ== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM5PR1101MB2123.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5dcd0da7-144e-4b9f-0051-08d87f70bac3 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2020 20:49:01.7522 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 8Fx+0z4/YgBBkRdHanN/XSXUwHAtWVmPqKjG7oLCv7pkRl7D8qPAGrS7F424fK2ltTdTjY11iuk7PRiQKqNc5Lki6/VwlqJzq1kac4NBT3Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4026 Return-Path: christopher.j.zurcher@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I may have misunderstood the recommendation; the file is under [Sources.X64= ] in the INF file. The X64 folder is automatically deleted and re-generated when process_files= .pl is run, so no standard file can go there. The architecture-specific fol= ders from this patch are maintained by process_files.pl so that any changes= to uefi-asm.conf can take effect in the auto-generated assembly files. Thanks, Christopher Zurcher > -----Original Message----- > From: Yao, Jiewen > Sent: Friday, October 30, 2020 18:15 > To: Zurcher, Christopher J ; > devel@edk2.groups.io > Cc: Wang, Jian J ; Lu, XiaoyuX ; > Kinney, Michael D ; Ard Biesheuvel > > Subject: RE: [PATCH v4 0/2] CryptoPkg/OpensslLib: Add native instruction > support for X64 >=20 > Hi Zurcher > I have given the feedback to move ApiHooks.c to X64 dir. >=20 > But I do not see your response, and I do not see you are following the > recommendation. >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > ApiHooks.c is for any compiler building the assembly files, not only Vi= sual > > Studio. > [Jiewen] Got it. Thanks for the clarification. > It is only needed for X64 assembly. Right? > If so, I recommend to put it to [Source.X64] > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 >=20 >=20 > > -----Original Message----- > > From: Christopher J Zurcher > > Sent: Thursday, October 29, 2020 2:16 AM > > To: devel@edk2.groups.io > > Cc: Yao, Jiewen ; Wang, Jian J > > ; Lu, XiaoyuX ; Kinney, > > Michael D ; Ard Biesheuvel > > > > Subject: [PATCH v4 0/2] CryptoPkg/OpensslLib: Add native instruction > > support for X64 > > > > V4 Changes: > > Add copyright header to uefi-asm.conf > > Move [Sources.X64] block to cover entire X64-specific config > > > > V3 Changes: > > Added definitions for ptrdiff_t and wchar_t to CrtLibSupport.h for > > LLVM/Clang build support. > > Added -UWIN32 to GCC Flags for LLVM/Clang build support. > > Added missing AES GCM assembly file. > > > > V2 Changes: > > Limit scope of assembly config to SHA and AES functions. > > Removed IA32 native support (reduced config was causing build failure= and > > can be added in a later patch). > > Removed XMM instructions from assembly generation. > > Added automatic copyright header porting for generated assembly files= . > > > > This patch adds support for building the native instruction algorithms = for > > the X64 architecture in OpensslLib. The process_files.pl script was > modified > > to parse the .asm file targets from the OpenSSL build config data struc= t, > and > > generate the necessary assembly files for the EDK2 build environment. > > > > For the X64 variant, OpenSSL includes calls to a Windows error handling > API, > > and that function has been stubbed out in ApiHooks.c. > > > > For all variants, a constructor is added to call the required CPUID > function > > within OpenSSL to facilitate processor capability checks in the native > > algorithms. > > > > Additional native architecture variants should be simple to add by > following > > the changes made for this architecture. > > > > The OpenSSL assembly files are traditionally generated at build time us= ing > a > > perl script. To avoid that burden on EDK2 users, these end-result assem= bly > > files are generated during the configuration steps performed by the pac= kage > > maintainer (through process_files.pl). The perl generator scripts insid= e > > OpenSSL do not parse file comments as they are only meant to create > > intermediate build files, so process_files.pl contains additional hooks= to > > preserve the copyright headers as well as clean up tabs and line ending= s to > > comply with EDK2 coding standards. The resulting file headers align wit= h > > the generated .h files which are already included in the EDK2 repositor= y. > > > > Cc: Jiewen Yao > > Cc: Jian J Wang > > Cc: Xiaoyu Lu > > Cc: Mike Kinney > > Cc: Ard Biesheuvel > > > > Christopher J Zurcher (2): > > CryptoPkg/OpensslLib: Add native instruction support for X64 > > CryptoPkg/OpensslLib: Commit the auto-generated assembly files for X6= 4 > > > > CryptoPkg/Library/OpensslLib/OpensslLib.inf | > 2 +- > > CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | > 2 +- > > CryptoPkg/Library/OpensslLib/OpensslLibX64.inf | > 655 +++ > > CryptoPkg/Library/Include/CrtLibSupport.h | > 2 + > > CryptoPkg/Library/Include/openssl/opensslconf.h | > 3 - > > CryptoPkg/Library/OpensslLib/ApiHooks.c | > 18 + > > CryptoPkg/Library/OpensslLib/OpensslLibConstructor.c | > 34 + > > CryptoPkg/Library/OpensslLib/X64/crypto/aes/aesni-mb-x86_64.nasm | > > 732 +++ > > CryptoPkg/Library/OpensslLib/X64/crypto/aes/aesni-sha1-x86_64.nasm | > > 1916 ++++++++ > > CryptoPkg/Library/OpensslLib/X64/crypto/aes/aesni-sha256-x86_64.nasm | > > 78 + > > CryptoPkg/Library/OpensslLib/X64/crypto/aes/aesni-x86_64.nasm | > > 5103 ++++++++++++++++++++ > > CryptoPkg/Library/OpensslLib/X64/crypto/aes/vpaes-x86_64.nasm | > > 1173 +++++ > > CryptoPkg/Library/OpensslLib/X64/crypto/modes/aesni-gcm-x86_64.nasm | > > 34 + > > CryptoPkg/Library/OpensslLib/X64/crypto/modes/ghash-x86_64.nasm | > > 1569 ++++++ > > CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha1-mb-x86_64.nasm | > > 3137 ++++++++++++ > > CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha1-x86_64.nasm | > > 2884 +++++++++++ > > CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha256-mb-x86_64.nasm | > > 3461 +++++++++++++ > > CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha256-x86_64.nasm | > > 3313 +++++++++++++ > > CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha512-x86_64.nasm | > > 1938 ++++++++ > > CryptoPkg/Library/OpensslLib/X64/crypto/x86_64cpuid.nasm | > 491 > > ++ > > CryptoPkg/Library/OpensslLib/process_files.pl | > 223 +- > > CryptoPkg/Library/OpensslLib/uefi-asm.conf | > 21 + > > 22 files changed, 26739 insertions(+), 50 deletions(-) > > create mode 100644 CryptoPkg/Library/OpensslLib/OpensslLibX64.inf > > create mode 100644 CryptoPkg/Library/OpensslLib/ApiHooks.c > > create mode 100644 CryptoPkg/Library/OpensslLib/OpensslLibConstructor.= c > > create mode 100644 CryptoPkg/Library/OpensslLib/X64/crypto/aes/aesni- > > mb-x86_64.nasm > > create mode 100644 CryptoPkg/Library/OpensslLib/X64/crypto/aes/aesni- > > sha1-x86_64.nasm > > create mode 100644 CryptoPkg/Library/OpensslLib/X64/crypto/aes/aesni- > > sha256-x86_64.nasm > > create mode 100644 CryptoPkg/Library/OpensslLib/X64/crypto/aes/aesni- > > x86_64.nasm > > create mode 100644 CryptoPkg/Library/OpensslLib/X64/crypto/aes/vpaes- > > x86_64.nasm > > create mode 100644 > > CryptoPkg/Library/OpensslLib/X64/crypto/modes/aesni-gcm-x86_64.nasm > > create mode 100644 > > CryptoPkg/Library/OpensslLib/X64/crypto/modes/ghash-x86_64.nasm > > create mode 100644 CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha1- > > mb-x86_64.nasm > > create mode 100644 CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha1- > > x86_64.nasm > > create mode 100644 CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha256- > > mb-x86_64.nasm > > create mode 100644 CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha256- > > x86_64.nasm > > create mode 100644 CryptoPkg/Library/OpensslLib/X64/crypto/sha/sha512- > > x86_64.nasm > > create mode 100644 > > CryptoPkg/Library/OpensslLib/X64/crypto/x86_64cpuid.nasm > > create mode 100644 CryptoPkg/Library/OpensslLib/uefi-asm.conf > > > > -- > > 2.28.0.windows.1