From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web08.4257.1604106875940754648 for ; Fri, 30 Oct 2020 18:14:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=z0e3A9O4; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: jiewen.yao@intel.com) IronPort-SDR: QSeq6zqTEOoMJvvQ4MpDrHHfyX3bX9oe0A/F1NZUpAZYWvz7bpct5K/TrGshgvoiadgElHiVuw Pnsf8vgNG6LQ== X-IronPort-AV: E=McAfee;i="6000,8403,9790"; a="156460962" X-IronPort-AV: E=Sophos;i="5.77,435,1596524400"; d="scan'208";a="156460962" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2020 18:14:35 -0700 IronPort-SDR: SOGLLRF6oBZJ7nzDQENFTKu98hy8hOcaboy547BCYZ5YTOyf1EVw3lO+8tyq015ViEycEkoS8A HSJSYXs2C9nA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,435,1596524400"; d="scan'208";a="351443277" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga008.jf.intel.com with ESMTP; 30 Oct 2020 18:14:35 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 30 Oct 2020 18:14:35 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 30 Oct 2020 18:14:34 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 30 Oct 2020 18:14:34 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.41) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Fri, 30 Oct 2020 18:14:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bgKbTQ5Tp0kYm1LbZFzk8TUuHpTJFzs2q6z5Vm7W1tp6ntzXrQlVnp76CFMuBYS+Z5Cj6jOgEMjhyShSsYOueThYL+fQx170bVsG7KmDvwacScD/0SMeuhCHTZpyIv/w3PItIvaKXil6idIR+gLZb6EqEwoqL4I/Sl0hkXyqayi5qHEZA07s9jyct8Lje40kfFDaTK6jSDMebBYejT8Ep9Hl9modeNyyrSziDtXiHNoYfeeD/fFVynnCuXLKsv1ew0buAS4FskRobaYZz6NxBeM/ndOCxtpGQmfuF/tqtG+HEjnA8Z3HmFuAvV26upEos+oM9Pp/cYjjNxfNkz8QCg== 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=4mXC2UAWJ2vUr8O/NKnKWumfM7TeYXHDaewk19wv6Mo=; b=g9ZwAzfp3gPwN+iovmLCGIKUMxNl0zfu6bvkOX8XWPivGGyMjOWZ+HORjSQNwsY8m6574tGdRdRbrkpidKIJC4p2FiFkzWiuITqM23N4S0SzaqIl93q0k+bhfeELpom8GgE308u/yjniFR077HRbmUPYMH73+3qo8/C4oJS/Y7N5iXiRiyzXuI9BB3lT0qhyph2YI29eyCLnISXMfI8Adbo6tett+98ONgWk+NuG7+0pnL2xMrOT0SkatXyTxgEUOdNPTbcY9lrLHkHHIZkAjQwpqpMkbRtfcwQecRRTIEkA8rOZ7cj96AbrUu85pnhUUF3YGorw3HjzjIHysID3VA== 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=4mXC2UAWJ2vUr8O/NKnKWumfM7TeYXHDaewk19wv6Mo=; b=z0e3A9O432hZcT9tVD8zPSGRqMlAZSpLEHqRWG0sp1SeyEcnJEonSNAzkpwF10Jy8SZtlJVjcpKuZ9aecE5jU+nTVPBjnRTrostjt87GCpOFYA9o6bq4B9NM80FVMMgz7F+gj3IV2jdnCf1WTt/4nyNP7wCVNCUYrSkyNsBcvAU= Received: from CY4PR11MB1288.namprd11.prod.outlook.com (2603:10b6:903:23::8) by CY4PR1101MB2231.namprd11.prod.outlook.com (2603:10b6:910:1f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.29; Sat, 31 Oct 2020 01:14:33 +0000 Received: from CY4PR11MB1288.namprd11.prod.outlook.com ([fe80::8948:caa4:ca1a:23ac]) by CY4PR11MB1288.namprd11.prod.outlook.com ([fe80::8948:caa4:ca1a:23ac%10]) with mapi id 15.20.3477.028; Sat, 31 Oct 2020 01:14: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/6CWamw6x3w Date: Sat, 31 Oct 2020 01:14:33 +0000 Message-ID: References: <20201028181546.6537-1-christopher.j.zurcher@intel.com> In-Reply-To: <20201028181546.6537-1-christopher.j.zurcher@intel.com> 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: [101.80.124.211] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 37e16692-6fd8-4e99-72a1-08d87d3a5353 x-ms-traffictypediagnostic: CY4PR1101MB2231: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wDaK4sK8Lkvvs0EnsGhFVWkf9L9BWmrVRpFqQQh+tfcgdznUHiQSRLuL+HZspxqenqN/wYtpfxHaBIL+IQigf+dDOq3poUfIff5ys2biPKFyVNgoOKH7k4SSK4SDGhJbXR7Y7jQ9uxA8Y8Ijl6QuWv6sGYd6lJ+b69dJNv/JDYZsp8Ie8YrkLOZsWcu3dupAh/WVdKNVWhyILj6vlajG2ET2WyiDW0SEkvrH7/TGvNDjzSct1Tn/RMTDx3/hRwhDXijjLV2Pkam/A5Faf/NMnEIkwC1VN3DqnlNQ2SnCGk9312rz5xstQ3H+O1BxxAtfXUBIcVJum9niA7CWM7JvkQ== 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)(376002)(396003)(39860400002)(366004)(64756008)(66476007)(66556008)(66946007)(26005)(66446008)(86362001)(71200400001)(110136005)(478600001)(186003)(2906002)(52536014)(33656002)(83380400001)(4326008)(316002)(54906003)(55016002)(76116006)(19627235002)(7696005)(9686003)(8676002)(53546011)(8936002)(6506007)(5660300002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: XHMeHdFdniGAaicZiI6YEYlZLogxlN3WaW1FoAaU7JVDg5G7EpXTGRCPIW/3IbfNLgP+NK/nThfbcPcIeMQzveMaJhlg+9wiwQTirISvzX08v+99fYsBHXxbzZo5X2ewfP1bV96wFXIoLioU2YceNudwWfMsbG2K29PBU2kqLKhlSt1EICORnBKJu5/lwiB92WAAJOpdJyT7fCwf7AWqyv/54T8BVVV343SpF+oAJBOEXv4UEQNYEPkGP5aZmTXgkWb+MNIaXlGmohdNPeg7udlJJLQitZ/C0KusQoJ7Jtmjqwe8kaNCqanKk8ShJXFNPM/2eGT6xm4tRRl+ZFkmtY9RNlgbsr4YdQXdm6lHDNPEhJBf0S3q6IyEzCCY219jgHfJhIGJX9fBgN256UwZ3JHFEhwbdMJCLjsWpH5iXgAEwglVdY21uYsPamOL/PBKqN0i/b1T9+FiGsadBouWx8ongDvPx2rS13h/NSGCw9NxowtYQ9JJx6rEohs22peEDW6GqrFsUGZWeHcoTn/2oMhHNIgq3/Mv6JjdSkDQ30d3X+kg5FkZG8DGbQXSlcTp1xPVt46kMms2QvESaBjEGK46NAiiDdUiy9BQeymRdPWXW+Rk/uTUJsD/YBiSGhMHz0VGtCkf7cG2ICGQKJsOaw== 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: 37e16692-6fd8-4e99-72a1-08d87d3a5353 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Oct 2020 01:14:33.1018 (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: MF5LLHG1FqOTQxqk/HpWWodIZO3DtuNt2eM5/ZyH9WE7g/wyXB0Eu/CfcZ39oJWjcg/P5GymCqSUyJHZXXvUpQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1101MB2231 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 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 reco= mmendation. =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 Visu= al > 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 >=20 > V4 Changes: > Add copyright header to uefi-asm.conf > Move [Sources.X64] block to cover entire X64-specific config >=20 > 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. >=20 > V2 Changes: > Limit scope of assembly config to SHA and AES functions. > Removed IA32 native support (reduced config was causing build failure a= nd > can be added in a later patch). > Removed XMM instructions from assembly generation. > Added automatic copyright header porting for generated assembly files. >=20 > This patch adds support for building the native instruction algorithms fo= r > the X64 architecture in OpensslLib. The process_files.pl script was modif= ied > to parse the .asm file targets from the OpenSSL build config data struct,= and > generate the necessary assembly files for the EDK2 build environment. >=20 > For the X64 variant, OpenSSL includes calls to a Windows error handling A= PI, > and that function has been stubbed out in ApiHooks.c. >=20 > For all variants, a constructor is added to call the required CPUID funct= ion > within OpenSSL to facilitate processor capability checks in the native > algorithms. >=20 > Additional native architecture variants should be simple to add by follow= ing > the changes made for this architecture. >=20 > The OpenSSL assembly files are traditionally generated at build time usin= g a > perl script. To avoid that burden on EDK2 users, these end-result assembl= y > files are generated during the configuration steps performed by the packa= ge > maintainer (through process_files.pl). The perl generator scripts inside > OpenSSL do not parse file comments as they are only meant to create > intermediate build files, so process_files.pl contains additional hooks t= o > preserve the copyright headers as well as clean up tabs and line endings = to > comply with EDK2 coding standards. The resulting file headers align with > the generated .h files which are already included in the EDK2 repository. >=20 > Cc: Jiewen Yao > Cc: Jian J Wang > Cc: Xiaoyu Lu > Cc: Mike Kinney > Cc: Ard Biesheuvel >=20 > Christopher J Zurcher (2): > CryptoPkg/OpensslLib: Add native instruction support for X64 > CryptoPkg/OpensslLib: Commit the auto-generated assembly files for X64 >=20 > 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 >=20 > -- > 2.28.0.windows.1