On 2018-11-17 20:51:11, Liu Yu wrote:
> OS: Ubuntu
> 
> Toolchain:GCC48

I don't have gcc-4.8, so I couldn't reproduce the issue, but I wonder
if this branch can fix the issue for you?

https://github.com/jljusten/edk2/tree/emulator-temp-ram

You can fetch this branch locally to a branch named `test` with a
command like this:

$ git fetch --no-tags https://github.com/jljusten/edk2.git 
emulator-temp-ram:test

Then checkout the `test` branch to try it.

First, there is some patches to cleanup Sec, but then I added a patch:

53a432e149 "EmulatorPkg/Sec: Disable optimizations for TemporaryRamMigration 
function"

Which I hope might help in your case.

-Jordan

> 
> Issue Description :
> 
>   Program received signal SIGSEGV, Segmentation fault.
>    at 
> /home/pedroa/workspace/orign/edkcrb/MdeModulePkg/Core/Pei/Memory/MemoryServices.c:129
> 129      Private->MemoryPages.Size = (UINTN) 
> (Private->HobList.HandoffInformationTable->EfiMemoryTop -
> 
> 
> if the GCC optimization option is used not -O0 so the "rbp" register will be 
> used as "general register"
> 
> in the SecTemporaryRamSupport function as below, this function will modify 
> the rbp (as general register not stack base address pointer)value that result 
> in program crash.
> 
> ASM_PFX(SecTemporaryRamSupport):
>   // Adjust callers %rbp to account for stack move
>   subq    %rdx, %rbp     // Calc offset of %rbp in Temp Memory
>   addq    %r8,  %rbp     // add in permanent base to offset
> 
> _______________________________________________
> 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

Reply via email to