Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2019-02-17 Thread Jordan Justen
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 kn

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2019-02-17 Thread Ni, Ray
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

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2019-02-16 Thread Andrew Fish via edk2-devel
> On Feb 15, 2019, at 11:40 PM, Ni, Ray > wrote: > > I also met this issue. > I found three solutions: > 1. Forcing PeiMain CC flag to "-O0" works. > 2. Changing EmulatorPkg/Sec to not produce TemporaryRamSupportPpi also works. > 3. Implement the temporary migration ro

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2019-02-16 Thread Jordan Justen
On 2019-02-16 00:05:27, Ni, Ray wrote: > On 2/16/2019 3:43 PM, Ni, Ray wrote: > > (Sent third times to make sure Andrew and Laszlo are in the TO list.) > > > > I also met this issue. > > I found three solutions: > > 1. Forcing PeiMain CC flag to "-O0" works. > > 2. Changing EmulatorPkg/Sec to not

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2019-02-16 Thread Ni, Ray
On 2/16/2019 3:43 PM, Ni, Ray wrote: (Sent third times to make sure Andrew and Laszlo are in the TO list.) I also met this issue. I found three solutions: 1. Forcing PeiMain CC flag to "-O0" works. 2. Changing EmulatorPkg/Sec to not produce TemporaryRamSupportPpi also works. 3. Implement the te

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2019-02-15 Thread Ni, Ray
(Sent third times to make sure Andrew and Laszlo are in the TO list.) I also met this issue. I found three solutions: 1. Forcing PeiMain CC flag to "-O0" works. 2. Changing EmulatorPkg/Sec to not produce TemporaryRamSupportPpi also works. 3. Implement the temporary migration routine as below in

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2019-02-15 Thread Ni, Ray
I also met this issue. I found three solutions: 1. Forcing PeiMain CC flag to "-O0" works. 2. Changing EmulatorPkg/Sec to not produce TemporaryRamSupportPpi also works. 3. Implement the temporary migration routine as below in EmulatorPkg/Sec module. EFI_STATUS EFIAPI SecTemporaryRamSupport (

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2019-02-15 Thread Ni, Ray
I also met this issue. I found three solutions: 1. Forcing PeiMain CC flag to "-O0" works. 2. Changing EmulatorPkg/Sec to not produce TemporaryRamSupportPpi also works. 3. Implement the temporary migration routine as below in EmulatorPkg/Sec module. EFI_STATUS EFIAPI SecTemporaryRamSupport (

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2018-11-20 Thread Laszlo Ersek
On 11/19/18 23:29, Jordan Justen wrote: > On 2018-11-19 13:22:27, Andrew Fish wrote: >> I seem to remember we hit an issue like this a long time ago? Do you >> remember the details? Maybe it was we needed to write the >> TempRamSupport code in assembly? > > It does also creep up there, which is w

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2018-11-19 Thread Andrew Fish
> On Nov 19, 2018, at 2:29 PM, Jordan Justen wrote: > > On 2018-11-19 13:22:27, Andrew Fish wrote: >> >> >>> On Nov 19, 2018, at 11:16 AM, Jordan Justen >>> wrote: >>> >>> On 2018-11-18 17:13:21, Jordan Justen wrote: On 2018-11-18 14:37:09, Andrew Fish wrote: > > >> On

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2018-11-19 Thread Andrew Fish
> On Nov 19, 2018, at 2:12 PM, Laszlo Ersek wrote: > > Jordan wrote: > So, is it safe to adjust rbp? Unknown. It may not be if rbp is not used as a frame pointer. Is it safe to *not* adjust rbp and potentially allow the old temp ram stack to be used? Unknown. > > Andrew wrote:

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2018-11-19 Thread Jordan Justen
On 2018-11-19 13:22:27, Andrew Fish wrote: > > > > On Nov 19, 2018, at 11:16 AM, Jordan Justen > > wrote: > > > > On 2018-11-18 17:13:21, Jordan Justen wrote: > >> On 2018-11-18 14:37:09, Andrew Fish wrote: > >>> > >>> > On Nov 18, 2018, at 4:07 AM, Liu Yu wrote: > > sorry y

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2018-11-19 Thread Laszlo Ersek
Jordan wrote: >>> So, is it safe to adjust rbp? Unknown. It may not be if rbp is not >>> used as a frame pointer. Is it safe to *not* adjust rbp and >>> potentially allow the old temp ram stack to be used? Unknown. Andrew wrote: > Looks like OvmfPkg uses SetJump()/LongJump() to change the stack.

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2018-11-19 Thread Andrew Fish
> On Nov 19, 2018, at 11:16 AM, Jordan Justen wrote: > > On 2018-11-18 17:13:21, Jordan Justen wrote: >> On 2018-11-18 14:37:09, Andrew Fish wrote: >>> >>> On Nov 18, 2018, at 4:07 AM, Liu Yu wrote: sorry your path can't fix this issue. if this path just turn off op

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2018-11-19 Thread Jordan Justen
On 2018-11-18 17:13:21, Jordan Justen wrote: > On 2018-11-18 14:37:09, Andrew Fish wrote: > > > > > > > On Nov 18, 2018, at 4:07 AM, Liu Yu wrote: > > > > > > sorry your path can't fix this issue. if this path just turn off > > > optimization option within sec.c not global project. > > > >

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2018-11-18 Thread Jordan Justen
On 2018-11-18 14:37:09, Andrew Fish wrote: > > > > On Nov 18, 2018, at 4:07 AM, Liu Yu wrote: > > > > sorry your path can't fix this issue. if this path just turn off > > optimization option within sec.c not global project. > > > > I have tested different version GCC such as (GCC4,8, GCC5.

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2018-11-18 Thread Andrew Fish
> On Nov 18, 2018, at 4:07 AM, Liu Yu wrote: > > sorry your path can't fix this issue. if this path just turn off > optimization option within sec.c not global project. > > I have tested different version GCC such as (GCC4,8, GCC5.x, GCC7.x) > and all of them can duplicate this issue (U

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2018-11-18 Thread Liu Yu
sorry your  path can't fix this issue.   if this path just turn off optimization option within sec.c not global project. I have tested different version GCC such as (GCC4,8, GCC5.x, GCC7.x)  and all of them can duplicate this issue  (Ubuntu 16.04, 16.10,18.04 ) I have traced this issue on my ha

Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2018-11-18 Thread Jordan Justen
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 `tes

[edk2] EmulatorPkg Unix Host Segmentation fault.

2018-11-17 Thread Liu Yu
OS: Ubuntu Toolchain:GCC48 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