On 2019-02-17 18:25:01, Ni, Ray wrote:
> Jordan,
>  > Study the PeiCore migration logic a bit more, I found since PeiCore
>  > knows the exact size of new stack in permanent memory, it migrates
>  > old stack to the top of new stack.
>  > But the migration logic in above C code (since it doesn't know the
>  > size of new stack, CopySize is the size of temporary memory) may copy 
>  > the old stack to the middle in new stack.
> 
> Maybe your new RamMigration2 PPI needs to carry both the old and new 
> stack/heap location and size.
> It helps:
> 1. migrate the old stack to top of new stack (instead of middle of new 
> stack).
> 2. potentially reduce the size of memory that needs to be copied.
> 
> TemporaryRamMigration (
>    IN CONST EFI_PEI_SERVICES             **PeiServices,
>    IN EFI_PHYSICAL_ADDRESS               TemporaryStackBase,
>    IN EFI_PHYSICAL_ADDRESS               PermanentStackSize,
>    IN EFI_PHYSICAL_ADDRESS               TemporaryHeapBase,
>    IN EFI_PHYSICAL_ADDRESS               PermanentHeapSize,
>    IN TEMPORARY_RAM_MIGRATION_CALLBACK   Callback,
>    IN VOID                               *Context
>    )

Hmm. I'll think about that for the new PPI.

> Before the finalize of PI spec change regarding the RamMigration2 
> change, I prefer to fix the EmulatorPkg boot crash ASAP using the
> OVMF-like solution.
> If you agree, I will send out the patch to let you review.

You are right that it will take more time for a new PPI. But, I have
almost finished my patches to fix the PEI Core with the old PPI. I'll
try to send them out tonight.

-Jordan
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to