From nobody Sun Apr 28 07:26:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52600+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1577595608774344.99862030865245; Sat, 28 Dec 2019 21:00:08 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 2zZQYY1788612xVFdHZW3AGo; Sat, 28 Dec 2019 21:00:07 -0800 X-Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.80]) by mx.groups.io with SMTP id smtpd.web11.16235.1577595227606116673 for ; Sat, 28 Dec 2019 20:53:48 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BdTC8L6B0AY3EcpV3vEkBZMm71JiQ+q4dLp7joI/E2lxgLJ8SDs7rmP4lEZWG644CF9Dt8FnAyq7/uBbVmbmDg0hu6tm+URn7d6Agepc/2OO1kpE3oVaJlcucvXpu8AGdSNAie1rSoGCzo4ZfoIjAkvXh5zETbOzLLmCbrx8m7COGPn1UvLmwsiyh+wPvUZ3tYUsQppP/y6IZ1L9XBAfLhTgTzMQg9HLY9Orn3oqNdJdMxswbtlYp+h/TKSXiHyYVe4Bn7UIYRJVlXgZN4B6LUIJR7BXYmC6xX6Cm2jHMWR4SEgHKD9V4Cqzals8HZeD3rsw5VGEn0ArgJU/jF9JSw== 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=tZgzOCabApi01T+avRA3a69nBw+kx6bUwh7Ra+8B4eU=; b=SgoUDzqzie44v545guq0eVR+XSW03Yz1e66KUspcbEFwN6vkCWXbHk0+43GfyYwmntJ0Kb1CeiSe0Ej0/pb3glOy7EuJIw+2vYrHxOWpgMDB3UuGtxO8C3ck4LUzqU2iWl+LziMSGWtHqz8GqQHfOk3ClwVQUQYXWQpTjGBXd2YGbYj8jPYM2DkP4peRo68ehU6iaQd308XWqmVmrLhoekus9mgIAVQ83Qa88SWoFMRyoiM3iHlfNQ4nGYFZrj6FjWHPTVE6+K6p6WVIfosLzbKwUxU+ahJtgfT0aVHhyEzYUKXQijujFPpMEjFvvcNDjDeppin5AtGq5PvSapcdMA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2238.eurprd04.prod.outlook.com (10.169.133.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2581.12; Sun, 29 Dec 2019 04:53:45 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::8823:663d:c6ed:cbd6]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::8823:663d:c6ed:cbd6%12]) with mapi id 15.20.2581.007; Sun, 29 Dec 2019 04:53:45 +0000 X-Received: from uefi-workstation.ap.freescale.net (92.120.1.69) by TYCPR01CA0026.jpnprd01.prod.outlook.com (2603:1096:405:1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2581.11 via Frontend Transport; Sun, 29 Dec 2019 04:53:42 +0000 From: "Pankaj Bansal" To: "devel@edk2.groups.io" CC: Pankaj Bansal , Dandan Bi , Liming Gao Subject: [edk2-devel] [PATCH] MdeModulePkg PeiCore: Install SEC PPIs before library constructor call Thread-Topic: [PATCH] MdeModulePkg PeiCore: Install SEC PPIs before library constructor call Thread-Index: AQHVvgPymyICpiI6tkWQbYHqZL3dCA== Date: Sun, 29 Dec 2019 04:53:44 +0000 Message-ID: <20191229101353.20820-1-pankaj.bansal@nxp.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: TYCPR01CA0026.jpnprd01.prod.outlook.com (2603:1096:405:1::14) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.120.1.69] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: caa244a2-d474-4fae-4dd8-08d78c1b153d x-ms-traffictypediagnostic: VI1PR0401MB2238:|VI1PR0401MB2238: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+52600+1787277+3901457@groups.io; helo=web01.groups.io; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: d/OSW2n/ig/8aMbwYkmFtnt6I8kZZNCcenPxpx7vRhwnN1aSe3rJsTvpVqzSeeX9j2IzJhtXNbX2UcSZLxZDJnYJG81cxZxTWxzU74MiglUv5/SRsT7DYJix2snoR2g+rHu2BY4EdrPlz6+BIsm+/qD2Z1U6Q3aKOuijTAsPFhqk+c1YURMAUBXPURwOlyKhb+w8ZJn3eKm7uW9/XYFrMxk7tRTvb0HIcmNbjOb/ekyBFzyUUcWt1mAV6Ue5QNFzNVqwtIEc7F2iHmRFUDGDnibIBMFboOHbB6HcU4AEWJ6NErmsFH053gkOp2TXcL9nVeMwXOiGvAX+qDFqm2UPA7Wz0Os5CKvFvo/uhKeoWmV3DeHBwc+0KgZxdWzlmUnAG+YfVr8CQrDCXgr6ocCY+ui8OOWrZNsFUHH61BLIwIJgPphhiDLCRzhp0r78Dy3a MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: caa244a2-d474-4fae-4dd8-08d78c1b153d X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Dec 2019 04:53:44.9317 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6+pk2/04+5FS2wvlpdgtonSHNvVFpBGP77woH7zPQU5yYs8lub8aemRJhSNcuLMbMrVnJ+VNsw/qhPW9eYXdGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2238 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@nxp.com X-Gm-Message-State: K28rqcMAUkQN4zdXdhPYNAxRx1787277AA= Content-Language: en-US Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1577595607; bh=0GU1f4hkYwNsnuog61GCD9zLMlcKYhxupXneP+QsOEc=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=uRcLGuiFwqgkk+MegrlOK/m7io6Vv850C2bq8f3FpcDwwC1vyb/XX3MsWQhv9xI1xxE dXvjwFLAxu1RIlYDe7nNcV1QRPpPB/CO2sPJuEMofxGqEU14cUm8NNFIT1rpULiKSAlc3 Viq4L/MKKNKPcoaF4reU3QLUoXhqPVXwAzo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Install PPIs received from SEC phase before library constructor call, so that any platform specific library can make use of the PPIs exposed by SEC phase. Since SEC phase can expose HOBs also in PPI list, we need to Initialize memory service before installing SEC PPIs. Therefore, the sequence becomes: Initialize memory -> install SEC PPIs -> Call libraries' constructors Signed-off-by: Pankaj Bansal Cc: Dandan Bi Cc: Liming Gao --- MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 24 ++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c b/MdeModulePkg/Core/Pe= i/PeiMain/PeiMain.c index 025d7f98ec..3dd69ddde0 100644 --- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c +++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c @@ -366,14 +366,23 @@ PeiCore ( SetPeiServicesTablePointer ((CONST EFI_PEI_SERVICES **)&PrivateData.Ps); =20 // - // Initialize libraries that the PEI Core is linked against + // Initialize PEI Core Services // - ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES **)&Private= Data.Ps); + InitializeMemoryServices (&PrivateData, SecCoreData, OldCoreData); + + if (OldCoreData =3D=3D NULL) { + // + // If SEC provided the PpiList, process it. + // + if (PpiList !=3D NULL) { + ProcessPpiListFromSec ((CONST EFI_PEI_SERVICES **) &PrivateData.Ps, = PpiList); + } + } =20 // - // Initialize PEI Core Services + // Initialize libraries that the PEI Core is linked against // - InitializeMemoryServices (&PrivateData, SecCoreData, OldCoreData); + ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES **)&Private= Data.Ps); =20 // // Update performance measurements @@ -410,13 +419,6 @@ PeiCore ( EFI_PROGRESS_CODE, (EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT) ); - - // - // If SEC provided the PpiList, process it. - // - if (PpiList !=3D NULL) { - ProcessPpiListFromSec ((CONST EFI_PEI_SERVICES **) &PrivateData.Ps, = PpiList); - } } else { // // Try to locate Temporary RAM Done Ppi. --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#52600): https://edk2.groups.io/g/devel/message/52600 Mute This Topic: https://groups.io/mt/69312521/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-