From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.41.97; helo=nam03-dm3-obe.outbound.protection.outlook.com; envelope-from=eugene@hp.com; receiver=edk2-devel@lists.01.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0097.outbound.protection.outlook.com [104.47.41.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id ADA4420972141 for ; Wed, 18 Jul 2018 14:36:49 -0700 (PDT) Received: from AT5PR8401MB0340.NAMPRD84.PROD.OUTLOOK.COM (10.169.2.142) by AT5PR8401MB1009.NAMPRD84.PROD.OUTLOOK.COM (10.169.7.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.16; Wed, 18 Jul 2018 21:36:47 +0000 Received: from AT5PR8401MB0340.NAMPRD84.PROD.OUTLOOK.COM ([fe80::e8fe:2485:beb1:f42a]) by AT5PR8401MB0340.NAMPRD84.PROD.OUTLOOK.COM ([fe80::e8fe:2485:beb1:f42a%3]) with mapi id 15.20.0952.021; Wed, 18 Jul 2018 21:36:46 +0000 From: "Cohen, Eugene" To: Marvin H?user , "edk2-devel@lists.01.org" CC: "eric.dong@intel.com" , "Zeng, Star" , "Cohen, Eugene" Thread-Topic: Inquiry regarding early DxeIplPeim loading. Thread-Index: AdQaNDyLZ2J/sHRiSC+kEdwPjgFgmQAVgqeAAAhusyABDCW5wA== Date: Wed, 18 Jul 2018 21:36:46 +0000 Message-ID: References: <0C09AFA07DD0434D9E2A0C6AEB0483103BB82A5E@shsmsx102.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=eugene@hp.com; x-originating-ip: [15.65.252.12] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AT5PR8401MB1009; 6:w+4JcJ42MaBrMuFBAD+dftted2pTebx9YzI8Pe5fcXEduilf5F/wFsfCaZycxf0BTx6g90aIJILiJOrAMZdkzQJZkZEv9U6PIpUNUxMJsum93shWbeBH/Fx28PXgZSuL9jSk55lGk24j4jPmIf7+m8g2utOzAtFBBR262k3lFYbT17JMbq0+slann6QWbW0FvM8zKUAfFg9Yar8y+IEvJ+6yEvGV0TjF0oNe49XTg6CggK6vhu0uY0tNr8EWUFcC1AeA8mWhUatummy4ZKCl0/RUd80QK72U3v5Ki68sotfCLlZG2iE231cSPwguCjIAGfdYmnZAKVlZvk8F/9OdGGfGM0S99TKowsbRb6nDDg/TlkxNYaERt460aPgfNXCiD2Z2slodrYgusFWqV/hH0gh4dFPnGme25YLiS9MG2MjN7K9skJbTeB4OMpCuJM3EMM7Rmf8Y32viU44ukvi0+Q==; 5:a+aDwesQjkafyPpxFRPAJBjTPUebGkjkkRh0AW7elMt+umtU0wfid96DYDMJwH+Gg6GC1VSwVvCT0OVrLAFQ+lXbVt7U9Qgg1+kSIZbe7s/RpcdGbzyD242u2mMEsTFEssVvW1n3bLEVq9PD/oEO3hzNjgCfG4nwULl/BudkNUs=; 7:eHrcMH31PsDBDDPJ9/yMD0RF86ciL6Pc3wPp1ncyAtwExIpEHpVwCbE0dtQo32OgMzYmIYhQSx7NnydMcncY3lXm+yXUSsl4c30W1JysLH+vYZbQpGBOJgDP8gzU6udbHf7JVHOYy5Z9pWCT+VRPF7risbe4soWnUXQ/bf6cIokxkHK83kTqLv6LKN8kkoS5pCgzu0SLBS/Aa/NBGixo64w+PrrR1zwZLU6BnE1yQQV06QgarhzKVPgYOGCb+baN x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10019020)(136003)(346002)(39860400002)(366004)(396003)(376002)(13464003)(199004)(189003)(6602003)(5660300001)(8676002)(81166006)(68736007)(97736004)(7736002)(54906003)(305945005)(81156014)(6246003)(53936002)(53546011)(26005)(6506007)(39060400002)(106356001)(105586002)(74316002)(186003)(478600001)(33656002)(102836004)(966005)(4326008)(6306002)(55016002)(9686003)(76176011)(14454004)(25786009)(7696005)(256004)(11346002)(14444005)(2501003)(5250100002)(3846002)(6116002)(575784001)(99286004)(229853002)(66066001)(486006)(86362001)(8936002)(19627235002)(2900100001)(446003)(476003)(110136005)(6436002)(2906002)(316002); DIR:OUT; SFP:1102; SCL:1; SRVR:AT5PR8401MB1009; H:AT5PR8401MB0340.NAMPRD84.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-office365-filtering-correlation-id: 92f09ff1-57b6-4283-2743-08d5ecf69039 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:AT5PR8401MB1009; x-ms-traffictypediagnostic: AT5PR8401MB1009: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(166708455590820)(189930954265078)(162533806227266)(228905959029699)(73583498263828); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:AT5PR8401MB1009; BCL:0; PCL:0; RULEID:; SRVR:AT5PR8401MB1009; x-forefront-prvs: 0737B96801 received-spf: None (protection.outlook.com: hp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 1F1MuCuUvPck7cITvMKSYKk/MGOJElSgm2V8TZH8kad4XNdw0SxBKOdFsDfYWQYArPj0hrjoXwotF487TOw/D6TVs0ns+udJEceR5e9tPAkkiPnYPjJ4nvRkf/EniBRlrq6DAB8sHg9pXZLBSJs91aa20tYjdzzo1JTEy4oX55js1fL+XlVOIZKy1Yz6A58+8IEonpxYuFJmfApKweN41KUzNVNKvl9nNMcRB4USkLU9S1yH1QpXyZyXRv+ssTXwtOObLI1adrm4qjU9xvg1182R4LB2vzE98UeXh4VIrDagbHp9JyMELK0ut0xZo46MsYkGRO0Ln4VksskDqjcaxQSq+s5RQMi+TIJVfAzGFDI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: hp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92f09ff1-57b6-4283-2743-08d5ecf69039 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jul 2018 21:36:46.7276 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: ca7981a2-785a-463d-b82a-3db87dfc3ce6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AT5PR8401MB1009 Subject: Re: Inquiry regarding early DxeIplPeim loading. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2018 21:36:51 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The depex change did not pertain to S3 resume without memory initialization= (obviously that wouldn't work). The change was whether "permanent memory"= was installed from a PI architecture perspective. We had a situation that= required that the S3 Resume path remain in PEI Cache-as-RAM (actual code i= n CAR, not just data) and this change was necessary to prevent CAR from bei= ng turned off prematurely on S3 resume. By the way it was never our goal for DXE IPL to host the S3 resume path - m= y understanding is that this was a matter of convenience back in ancient hi= story of S3 development (according to an old thread I dug up from a few yea= rs ago). If S3 resume were parked somewhere else such that DXE IPL only di= d the IPL of DXE then this issue might go away. So you're seeing a seconda= ry effect of hosting S3 resume in DXE IPL and DXE IPL depex changes to supp= ort an unusual use case. > -----Original Message----- > From: edk2-devel On Behalf Of > Marvin H?user > Sent: Friday, July 13, 2018 7:26 AM > To: edk2-devel@lists.01.org > Cc: eric.dong@intel.com; Zeng, Star > Subject: Re: [edk2] Inquiry regarding early DxeIplPeim loading. >=20 > Hey Star, >=20 > Thank you very much for your reply. > Interesting, that is basically the case I described as "insane" because I= did > not consider any platform to allow S3 resume without memory > initialization. So, this code definitely makes sense. > You are right, according to the specification, moving it to the PostMem F= V > should be fine. However that will cost a shadow call and a re-entry for n= on- > S3 and an event registration for the S3 boot path. > As the information whether S3 resume without meminit is intended is > known at compile-time, what's your opinion on a FeatureFlag PCD which > chooses between direct calls and the shadow/event system? > I would prepare a patch as soon as I can properly test its working, if yo= u are > interested. The changes would be most minimal, I imagine. >=20 > Thanks, > Marvin. >=20 > > -----Original Message----- > > From: Zeng, Star > > Sent: Friday, July 13, 2018 11:24 AM > > To: Marvin H?user ; edk2- > > devel@lists.01.org > > Cc: Dong, Eric ; Cohen, Eugene > ; > > Gao, Liming ; Zeng, Star > > Subject: RE: Inquiry regarding early DxeIplPeim loading. > > > > Marvin, > > > > You can check SHA-1: ebaafbe62c70309d0ceb44a0c4199093d0a823c4. > > It is for the case "Allow S3 Resume without having installed permanent > > memory (via InstallPeiMemory)" (PI Mantis 1532, you can search the > > sentence in PI spec) requested by HP. > > Yes before ebaafbe62c70309d0ceb44a0c4199093d0a823c4, DxeIpl.inf had > > gEfiPeiMemoryDiscoveredPpiGuid DEPEX. > > For the case you mentioned about MinPlatformPkg, I think you can put > > the DxeIpl.inf into a Post Memory FV if the platform will publish > > gEfiPeiMemoryDiscoveredPpiGuid indeed. > > > > > > Thanks, > > Star > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf > Of > > Marvin H?user > > Sent: Friday, July 13, 2018 7:19 AM > > To: edk2-devel@lists.01.org > > Cc: Dong, Eric ; Zeng, Star > > Subject: [edk2] Inquiry regarding early DxeIplPeim loading. > > > > Good day developers, > > > > While checking out which edk2 modules request being shadowed, I came > > across DxeIplPeim being one of them, however I am not sure why it was > > designed this way. > > > > If the Boot Mode is !=3D S3, the module will register for shadowing and > > immediately return during the pre-memory phase > > > https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/D > xe > > IplPeim/DxeLoad.c#L92 > > > https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/D > xe > > IplPeim/DxeLoad.c#L111 > > > > If the Boot Mode is S3, the module will register a Memory Discovered > > event to install crucial PPIs... > > > https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/D > xe > > IplPeim/DxeLoad.c#L125 > > ... and install the DxeIpl PPI before returning > > > https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/D > xe > > IplPeim/DxeLoad.c#L132 > > > > However, by design, the DxeIpl PPI is not located until the very end > > of PeiCore, meaning the dispatcher ran out of modules to dispatch > > > https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/P > ei/ > > PeiMain/PeiMain.c#L467 > > Hence installing the DxeIpl PPI early in the S3 boot path does not > > seem to have any effect to me, as both paths are left awaiting memory > > availability (Shadow / event). The only functional change would be > > PeiCore failing to locate the DxeIpl PPI in case memory initialization > > silently fails and code execution continues, which is an insane state i= n the > first place. > > > > Am I missing any scenario where this design is helpful? Is there any > > disadvantage for adding a Depex on MemoryDiscovered PPI? Running > only > > after memory initialization would shrink the initialization function > > by removing the shadowing request in non-S3 path and the event > > registration in the S3 path, as well as merging the PPI installation > > code as both registrations end up executing the exact same code > > > https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/D > xe > > IplPeim/DxeLoad.c#L118 > > > https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/D > xe > > IplPeim/DxeLoad.c#L57 > > > > The initialization function would collapse to PPI installations, a > > shadow or event registration call would be saved and platforms could > > safely embed DxeIplPeim into a Post Memory FV, such as > MinPlatformPkg > > is using, to have the PEIM loaded directly into memory to gain yet > > more performance. The only restriction would be to prohibit > compression. > > > > Thanks for your time. > > > > Best regards, > > Marvin. > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel