From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.37965.1669883827151912580 for ; Thu, 01 Dec 2022 00:37:07 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=XP3z/+fc; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: jiewen.yao@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669883827; x=1701419827; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=16l3Q9TiL9EacgD1bJrPJvZlyxUwVQi4imT0ACjFL6g=; b=XP3z/+fcGvg4XtpVKdGfRCbokrjKSlY2g0QvuNHO9y5fhwDIBdpUHE3y Xy8YOtDXTPw/t5WLz0kJipX567+IuUKTNl41YuiYg2tGvrRCWU6hElLvD 5P3568nNX0f2wqStcQ/3nE0bAA7+g7LuMXPFFkCt1SyFreZadp6prc+dq 5aa2t54X0pyu5g0y21fcOo5uedg8tS/J2tfq+1KfLJqLiLeUn3aKtS8fn vRAN11T+FsVjMy5DJR+iyrd0yI+NlhggRRL+ICm7Tv6UItbVeDp8XvAGu CDfnNeJyvVF+Qv7qabGH0NAia7Ks5sdu3fBPSQMhFQDJyJrpZfC5nNuur A==; X-IronPort-AV: E=McAfee;i="6500,9779,10547"; a="315647946" X-IronPort-AV: E=Sophos;i="5.96,207,1665471600"; d="scan'208";a="315647946" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2022 00:37:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10547"; a="707983787" X-IronPort-AV: E=Sophos;i="5.96,207,1665471600"; d="scan'208";a="707983787" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga008.fm.intel.com with ESMTP; 01 Dec 2022 00:37:06 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 1 Dec 2022 00:37:05 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 1 Dec 2022 00:37:05 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Thu, 1 Dec 2022 00:37:05 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Thu, 1 Dec 2022 00:37:04 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HmyhC4Qnf2Z5qh0CyK7oUk/i9PNH6eTyi+lZ/+QZlRdmjh//6dHm4ttYDYgFsKxbkD9X4QMP40/6Al7YFWG+52P/kNhAiStiM0IVEzSkB0ykUy5UVlwKIbvO0EzFn6Aip0bXG4fpBafyZe8E4UcNMSGcZj6xy/kNycIPiqYne00/4CIlsf1JMdPUOWdrobLghH5UUG5OrC+1bRTeY4tRw/8iNkr8ETHNDGpFTBTKDFzwsy+BOa/o2TzzOiZGi9PJWBbgOUFmXEiWe9reJ0uInX+aKTBQhnSFhuWw/LDACQCFsezGfqMXscbYCnNwycam8FTb9p07WgPmsY3lsl9Haw== 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=IIMaNUL9DmMkXQu9T1DF6rEMHsoXp7GUQ6J2tLy6pNk=; b=KmDVD6WZB5Fj7NgSG6M0K7l/nPi7u9TLsj1d0x8VUDt6gXAfws//j3wAuUETdTBrT9kXDDW0WJ1C7zuo0mQNLOsmQYud7vz+bchl5zmWkVCFVT9Dcd68OfsBtyI7DcX+u8sOojBWX2gGId3j/k0HhgpxujMm+zyBvb1ZsEPdLNcjuMWgxRxGedIu6bTy+R+IXThHT3SpGjo29wqoplc3/IYqk5SDZ6iNhfS7Jj7SgbIBS12PSbggztcWKxBO1hJqE13y6W+6O+Fm1B+Lb011aV7hZjz3SF6uRpUCYbAS1GGVLiHSTZqX4VH+hm5HwOwPv5XWFo4MeVHQyI5yi2DgoA== 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 Received: from MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by SN7PR11MB6898.namprd11.prod.outlook.com (2603:10b6:806:2a6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.23; Thu, 1 Dec 2022 08:36:57 +0000 Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::e9dd:f205:1970:4edb]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::e9dd:f205:1970:4edb%9]) with mapi id 15.20.5857.023; Thu, 1 Dec 2022 08:36:57 +0000 From: "Yao, Jiewen" To: "devel@edk2.groups.io" , "Li, Zhihao" CC: "Wang, Jian J" Subject: Re: [edk2-devel] [PATCH v1 1/1] CryptPkg: Enable CryptoPkg BaseCryptLib ParallelHash for PEI and DXE Thread-Topic: [edk2-devel] [PATCH v1 1/1] CryptPkg: Enable CryptoPkg BaseCryptLib ParallelHash for PEI and DXE Thread-Index: AQHZBMcCb0Hze1Gm+Umc9ohB3t4SL65Ytn/w Date: Thu, 1 Dec 2022 08:36:57 +0000 Message-ID: References: <20221130142102.1258-1-zhihao.li@intel.com> In-Reply-To: <20221130142102.1258-1-zhihao.li@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5872:EE_|SN7PR11MB6898:EE_ x-ms-office365-filtering-correlation-id: e3925f7a-f057-4559-fab5-08dad3773568 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: I/wF6/fd9L+UDfbwhKpwQ3W07dHitj//w+q5PnNobgtPCRMicAm2dL/8RiqJ6XagxFz3zkBblDEQ4p/xQeu0q/5+lM2+kk5/TVQcKTBROXm/WDNDgAg37amGmeh7QWr5sTUYesWNcuq7thhpOepdy7/kJcgOJzLC+DKW1v4soztCcaoPj14zgpuqaOyHHo490FyN2lBcE7QGj/xbyqK4PkHbBtm7jttr7bBATTDslsFmIYX8hfZw8Ql15DYhNw1Spx1Qx9L0CM8rjp8h+Em+md+jMNdA1H4OaQagOZMITzzt5Vy4SJckoct97imYIQxcPrFrNtVPH6OE2OGseqd1b8IQq4uDeO/lHWQwOIPKM+O9o3W/XxOYtJj9NIwGMV8VgB3vait13wTL8wGux8vZgLWHGlV2+Gt0aXwqck4X8P5YV9nSx4QQ6NSJsK1Lz/LVn9vd01CzuUJBGl603xGGGKMR4bNIKbhCpX5VZxe/PkMXAsubHRG1XqgvSDsxl+lj3c47HODAutNzOTnOq7rpe3jxD2Blf29wzwc5f4QRd9P8pKvtu3ObsnAryyMTCUPKOYuYj5Yz0tQXhSE4D9xNfME252VPhqFKn7r2rnHjoyj8534tDO3zbeaXAiw4kh5iOOtwy6c7krCXmaT1L6IjZA4bGCRGDnuCmwKOsZdf8ArEcOD3LZwOs+Mrb120pXsucGjsMpKvJyYeCj7ofX1ZMMMaiwFDJV3koRU/Z0qnH6vTO7jkri/Lj7Dnt+DryaKRCrOZouLFLxiCWlEcaJk/ow== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR11MB5872.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(396003)(376002)(136003)(346002)(39860400002)(451199015)(33656002)(66899015)(2906002)(82960400001)(4326008)(38070700005)(41300700001)(30864003)(122000001)(83380400001)(66556008)(86362001)(66476007)(316002)(19627235002)(478600001)(110136005)(64756008)(71200400001)(66946007)(6636002)(38100700002)(966005)(55016003)(5660300002)(52536014)(8936002)(186003)(66446008)(26005)(76116006)(107886003)(8676002)(7696005)(6506007)(9686003)(53546011);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?hhPt+r6D0PoZiEHl32Gu/3f06OyS1heQiteKIi/xAiUO9LSC6Z2wZmtxj/kB?= =?us-ascii?Q?ESwg9J+ggMdzoDxib9lNbN+EuWBstLBrugw7NDOtKAvG5BG3BnYhkFKvEmnr?= =?us-ascii?Q?MGsVm56R8d+uOqNvrTaJBB0+ydVgnayj6oRtURgHuL0wPDY7uNpuc0sC4N8l?= =?us-ascii?Q?VXRW1X/msbckQK+B6NVAK648FQmpQ+4II7euXhTMZn9TOiRH2UEwIJCwko17?= =?us-ascii?Q?XZ0dgNXsirPjYJ8SPVPFXLhclItJ1yeT3H2io/aJANlTv5xejCwnlW6y1XHo?= =?us-ascii?Q?+XoJeIFJtrr5g+T8ERMU/akOdfrnq0Uz/0DrvRk6obYnQgc2I9QCLsrh8DlK?= =?us-ascii?Q?Cb7Omhfx93vzc10t5K5642r677nBE9V6+iYlDL2SDXSG/PazN0NLhYbrUKlx?= =?us-ascii?Q?r7iH0sa0LcXPypcNEtYTUZmFMJhyuFTCGQ2Oxmpn1Jlps7HJwwBDkQPpJ1wB?= =?us-ascii?Q?rG8mTtWFrLFbk5v/dpoC3AHaKl+fLbsEj4wb5cpM5k9/Q4j9A/+ipohYzO+D?= =?us-ascii?Q?sh7W0NpHMk4aN683/HmnJoQ3sQBj6sZzo7rXTgAI+TrX4xB5B7Agoh7UgwfU?= =?us-ascii?Q?0FJz90TohjFxbwS+DpPpgv5m6Mk5WyqrY+ZZXhwbVMe3iSmljjm3z0IRHhjR?= =?us-ascii?Q?OCMXKEqBjV7BkNc4Z8vtjPbH8JSK7SkwdDpn1KwC0APxd6C8lw9JY1iHqzNb?= =?us-ascii?Q?5D6MJzmpozIoqWUi5aTenDzXu+IqwQPB4UB27K+AcBIsnhQ62p39tsX9uAES?= =?us-ascii?Q?bTsZOiT6vYXX0S1A+Yi4acF37TWVct83f92qW5n6wFCnRUurnoZ+VtKS7Kpn?= =?us-ascii?Q?62zelOANymggK9LPpUCnZh6nPhQM3RwX6AM9PQHFCUnsuISBYoY5bsca+Ons?= =?us-ascii?Q?aDGVWvPOlVZuBK/p3ebzImtWDLXXzRm8dL1KBHPu+t9kUszlIkPw73KEn8NV?= =?us-ascii?Q?xeUrvxNWinPYBfzqauAYd1XIusCCfTOgwoZlE5x6xvOCfDiLrmPHfU9fm2dH?= =?us-ascii?Q?ZeJ3l2py8Sv1kZXa2JC9yicw4oWaLYQuT5HSmkLm+/TsC4jDDuJ4URUUQfqy?= =?us-ascii?Q?M7/vs2AeuCHiXxr4ugUck9M0mxMbCT9KlitoiZLG6lqQi0GnCy8PaP72AzDP?= =?us-ascii?Q?XGoVmqZ0wsnxkh7AI2zlP4V/Q2heKb3poOfSwuAiWu4zBAqZ32EkW9/XO2DX?= =?us-ascii?Q?GoH+ypiLCKPKX6Y9iL9gwYoVEBu74PaV3zDvOT4fVrizuuoJVDGARGVr4E+T?= =?us-ascii?Q?YnNtGXCkV8GsQSrs1Vxk/S6kEi2XUQzfF2PU4FpS8qqdDrvXRaYTQiiTsS1D?= =?us-ascii?Q?1cfRlEEaq7BcnPLiYZr7ezbjGmWC3o2j9qQPPsjG0B8Tcfa+JYHsLeOdIeON?= =?us-ascii?Q?H1hvAKskkJI9453jfKFjuG75TglzIGH3H0H7XONwEOIObCzjaSI0D+Uq/HKZ?= =?us-ascii?Q?ii96dYCEdqIFdENFVqrE2gX4Xcy38ZgKZXNAn2ouyI65+kyQ7cBhSVna9XLe?= =?us-ascii?Q?6Jk+gH0coloahUNvhTcaEPrJaM7F1tsqKiAySqEzqv+yxzOKGczYzDTPsvAk?= =?us-ascii?Q?wkGbvM8ZOL7PUO+OWfdiA/OIGeB6sfZZJDdIIYEx?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3925f7a-f057-4559-fab5-08dad3773568 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Dec 2022 08:36:57.6831 (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: o18J1zgrtkAB/gM9FrIydWxJjhyWmyfy1sNFtjpsP8981+cG3Uq1S5exaLN2POm1Ht4hzpnV0kuMTcR1raSGiw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB6898 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 Thanks.=20 Would you please share what test you have run for this? > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Li, > Zhihao > Sent: Wednesday, November 30, 2022 10:21 PM > To: devel@edk2.groups.io > Cc: Yao, Jiewen ; Wang, Jian J > > Subject: [edk2-devel] [PATCH v1 1/1] CryptPkg: Enable CryptoPkg > BaseCryptLib ParallelHash for PEI and DXE >=20 > From: Zhihao Li >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4097 >=20 > The BaseCryptLib in the CryptoPkg currently supports ParallelHash > algorithm for SMM. The MP Services PPI and MP Services Protocol > could be used to enable ParallelHash in PEI and DXE > versions of the BaseCryptLib. >=20 > Cc: Jiewen Yao > Cc: Jian J Wang >=20 > Signed-off-by: Zhihao Li > --- > CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApDxe.c | 49 > ++++++++++++++++++ > CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApMm.c | 35 > +++++++++++++ > CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApPei.c | 54 > ++++++++++++++++++++ > CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.c | 26 +--------- > CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf | 11 +++- > CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.h | 23 > +++++++++ > CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf | 11 +++- > CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf | 1 + > 8 files changed, 183 insertions(+), 27 deletions(-) >=20 > diff --git a/CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApDxe.c > b/CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApDxe.c > new file mode 100644 > index 000000000000..607aa7cd48d2 > --- /dev/null > +++ b/CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApDxe.c > @@ -0,0 +1,49 @@ > +/** @file >=20 > + Dispatch Block to Aps in Dxe phase for parallelhash algorithm. >=20 > + >=20 > +Copyright (c) 2022, Intel Corporation. All rights reserved.
>=20 > +SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#include "CryptParallelHash.h" >=20 > +#include >=20 > +#include >=20 > + >=20 > +/** >=20 > + Dispatch the block task to each AP in PEI phase. >=20 > + >=20 > +**/ >=20 > +VOID >=20 > +EFIAPI >=20 > +DispatchBlockToAp ( >=20 > + VOID >=20 > + ) >=20 > +{ >=20 > + EFI_STATUS Status; >=20 > + EFI_MP_SERVICES_PROTOCOL *MpServices; >=20 > + >=20 > + Status =3D gBS->LocateProtocol ( >=20 > + &gEfiMpServiceProtocolGuid, >=20 > + NULL, >=20 > + (VOID **)&MpServices >=20 > + ); >=20 > + if (EFI_ERROR (Status)) { >=20 > + // >=20 > + // Failed to locate MpServices Protocol, do parallel hash by one cor= e. >=20 > + // >=20 > + DEBUG ((DEBUG_ERROR, "[DispatchBlockToApDxe] Failed to locate > MpServices Protocol. Status =3D %r\n", Status)); >=20 > + return; >=20 > + } >=20 > + >=20 > + Status =3D MpServices->StartupAllAPs ( >=20 > + MpServices, >=20 > + ParallelHashApExecute, >=20 > + FALSE, >=20 > + NULL, >=20 > + 0, >=20 > + NULL, >=20 > + NULL >=20 > + ); >=20 > + return; >=20 > +} >=20 > diff --git a/CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApMm.c > b/CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApMm.c > new file mode 100644 > index 000000000000..0237fb38bcb6 > --- /dev/null > +++ b/CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApMm.c > @@ -0,0 +1,35 @@ > +/** @file >=20 > + Dispatch the block task to each AP in Smm mode for parallelhash > algorithm. >=20 > + >=20 > +Copyright (c) 2022, Intel Corporation. All rights reserved.
>=20 > +SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#include "CryptParallelHash.h" >=20 > +#include >=20 > + >=20 > +/** >=20 > + Dispatch the block task to each AP in SMM mode. >=20 > + >=20 > +**/ >=20 > +VOID >=20 > +EFIAPI >=20 > +DispatchBlockToAp ( >=20 > + VOID >=20 > + ) >=20 > +{ >=20 > + UINTN Index; >=20 > + >=20 > + if (gMmst =3D=3D NULL) { >=20 > + return; >=20 > + } >=20 > + >=20 > + for (Index =3D 0; Index < gMmst->NumberOfCpus; Index++) { >=20 > + if (Index !=3D gMmst->CurrentlyExecutingCpu) { >=20 > + gMmst->MmStartupThisAp (ParallelHashApExecute, Index, NULL); >=20 > + } >=20 > + } >=20 > + >=20 > + return; >=20 > +} >=20 > diff --git a/CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApPei.c > b/CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApPei.c > new file mode 100644 > index 000000000000..9ddd23d32048 > --- /dev/null > +++ b/CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApPei.c > @@ -0,0 +1,54 @@ > +/** @file >=20 > + Dispatch Block to Aps in Pei phase for parallelhash algorithm. >=20 > + >=20 > +Copyright (c) 2022, Intel Corporation. All rights reserved.
>=20 > +SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#include "CryptParallelHash.h" >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > + >=20 > +/** >=20 > + Dispatch the block task to each AP in PEI phase. >=20 > + >=20 > +**/ >=20 > +VOID >=20 > +EFIAPI >=20 > +DispatchBlockToAp ( >=20 > + VOID >=20 > + ) >=20 > +{ >=20 > + EFI_STATUS Status; >=20 > + CONST EFI_PEI_SERVICES **PeiServices; >=20 > + EFI_PEI_MP_SERVICES_PPI *MpServicesPpi; >=20 > + >=20 > + PeiServices =3D GetPeiServicesTablePointer (); >=20 > + Status =3D (*PeiServices)->LocatePpi ( >=20 > + PeiServices, >=20 > + &gEfiPeiMpServicesPpiGuid, >=20 > + 0, >=20 > + NULL, >=20 > + (VOID **)&MpServicesPpi >=20 > + ); >=20 > + if (EFI_ERROR (Status)) { >=20 > + // >=20 > + // Failed to locate MpServices Ppi, do parallel hash by one core. >=20 > + // >=20 > + DEBUG ((DEBUG_ERROR, "[DispatchBlockToApPei] Failed to locate > MpServices Ppi. Status =3D %r\n", Status)); >=20 > + return; >=20 > + } >=20 > + >=20 > + Status =3D MpServicesPpi->StartupAllAPs ( >=20 > + (CONST EFI_PEI_SERVICES **)PeiServices, >=20 > + MpServicesPpi, >=20 > + ParallelHashApExecute, >=20 > + FALSE, >=20 > + 0, >=20 > + NULL >=20 > + ); >=20 > + return; >=20 > +} >=20 > diff --git a/CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.c > b/CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.c > index f7ce9dbf523e..2931123736e3 100644 > --- a/CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.c > +++ b/CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.c > @@ -7,7 +7,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > **/ >=20 >=20 >=20 > #include "CryptParallelHash.h" >=20 > -#include >=20 > #include >=20 >=20 >=20 > #define PARALLELHASH_CUSTOMIZATION "ParallelHash" >=20 > @@ -69,27 +68,6 @@ ParallelHashApExecute ( > } >=20 > } >=20 >=20 >=20 > -/** >=20 > - Dispatch the block task to each AP in SMM mode. >=20 > - >=20 > -**/ >=20 > -VOID >=20 > -EFIAPI >=20 > -MmDispatchBlockToAP ( >=20 > - VOID >=20 > - ) >=20 > -{ >=20 > - UINTN Index; >=20 > - >=20 > - for (Index =3D 0; Index < gMmst->NumberOfCpus; Index++) { >=20 > - if (Index !=3D gMmst->CurrentlyExecutingCpu) { >=20 > - gMmst->MmStartupThisAp (ParallelHashApExecute, Index, NULL); >=20 > - } >=20 > - } >=20 > - >=20 > - return; >=20 > -} >=20 > - >=20 > /** >=20 > Parallel hash function ParallelHash256, as defined in NIST's Special > Publication 800-185, >=20 > published December 2016. >=20 > @@ -197,9 +175,7 @@ ParallelHash256HashAll ( > // >=20 > // Dispatch blocklist to each AP. >=20 > // >=20 > - if (gMmst !=3D NULL) { >=20 > - MmDispatchBlockToAP (); >=20 > - } >=20 > + DispatchBlockToAp (); >=20 >=20 >=20 > // >=20 > // Wait until all block hash completed. >=20 > diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > index 213813cad971..5be1724f0852 100644 > --- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > +++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > @@ -35,7 +35,11 @@ > Hash/CryptSha256.c >=20 > Hash/CryptSha512.c >=20 > Hash/CryptSm3.c >=20 > - Hash/CryptParallelHashNull.c >=20 > + Hash/CryptSha3.c >=20 > + Hash/CryptXkcp.c >=20 > + Hash/CryptCShake256.c >=20 > + Hash/CryptParallelHash.c >=20 > + Hash/CryptDispatchApDxe.c >=20 > Hmac/CryptHmac.c >=20 > Kdf/CryptHkdf.c >=20 > Cipher/CryptAes.c >=20 > @@ -93,6 +97,11 @@ > OpensslLib >=20 > IntrinsicLib >=20 > PrintLib >=20 > + UefiBootServicesTableLib >=20 > + SynchronizationLib >=20 > + >=20 > +[Protocols] >=20 > + gEfiMpServiceProtocolGuid >=20 >=20 >=20 > # >=20 > # Remove these [BuildOptions] after this library is cleaned up >=20 > diff --git a/CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.h > b/CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.h > index dcfe200e5829..03a1a58cb8e7 100644 > --- a/CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.h > +++ b/CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.h > @@ -201,3 +201,26 @@ CShake256HashAll ( > IN UINTN CustomizationLen, >=20 > OUT UINT8 *HashValue >=20 > ); >=20 > + >=20 > +/** >=20 > + Complete computation of digest of each block. >=20 > + >=20 > + Each AP perform the function called by BSP. >=20 > + >=20 > + @param[in] ProcedureArgument Argument of the procedure. >=20 > +**/ >=20 > +VOID >=20 > +EFIAPI >=20 > +ParallelHashApExecute ( >=20 > + IN VOID *ProcedureArgument >=20 > + ); >=20 > + >=20 > +/** >=20 > + Dispatch the block task to each AP. >=20 > + >=20 > +**/ >=20 > +VOID >=20 > +EFIAPI >=20 > +DispatchBlockToAp ( >=20 > + VOID >=20 > + ); >=20 > diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf > b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf > index b1629647f9c6..2aafa5f0ac9a 100644 > --- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf > +++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf > @@ -40,7 +40,11 @@ > Hash/CryptSha256.c >=20 > Hash/CryptSm3.c >=20 > Hash/CryptSha512.c >=20 > - Hash/CryptParallelHashNull.c >=20 > + Hash/CryptSha3.c >=20 > + Hash/CryptXkcp.c >=20 > + Hash/CryptCShake256.c >=20 > + Hash/CryptParallelHash.c >=20 > + Hash/CryptDispatchApPei.c >=20 > Hmac/CryptHmac.c >=20 > Kdf/CryptHkdf.c >=20 > Cipher/CryptAesNull.c >=20 > @@ -80,7 +84,12 @@ > OpensslLib >=20 > IntrinsicLib >=20 > PrintLib >=20 > + PeiServicesTablePointerLib >=20 > + PeiServicesLib >=20 > + SynchronizationLib >=20 >=20 >=20 > +[Ppis] >=20 > + gEfiPeiMpServicesPpiGuid >=20 > # >=20 > # Remove these [BuildOptions] after this library is cleaned up >=20 > # >=20 > diff --git a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf > b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf > index 0af7a3f96e8f..00ea7bf4c5df 100644 > --- a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf > +++ b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf > @@ -42,6 +42,7 @@ > Hash/CryptXkcp.c >=20 > Hash/CryptCShake256.c >=20 > Hash/CryptParallelHash.c >=20 > + Hash/CryptDispatchApMm.c >=20 > Hmac/CryptHmac.c >=20 > Kdf/CryptHkdfNull.c >=20 > Cipher/CryptAes.c >=20 > -- > 2.26.2.windows.1 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#96736): > https://edk2.groups.io/g/devel/message/96736 > Mute This Topic: https://groups.io/mt/95358558/1772286 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [jiewen.yao@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D >=20