From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web09.3685.1604365663515411849 for ; Mon, 02 Nov 2020 17:07:43 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Wtf1LaMk; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: jiewen.yao@intel.com) IronPort-SDR: s4nzTA4l17rFWkM0pJDP9kicCQIhJTSSF6Vla70NqrBVxLrhBExJYQt9g+aULqiu+CZ3NvsfL1 1H0QgZsjdbFg== X-IronPort-AV: E=McAfee;i="6000,8403,9793"; a="169111742" X-IronPort-AV: E=Sophos;i="5.77,446,1596524400"; d="scan'208";a="169111742" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 17:07:42 -0800 IronPort-SDR: GNIIJX03l7yc+3TJdYnH2K7uXfiFRFW7DXY3jyDWw801u7ZidjKXsqk84wHe7ZNmYDUF9EvUz3 +jPdGWodHi9A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,446,1596524400"; d="scan'208";a="305881107" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga007.fm.intel.com with ESMTP; 02 Nov 2020 17:07:41 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx604.amr.corp.intel.com (10.18.126.84) 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 17:07:40 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx612.amr.corp.intel.com (10.18.126.92) 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 17:07:40 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx607.amr.corp.intel.com (10.18.126.87) 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 17:07:40 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.177) 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 17:07:34 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LPnrfMEB69aEVdDiHrtwNzUajL/ZfkJooNr/HmwUbYBueJ8UZQUVhK9CZ9d3AxAADSH/r8oKpO3/mJQly/AU/EDMIdMyqVbJNqw1Z7sjbC2NKcH4DIm0RYxIFoZtRKpUD5rOnOZiuAsgjFuNYjC5D2IZeNBO+d/yHpo+6p+w0Zw2ZNUoQrvWDCsC3dzXAQL3pJ8kZ1kiDGE06eaJg61q8+sivDuCVgZxKLpROgKwlQTsCjkXdSzI27nMPw9BgvRlPK/Shyd8+f9//LgS0xemGG2c1VcAwslpvyKl91nhv4xHB7jG/5TvPcgEK3Dtgm+48Jx+V0nsYyK7YilLww/E8w== 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=1ZSWsDOaqdDpWrvJClI3N0RSHf2VnK5UnzBh//92Qhc=; b=eu29dC7zYfoe9GufTc2TCGigcSG9EfPSOiKkAWzayXSIo31DONUpzkIyBNdfFJglu2b3/Mc1UwVodnrpDym3kjzn7/gg8vGNnsE6Y5JO1myYvirtfBcsBF8sGnXAsC81oSurSd/9VfCX2BKGvX7H2y3mSFjEOjpcfmPshvdCGspk7E6iQmRLGsTaSq3vD12SkkfUzoGQoLJ/diGPmI4W72165d/BrqypE2Rgh6P71Q0rldb7znB4fo5t7CQgAdyV1+4BqCUgmtesfbEDD+O7NhvRikehY8FM8NU+FqJDy1YxPkQsfxxjGSMnCxuwARdHBoONHWYIJXkRNl3kgm4KaA== 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=1ZSWsDOaqdDpWrvJClI3N0RSHf2VnK5UnzBh//92Qhc=; b=Wtf1LaMk9ZGY60n4Fmpm1gDCMKaLF8LvmSFzlgwQCdkNulo4tlJsLLGwOQEoLBqo2P+9zl/U184egK3mOkiZMAbviAem2Y0TKPck3GOd6Gw/Hj4F0WORku5kqfPuBH4N/uVRCpzyXrOJ5sp6WCY4KYq2NDoDgAhVUOCKqXmo+gY= Received: from CY4PR11MB1288.namprd11.prod.outlook.com (2603:10b6:903:23::8) by CY4PR1101MB2120.namprd11.prod.outlook.com (2603:10b6:910:1e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Tue, 3 Nov 2020 01:07:33 +0000 Received: from CY4PR11MB1288.namprd11.prod.outlook.com ([fe80::a188:2994:6c14:aad7]) by CY4PR11MB1288.namprd11.prod.outlook.com ([fe80::a188:2994:6c14:aad7%12]) with mapi id 15.20.3499.032; Tue, 3 Nov 2020 01:07:33 +0000 From: "Yao, Jiewen" 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 Thread-Topic: [PATCH v4 0/2] CryptoPkg/OpensslLib: Add native instruction support for X64 Thread-Index: AQHWrVZlIq8lM7RMjUONmbx0j/6CWamw6x3wgARp3FCAAErZwA== Date: Tue, 3 Nov 2020 01:07:33 +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-product: dlpe-windows dlp-reaction: no-action 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: [192.198.147.217] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8bc1f2c2-de1e-4214-d9fb-08d87f94d845 x-ms-traffictypediagnostic: CY4PR1101MB2120: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: eTyfzIBcUByuuoQbVHGDRKMmWIdtSwP9AryrqJ7s5R/djMhbPymw2XdSGU5craXYXQ11mEDvq9EdJ8y68hTqWX2vdcAATIWWOjs2/1S7l3ji9QNogJ2ZNAQTN93DKNg4P7SiknEzEUyxL+/X6dOaOxNvVIAPCJ83ESYpRyynoHgSDXAT81RYJCdhpW2VWLCVRz569h7X14jlbzv6Z/+rfu6ZsFf91aBnC4FX7kiloxctEy9nHaQTGfId1xag/CZAB2s6ogJOBmayYUuyzLSA8bAGi6XjOJVFSYMnh5szjEvvqZJEG44aAtWTEx0tkIqZf0DGBALaQqVpaOS/Ma9gXg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR11MB1288.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(136003)(39860400002)(396003)(376002)(366004)(86362001)(53546011)(8936002)(186003)(19627235002)(2906002)(8676002)(26005)(5660300002)(52536014)(6506007)(7696005)(9686003)(71200400001)(4326008)(316002)(110136005)(54906003)(33656002)(55016002)(83380400001)(64756008)(66946007)(478600001)(76116006)(66476007)(66446008)(66556008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: f/PLcsJtkoPXiAHxjLS8nwoh/hAAbFg//4WNGpN4jfXP16LWZtO5QlQ/QpPM43HI1IfEhHyz+hsk/xMfy9W9HhldG2NeVkOeghxgcy62pqxfU7u2Ad14cAl9fisH0DRqkl5t8Gd9/zvR0AxyLQIe7x4+j0WHyHV5PvJ7mwWLg5HGCGaOr0jbsTSo6HSAvUAhwrliweCWKxUNmBePTkN4Qvf659iGBqphk/xn5Lybp39wWjXpxNR+f5/wSa268R8+D5PQ9GFgo4MvZVS5zNIKPoB0hXF9xVJ/14Rqdzl2BNGHz1bzorZzMJxBOdSrlWxAtrrDE/h40TxZDT81iAKTW0bqvUJ6SojNYn2ZA1ryzLUiz5UAa0dDHFWVaIDbRKVE0lCU6xCynnvt9lFc7DL0MggSWnim8eV1I4Xqi7y7wK5tJ6KqKgr+f7/VysLv54FbTg9ucB4z+qe93Exd5lIjd9UFJ1Dr+bIECz6vX6OoVQPNU6NXAw2sn0cfa+C/XqfLwwlqvAj2dcwXKqonIQ5Fdj6O7swT1sDGgCtmFYyOQSc568ZkRn3AXyxH9v5sd+/yBbcJ/zIdFfzuC5JVP4XuKl0TKVJZ9enxXb9tmQFMBi7mqYzd7eS0Y3Uq5vguguv2hMWQdhtAO8eNm243riH7kw== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR11MB1288.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8bc1f2c2-de1e-4214-d9fb-08d87f94d845 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2020 01:07:33.1979 (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: FNK/fTv+nR+31ql2k9kvjm0DqndGvLhzHlcIOooy3axcanGbn5yspBMvFAHUd+LjFqsXJKA+Tkxp+dYaTSVpzw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1101MB2120 Return-Path: jiewen.yao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Zurcher The general guideline for EDKII is that if a file is arch specific (not req= uired for other), then it should be under Arch folder. (no matter it is ASM= or C). In this case, ApiHooks.c seems a workaround only for X64 NASM build. That i= s why I recommend to move it under X64. I don't think we have rule that "The architecture-specific folders from thi= s patch are maintained by process_files.pl". You can delete *.nasm and rege= nerate *.nasm, but keep others. Thank you Yao Jiewen > -----Original Message----- > From: Zurcher, Christopher J > Sent: Tuesday, November 3, 2020 4:49 AM > 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 >=20 > 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 architectu= re- > specific folders from this patch are maintained by process_files.pl so th= at > any changes to uefi-asm.conf can take effect in the auto-generated assemb= ly > files. >=20 > Thanks, > Christopher Zurcher >=20 > > -----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 instructio= n > > support for X64 > > > > Hi Zurcher > > I have given the feedback to move ApiHooks.c to X64 dir. > > > > But I do not see your response, and I do not see you are following the > > recommendation. > > > > =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 = Visual > > > 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 > > > > > > > > > -----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 failu= re > and > > > can be added in a later patch). > > > Removed XMM instructions from assembly generation. > > > Added automatic copyright header porting for generated assembly fil= es. > > > > > > This patch adds support for building the native instruction algorithm= s 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 str= uct, > > and > > > generate the necessary assembly files for the EDK2 build environment. > > > > > > For the X64 variant, OpenSSL includes calls to a Windows error handli= ng > > 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 nativ= e > > > 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 > using > > a > > > perl script. To avoid that burden on EDK2 users, these end-result > assembly > > > files are generated during the configuration steps performed by the > package > > > maintainer (through process_files.pl). The perl generator scripts ins= ide > > > OpenSSL do not parse file comments as they are only meant to create > > > intermediate build files, so process_files.pl contains additional hoo= ks to > > > preserve the copyright headers as well as clean up tabs and line endi= ngs > to > > > comply with EDK2 coding standards. The resulting file headers align w= ith > > > the generated .h files which are already included in the EDK2 reposit= ory. > > > > > > 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 > X64 > > > > > > 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