public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Inquiry regarding early DxeIplPeim loading.
@ 2018-07-12 23:19 Marvin H?user
  2018-07-13  9:24 ` Zeng, Star
  0 siblings, 1 reply; 7+ messages in thread
From: Marvin H?user @ 2018-07-12 23:19 UTC (permalink / raw)
  To: edk2-devel@lists.01.org; +Cc: star.zeng@intel.com, eric.dong@intel.com

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 != S3, the module will register for shadowing and immediately return during the pre-memory phase
https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c#L92
https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/DxeIplPeim/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/DxeIplPeim/DxeLoad.c#L125
... and install the DxeIpl PPI before returning
https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/DxeIplPeim/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/Pei/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 in 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/DxeIplPeim/DxeLoad.c#L118
https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/DxeIplPeim/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.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-07-19 15:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-12 23:19 Inquiry regarding early DxeIplPeim loading Marvin H?user
2018-07-13  9:24 ` Zeng, Star
2018-07-13 13:25   ` Marvin H?user
2018-07-18  9:11     ` Zeng, Star
2018-07-18 21:36     ` Cohen, Eugene
2018-07-19  0:10       ` Marvin H?user
2018-07-19 15:40         ` Cohen, Eugene

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox