On Aug 27, 2014, at 2:07 AM, Laszlo Ersek <[email protected]> wrote:

> Hi All,
> 
> based on Chapter 11, PEI Physical Memory Usage, in the PI spec, I think
> that any PEIM that wants to call BuildMemoryAllocationHob() must make
> sure that it runs on permanent PEI RAM.
> 
> In other words, it seems like BuildMemoryAllocationHob() is restricted
> to PEI code that runs after permanent PEI RAM installation.
> 
> One way a PEIM can conform to this requirement is apparently a Depex on
> gEfiPeiMemoryDiscoveredPpiGuid.
> 
> Questions:
> - Is BuildMemoryAllocationHob() in fact restricted this way?

No. The HOB structures are independent of memory addresses. When the migration 
is made from temp ram to memory the PEI Core re-initializes it’s self and 
copies the HOBs over.  

> - If so, is a gEfiPeiMemoryDiscoveredPpiGuid Depex a good way to comply
>  with this restriction in a PEIM (that doesn't itself install the
>  permanent PEI RAM)?
> 

Yes, and this means the PEIM can be shadowed into memory. It also makes it 
possible to compress the PEIM if needed. 

> In practice, this question has no consequences for OvmfPkg, because
> there we already conform to the (apparent) requirement, and we ensure
> the ordering simply by installing the permanent PEI RAM in the *same*
> PEIM that later on calls BuildMemoryAllocationHob().
> 
> However, in ArmPlatformPkg/AArch64VirtualizationPkg, we might call
> BuildMemoryAllocationHob() in a PEIM that is *separate* from the PEIM
> that installs the permantent PEI RAM. Hence I think that this dependency
> should be spelled out explicitly in the dependent PEIM's depex.
> 
> Thanks!
> Laszlo
> 
> ------------------------------------------------------------------------------
> Slashdot TV.  
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to