Re: [edk2] Building EmulatorPkg and EDK2 project issue.

2018-11-03 Thread Prem Kumar
Hi Andrew/Hot,
 Currently I'm trying to build EmulatorPkg using Visual Studio 2015.  I'm
able to build EmulatorPkg successfully but failing to launch.

After going through bugzilla I've found below bug-Id,
*Bug 1138*  -
[EmulatorPkg]
Win host cannot be built with VS2015

So Is it like EmulatorPkg works on VS2017 and not using VS2015?

Kindly provide your comments.

--
Regards,
Prem.


On Sun, Nov 4, 2018 at 7:34 AM Prem Kumar  wrote:

> Yes, I'm using latest EDKII master cod. In latest EDK code I could see
> EmulatorPkg\Win folder not in previous/UDK2018 label.
>
> --
> Thanks,
> Prem.
>
> On Sun, Nov 4, 2018 at 5:15 AM Tian, Hot  wrote:
>
>> Are you using the latest EDKII master code? Windows support is added
>> recently by https://bugzilla.tianocore.org/show_bug.cgi?id=1112. + Ruiyu
>> Ni.
>>
>> Thanks,
>> Hot
>>
>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>> Prem Kumar
>> Sent: Sunday, November 04, 2018 4:55
>> To: af...@apple.com
>> Cc: edk2-devel@lists.01.org; Gao, Liming 
>> Subject: Re: [edk2] Building EmulatorPkg and EDK2 project issue.
>>
>> Hi Andrew,
>>  Thanks for your explanation.
>>
>> After building for x64 I could see below error.
>>
>>
>> C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorX64\DEBUG_VS2015x86\X64>WinHost.exe
>>
>> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
>>   BootMode 0x00
>>   OS Emulator passing in 128 KB of temp RAM at 0x65e7 to SEC ERROR :
>> Can not open Firmware Device File ../FV/FV_RECOVERY.fd (0xE).
>> Exiting.
>>
>>
>> *I've searched for FV_RECOVERY.fd in entire project and found no such
>> file generated after built.*
>>
>> --
>> Thanks & Regards,
>> Prem.
>>
>>
>>
>> On Sun, Nov 4, 2018 at 1:56 AM Andrew Fish  wrote:
>>
>> > Prem,
>> >
>> > I've not run the emulator on Windows in a very very long time. But
>> > lets take a look at your error message.
>> >
>> > /Volumes/Case/UDK2018(vUDK2018)>git grep "Could not allocate
>> > PeiServicesTablePage"
>> > EmulatorPkg/Unix/Host/Host.c:508:  printf ("MapFd0(): *Could not
>> > allocate PeiServicesTablePage* @ %lx\n", (long unsigned
>> > int)EmuMagicPage);
>> >
>> > That seems to point to PcdPeiServicesTablePage
>> > /Volumes/Case/UDK2018(vUDK2018)>git grep PcdPeiServicesTablePage --
>> > *.dec
>> > EmulatorPkg/EmulatorPkg.dec:73:  gEmulatorPkgTokenSpaceGuid.
>> > *PcdPeiServicesTablePage*|0x100300|UINT64|0x101b
>> >
>> > Which has a default value of 0x100300. But since you built for
>> > IA32 it gets truncated to 0x0300
>> >
>> > Do you need 32-bit IA32? Can do a 64-bit build and use X64. Something
>> like:
>> >
>> > build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
>> > X64 -m EmulatorPkg/Win/Host/WinHost.inf
>> >
>> > It looks like that is hard coded address that needs to get allocated
>> > in the emulator, and in your case that allocation is failing.
>> >
>> > Thanks,
>> >
>> > Andrew Fish
>> >
>> > PS I'm not sure the printf is correct:   printf ("MapFd0(): Could
>> not
>> > allocate PeiServicesTablePage @ %lx\n", (long unsigned
>> > int)EmuMagicPage); Given the width of long is different on different
>> > platforms. UINT64 uses long long to make sure things are 64-bits. Not
>> > to mention EmuMagicPage is a pointer, not an long unsigned int.
>> >
>> >
>> > On Nov 3, 2018, at 12:26 PM, Prem Kumar  wrote:
>> >
>> > Hi Andrew,
>> >  Thanks for your reply.
>> >
>> > Below is the error when trying to launch Emulator after successful
>> > build,
>> >
>> > *1.Launching Emulator using below command:*
>> > C:\UEFIWorkspace\edk2-master_2018_Latest>cd
>> > Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
>> >
>> > EDK II WIN Host Emulation Environment from
>> http://www.tianocore.org/edk2/
>> >   BootMode 0x00
>> >   OS Emulator passing in 128 KB of temp RAM at 0x0440 to SEC ERROR
>> > : Could not allocate PeiServicesTablePage @ 0300
>> >
>> > *2. Launching WinHose.exe directly:*
>> >
>> > C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorIA32\DEBUG_VS20
>> > 15x86\IA32>WinHost.exe
>> >
>> > EDK II WIN Host Emulation Environment from
>> http://www.tianocore.org/edk2/
>> >   BootMode 0x00
>> >   OS Emulator passing in 128 KB of temp RAM at 0x04ab to SEC ERROR
>> > : Could not allocate PeiServicesTablePage @ 0300
>> >
>> >
>> >
>> > --
>> > Regards,
>> > Prem.
>> >
>> >
>> >
>> ___
>> 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


Re: [edk2] Building EmulatorPkg and EDK2 project issue.

2018-11-03 Thread Prem Kumar
Yes, I'm using latest EDKII master cod. In latest EDK code I could see
EmulatorPkg\Win folder not in previous/UDK2018 label.

--
Thanks,
Prem.

On Sun, Nov 4, 2018 at 5:15 AM Tian, Hot  wrote:

> Are you using the latest EDKII master code? Windows support is added
> recently by https://bugzilla.tianocore.org/show_bug.cgi?id=1112. + Ruiyu
> Ni.
>
> Thanks,
> Hot
>
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Prem Kumar
> Sent: Sunday, November 04, 2018 4:55
> To: af...@apple.com
> Cc: edk2-devel@lists.01.org; Gao, Liming 
> Subject: Re: [edk2] Building EmulatorPkg and EDK2 project issue.
>
> Hi Andrew,
>  Thanks for your explanation.
>
> After building for x64 I could see below error.
>
>
> C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorX64\DEBUG_VS2015x86\X64>WinHost.exe
>
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
>   BootMode 0x00
>   OS Emulator passing in 128 KB of temp RAM at 0x65e7 to SEC ERROR :
> Can not open Firmware Device File ../FV/FV_RECOVERY.fd (0xE).
> Exiting.
>
>
> *I've searched for FV_RECOVERY.fd in entire project and found no such file
> generated after built.*
>
> --
> Thanks & Regards,
> Prem.
>
>
>
> On Sun, Nov 4, 2018 at 1:56 AM Andrew Fish  wrote:
>
> > Prem,
> >
> > I've not run the emulator on Windows in a very very long time. But
> > lets take a look at your error message.
> >
> > /Volumes/Case/UDK2018(vUDK2018)>git grep "Could not allocate
> > PeiServicesTablePage"
> > EmulatorPkg/Unix/Host/Host.c:508:  printf ("MapFd0(): *Could not
> > allocate PeiServicesTablePage* @ %lx\n", (long unsigned
> > int)EmuMagicPage);
> >
> > That seems to point to PcdPeiServicesTablePage
> > /Volumes/Case/UDK2018(vUDK2018)>git grep PcdPeiServicesTablePage --
> > *.dec
> > EmulatorPkg/EmulatorPkg.dec:73:  gEmulatorPkgTokenSpaceGuid.
> > *PcdPeiServicesTablePage*|0x100300|UINT64|0x101b
> >
> > Which has a default value of 0x100300. But since you built for
> > IA32 it gets truncated to 0x0300
> >
> > Do you need 32-bit IA32? Can do a 64-bit build and use X64. Something
> like:
> >
> > build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
> > X64 -m EmulatorPkg/Win/Host/WinHost.inf
> >
> > It looks like that is hard coded address that needs to get allocated
> > in the emulator, and in your case that allocation is failing.
> >
> > Thanks,
> >
> > Andrew Fish
> >
> > PS I'm not sure the printf is correct:   printf ("MapFd0(): Could not
> > allocate PeiServicesTablePage @ %lx\n", (long unsigned
> > int)EmuMagicPage); Given the width of long is different on different
> > platforms. UINT64 uses long long to make sure things are 64-bits. Not
> > to mention EmuMagicPage is a pointer, not an long unsigned int.
> >
> >
> > On Nov 3, 2018, at 12:26 PM, Prem Kumar  wrote:
> >
> > Hi Andrew,
> >  Thanks for your reply.
> >
> > Below is the error when trying to launch Emulator after successful
> > build,
> >
> > *1.Launching Emulator using below command:*
> > C:\UEFIWorkspace\edk2-master_2018_Latest>cd
> > Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
> >
> > EDK II WIN Host Emulation Environment from
> http://www.tianocore.org/edk2/
> >   BootMode 0x00
> >   OS Emulator passing in 128 KB of temp RAM at 0x0440 to SEC ERROR
> > : Could not allocate PeiServicesTablePage @ 0300
> >
> > *2. Launching WinHose.exe directly:*
> >
> > C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorIA32\DEBUG_VS20
> > 15x86\IA32>WinHost.exe
> >
> > EDK II WIN Host Emulation Environment from
> http://www.tianocore.org/edk2/
> >   BootMode 0x00
> >   OS Emulator passing in 128 KB of temp RAM at 0x04ab to SEC ERROR
> > : Could not allocate PeiServicesTablePage @ 0300
> >
> >
> >
> > --
> > Regards,
> > Prem.
> >
> >
> >
> ___
> 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


Re: [edk2] Building EmulatorPkg and EDK2 project issue.

2018-11-03 Thread Tian, Hot
Are you using the latest EDKII master code? Windows support is added recently 
by https://bugzilla.tianocore.org/show_bug.cgi?id=1112. + Ruiyu Ni.

Thanks,
Hot

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Prem 
Kumar
Sent: Sunday, November 04, 2018 4:55
To: af...@apple.com
Cc: edk2-devel@lists.01.org; Gao, Liming 
Subject: Re: [edk2] Building EmulatorPkg and EDK2 project issue.

Hi Andrew,
 Thanks for your explanation.

After building for x64 I could see below error.

C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorX64\DEBUG_VS2015x86\X64>WinHost.exe

EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
  BootMode 0x00
  OS Emulator passing in 128 KB of temp RAM at 0x65e7 to SEC ERROR : Can 
not open Firmware Device File ../FV/FV_RECOVERY.fd (0xE).
Exiting.


*I've searched for FV_RECOVERY.fd in entire project and found no such file 
generated after built.*

--
Thanks & Regards,
Prem.



On Sun, Nov 4, 2018 at 1:56 AM Andrew Fish  wrote:

> Prem,
>
> I've not run the emulator on Windows in a very very long time. But 
> lets take a look at your error message.
>
> /Volumes/Case/UDK2018(vUDK2018)>git grep "Could not allocate 
> PeiServicesTablePage"
> EmulatorPkg/Unix/Host/Host.c:508:  printf ("MapFd0(): *Could not
> allocate PeiServicesTablePage* @ %lx\n", (long unsigned 
> int)EmuMagicPage);
>
> That seems to point to PcdPeiServicesTablePage 
> /Volumes/Case/UDK2018(vUDK2018)>git grep PcdPeiServicesTablePage -- 
> *.dec
> EmulatorPkg/EmulatorPkg.dec:73:  gEmulatorPkgTokenSpaceGuid.
> *PcdPeiServicesTablePage*|0x100300|UINT64|0x101b
>
> Which has a default value of 0x100300. But since you built for 
> IA32 it gets truncated to 0x0300
>
> Do you need 32-bit IA32? Can do a 64-bit build and use X64. Something like:
>
> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
> X64 -m EmulatorPkg/Win/Host/WinHost.inf
>
> It looks like that is hard coded address that needs to get allocated 
> in the emulator, and in your case that allocation is failing.
>
> Thanks,
>
> Andrew Fish
>
> PS I'm not sure the printf is correct:   printf ("MapFd0(): Could not
> allocate PeiServicesTablePage @ %lx\n", (long unsigned 
> int)EmuMagicPage); Given the width of long is different on different 
> platforms. UINT64 uses long long to make sure things are 64-bits. Not 
> to mention EmuMagicPage is a pointer, not an long unsigned int.
>
>
> On Nov 3, 2018, at 12:26 PM, Prem Kumar  wrote:
>
> Hi Andrew,
>  Thanks for your reply.
>
> Below is the error when trying to launch Emulator after successful 
> build,
>
> *1.Launching Emulator using below command:* 
> C:\UEFIWorkspace\edk2-master_2018_Latest>cd
> Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
>
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
>   BootMode 0x00
>   OS Emulator passing in 128 KB of temp RAM at 0x0440 to SEC ERROR 
> : Could not allocate PeiServicesTablePage @ 0300
>
> *2. Launching WinHose.exe directly:*
>
> C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorIA32\DEBUG_VS20
> 15x86\IA32>WinHost.exe
>
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
>   BootMode 0x00
>   OS Emulator passing in 128 KB of temp RAM at 0x04ab to SEC ERROR 
> : Could not allocate PeiServicesTablePage @ 0300
>
>
>
> --
> Regards,
> Prem.
>
>
>
___
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


Re: [edk2] Building EmulatorPkg and EDK2 project issue.

2018-11-03 Thread Prem Kumar
Hi Andrew,
 Thanks for your explanation.

After building for x64 I could see below error.

C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorX64\DEBUG_VS2015x86\X64>WinHost.exe

EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
  BootMode 0x00
  OS Emulator passing in 128 KB of temp RAM at 0x65e7 to SEC
ERROR : Can not open Firmware Device File ../FV/FV_RECOVERY.fd (0xE).
Exiting.


*I've searched for FV_RECOVERY.fd in entire project and found no such file
generated after built.*

--
Thanks & Regards,
Prem.



On Sun, Nov 4, 2018 at 1:56 AM Andrew Fish  wrote:

> Prem,
>
> I've not run the emulator on Windows in a very very long time. But lets
> take a look at your error message.
>
> /Volumes/Case/UDK2018(vUDK2018)>git grep "Could not allocate
> PeiServicesTablePage"
> EmulatorPkg/Unix/Host/Host.c:508:  printf ("MapFd0(): *Could not
> allocate PeiServicesTablePage* @ %lx\n", (long unsigned int)EmuMagicPage);
>
> That seems to point to PcdPeiServicesTablePage
> /Volumes/Case/UDK2018(vUDK2018)>git grep PcdPeiServicesTablePage -- *.dec
> EmulatorPkg/EmulatorPkg.dec:73:  gEmulatorPkgTokenSpaceGuid.
> *PcdPeiServicesTablePage*|0x100300|UINT64|0x101b
>
> Which has a default value of 0x100300. But since you built for IA32
> it gets truncated to 0x0300
>
> Do you need 32-bit IA32? Can do a 64-bit build and use X64. Something like:
>
> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
> X64 -m EmulatorPkg/Win/Host/WinHost.inf
>
> It looks like that is hard coded address that needs to get allocated in
> the emulator, and in your case that allocation is failing.
>
> Thanks,
>
> Andrew Fish
>
> PS I'm not sure the printf is correct:   printf ("MapFd0(): Could not
> allocate PeiServicesTablePage @ %lx\n", (long unsigned int)EmuMagicPage);
> Given the width of long is different on different platforms. UINT64 uses
> long long to make sure things are 64-bits. Not to mention EmuMagicPage is a
> pointer, not an long unsigned int.
>
>
> On Nov 3, 2018, at 12:26 PM, Prem Kumar  wrote:
>
> Hi Andrew,
>  Thanks for your reply.
>
> Below is the error when trying to launch Emulator after successful build,
>
> *1.Launching Emulator using below command:*
> C:\UEFIWorkspace\edk2-master_2018_Latest>cd
> Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
>
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
>   BootMode 0x00
>   OS Emulator passing in 128 KB of temp RAM at 0x0440 to SEC
> ERROR : Could not allocate PeiServicesTablePage @ 0300
>
> *2. Launching WinHose.exe directly:*
>
> C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorIA32\DEBUG_VS2015x86\IA32>WinHost.exe
>
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
>   BootMode 0x00
>   OS Emulator passing in 128 KB of temp RAM at 0x04ab to SEC
> ERROR : Could not allocate PeiServicesTablePage @ 0300
>
>
>
> --
> Regards,
> Prem.
>
>
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Building EmulatorPkg and EDK2 project issue.

2018-11-03 Thread Andrew Fish
Prem,

I've not run the emulator on Windows in a very very long time. But lets take a 
look at your error message. 

/Volumes/Case/UDK2018(vUDK2018)>git grep "Could not allocate 
PeiServicesTablePage"
EmulatorPkg/Unix/Host/Host.c:508:  printf ("MapFd0(): Could not allocate 
PeiServicesTablePage @ %lx\n", (long unsigned int)EmuMagicPage);

That seems to point to PcdPeiServicesTablePage
/Volumes/Case/UDK2018(vUDK2018)>git grep PcdPeiServicesTablePage -- *.dec
EmulatorPkg/EmulatorPkg.dec:73:  
gEmulatorPkgTokenSpaceGuid.PcdPeiServicesTablePage|0x100300|UINT64|0x101b

Which has a default value of 0x100300. But since you built for IA32 it gets 
truncated to 0x0300

Do you need 32-bit IA32? Can do a 64-bit build and use X64. Something like:

build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a X64 -m 
EmulatorPkg/Win/Host/WinHost.inf

It looks like that is hard coded address that needs to get allocated in the 
emulator, and in your case that allocation is failing. 

Thanks,

Andrew Fish

PS I'm not sure the printf is correct:   printf ("MapFd0(): Could not 
allocate PeiServicesTablePage @ %lx\n", (long unsigned int)EmuMagicPage);
Given the width of long is different on different platforms. UINT64 uses long 
long to make sure things are 64-bits. Not to mention EmuMagicPage is a pointer, 
not an long unsigned int.


> On Nov 3, 2018, at 12:26 PM, Prem Kumar  wrote:
> 
> Hi Andrew,
>  Thanks for your reply.
> 
> Below is the error when trying to launch Emulator after successful build,
> 
> 1.Launching Emulator using below command:
> C:\UEFIWorkspace\edk2-master_2018_Latest>cd 
> Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
> 
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/ 
> 
>   BootMode 0x00
>   OS Emulator passing in 128 KB of temp RAM at 0x0440 to SEC
> ERROR : Could not allocate PeiServicesTablePage @ 0300
> 
> 2. Launching WinHose.exe directly:
> C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorIA32\DEBUG_VS2015x86\IA32>WinHost.exe
> 
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/ 
> 
>   BootMode 0x00
>   OS Emulator passing in 128 KB of temp RAM at 0x04ab to SEC
> ERROR : Could not allocate PeiServicesTablePage @ 0300
> 
> 
> 
> --
> Regards,
> Prem.

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


Re: [edk2] Building EmulatorPkg and EDK2 project issue.

2018-11-03 Thread Prem Kumar
Hi Andrew,
 Thanks for your reply.

Below is the error when trying to launch Emulator after successful build,

*1.Launching Emulator using below command:*
C:\UEFIWorkspace\edk2-master_2018_Latest>cd
Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe

EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
  BootMode 0x00
  OS Emulator passing in 128 KB of temp RAM at 0x0440 to SEC
ERROR : Could not allocate PeiServicesTablePage @ 0300

*2. Launching WinHose.exe directly:*
C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorIA32\DEBUG_VS2015x86\IA32>WinHost.exe

EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
  BootMode 0x00
  OS Emulator passing in 128 KB of temp RAM at 0x04ab to SEC
ERROR : Could not allocate PeiServicesTablePage @ 0300



--
Regards,
Prem.

On Sat, Nov 3, 2018 at 10:41 PM Andrew Fish  wrote:

> Prem,
>
> Looks like the mailing list ate your attachment. What error did you see?
> Can you copy the text into an email?
>
> Thanks,
>
> Andrew Fish
>
> > On Nov 3, 2018, at 1:42 AM, Prem Kumar  wrote:
> >
> > Hi All,
> > Any comments for this to proceed further.
> >
> > --
> > Thanks & Regards,
> > Prem.
> >
> > On Wed, Oct 31, 2018 at 5:48 PM Prem Kumar  wrote:
> >
> >> Hi Liming,
> >> Thanks for quick response and details,
> >>
> >> EmulatorPkg\Win
> >> Above folder was not present in UDK2018. But available in EDK2 master
> >>
> >> When I used below command I'm able to build success,
> >> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
> IA32
> >> -m EmulatorPkg/Win/Host/WinHost.inf
> >>
> >> But when i try to launch I'm facing below error,
> >> [image: image.png]
> >>
> >>
> >>
> >> --
> >> Thanks,
> >> Prem.
> >>
> >> On Wed, Oct 31, 2018 at 5:28 AM Gao, Liming 
> wrote:
> >>
> >>> For emulator, please type below command and see what's happen.
> >>>
> >>> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
> >>> IA32 -m EmulatorPkg/Win/Host/WinHost.inf
> >>>
>  -Original Message-
>  From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
> Of
>  Prem Kumar
>  Sent: Tuesday, October 30, 2018 10:04 PM
>  To: edk2-devel@lists.01.org
>  Subject: [edk2] Building EmulatorPkg and EDK2 project issue.
> 
>  Hi All,
>  Below are the issue i'm currently facing,
> 
>  -  EmulatorPkg:
> 
>  o   Building of EmulatorPkg using below command
> 
>  §  build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD
> -a
>  IA32
> 
>  o   But when I try to launch Emulator using below command, it failed.
> I
>  searched for WinHost.exe file, and it is not present in Build folder
> >>> also.
> 
>  §  cd Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
> 
>  -  Building EDK2 project for ARM using LLVM
> 
>  o   What are the steps/changes need to do in-order to build EDK2
> project
>  for ARM+LLVM configuration.
> 
> 
>  Kindly provide any comments. Any pointer is helpful.
> 
>  *Note:*
> 
>  Trying to build in Windows environment. Build and launch of Nt32Pkg is
>  successful.
> 
>  --
>  Regards,
>  Prem.
>  ___
>  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
>
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Building EmulatorPkg and EDK2 project issue.

2018-11-03 Thread Andrew Fish
Prem,

Looks like the mailing list ate your attachment. What error did you see? Can 
you copy the text into an email?

Thanks,

Andrew Fish

> On Nov 3, 2018, at 1:42 AM, Prem Kumar  wrote:
> 
> Hi All,
> Any comments for this to proceed further.
> 
> --
> Thanks & Regards,
> Prem.
> 
> On Wed, Oct 31, 2018 at 5:48 PM Prem Kumar  wrote:
> 
>> Hi Liming,
>> Thanks for quick response and details,
>> 
>> EmulatorPkg\Win
>> Above folder was not present in UDK2018. But available in EDK2 master
>> 
>> When I used below command I'm able to build success,
>> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a IA32
>> -m EmulatorPkg/Win/Host/WinHost.inf
>> 
>> But when i try to launch I'm facing below error,
>> [image: image.png]
>> 
>> 
>> 
>> --
>> Thanks,
>> Prem.
>> 
>> On Wed, Oct 31, 2018 at 5:28 AM Gao, Liming  wrote:
>> 
>>> For emulator, please type below command and see what's happen.
>>> 
>>> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
>>> IA32 -m EmulatorPkg/Win/Host/WinHost.inf
>>> 
 -Original Message-
 From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
 Prem Kumar
 Sent: Tuesday, October 30, 2018 10:04 PM
 To: edk2-devel@lists.01.org
 Subject: [edk2] Building EmulatorPkg and EDK2 project issue.
 
 Hi All,
 Below are the issue i'm currently facing,
 
 -  EmulatorPkg:
 
 o   Building of EmulatorPkg using below command
 
 §  build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
 IA32
 
 o   But when I try to launch Emulator using below command, it failed. I
 searched for WinHost.exe file, and it is not present in Build folder
>>> also.
 
 §  cd Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
 
 -  Building EDK2 project for ARM using LLVM
 
 o   What are the steps/changes need to do in-order to build EDK2 project
 for ARM+LLVM configuration.
 
 
 Kindly provide any comments. Any pointer is helpful.
 
 *Note:*
 
 Trying to build in Windows environment. Build and launch of Nt32Pkg is
 successful.
 
 --
 Regards,
 Prem.
 ___
 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

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


Re: [edk2] Building EmulatorPkg and EDK2 project issue.

2018-11-03 Thread Prem Kumar
Hi All,
 Any comments for this to proceed further.

--
Thanks & Regards,
Prem.

On Wed, Oct 31, 2018 at 5:48 PM Prem Kumar  wrote:

> Hi Liming,
>  Thanks for quick response and details,
>
> EmulatorPkg\Win
> Above folder was not present in UDK2018. But available in EDK2 master
>
> When I used below command I'm able to build success,
> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a IA32
> -m EmulatorPkg/Win/Host/WinHost.inf
>
> But when i try to launch I'm facing below error,
> [image: image.png]
>
>
>
> --
> Thanks,
> Prem.
>
> On Wed, Oct 31, 2018 at 5:28 AM Gao, Liming  wrote:
>
>> For emulator, please type below command and see what's happen.
>>
>> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
>> IA32 -m EmulatorPkg/Win/Host/WinHost.inf
>>
>> >-Original Message-
>> >From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>> >Prem Kumar
>> >Sent: Tuesday, October 30, 2018 10:04 PM
>> >To: edk2-devel@lists.01.org
>> >Subject: [edk2] Building EmulatorPkg and EDK2 project issue.
>> >
>> >Hi All,
>> > Below are the issue i'm currently facing,
>> >
>> >-  EmulatorPkg:
>> >
>> >o   Building of EmulatorPkg using below command
>> >
>> >§  build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
>> >IA32
>> >
>> >o   But when I try to launch Emulator using below command, it failed. I
>> >searched for WinHost.exe file, and it is not present in Build folder
>> also.
>> >
>> >§  cd Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
>> >
>> >-  Building EDK2 project for ARM using LLVM
>> >
>> >o   What are the steps/changes need to do in-order to build EDK2 project
>> >for ARM+LLVM configuration.
>> >
>> >
>> >Kindly provide any comments. Any pointer is helpful.
>> >
>> >*Note:*
>> >
>> >  Trying to build in Windows environment. Build and launch of Nt32Pkg is
>> >successful.
>> >
>> >--
>> >Regards,
>> >Prem.
>> >___
>> >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


[edk2] How to build EDK2 project for ARM using LLVM tool chain

2018-11-03 Thread Prem Kumar
Hi All,
 Kindly provide your comments to build EDK2 project for ARM AARCH64/ARM
using LLVM tools chain under Windows environment.

I've below tools,
 - Visual Studio 2015
 - LLVM 4.0


Any pointer is helpful to proceed further.


Note:
 I'm able to build EDK2 project(Nt32Pkg) using Visual studio under Windows
environment.


--
Thanks,
Prem.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] Maintainers.txt: Change package maintainer of UefiCpuPkg

2018-11-03 Thread Dong, Eric
Reviewed-by: Eric Dong 

> -Original Message-
> From: Ni, Ruiyu
> Sent: Friday, November 2, 2018 5:22 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric 
> Subject: [PATCH] Maintainers.txt: Change package maintainer of UefiCpuPkg
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni 
> Cc: Eric Dong 
> ---
>  Maintainers.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt index 937aedc664..29d1e10c73
> 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -259,6 +259,7 @@ M: Jaben Carsey   UefiCpuPkg
>  W: https://github.com/tianocore/tianocore.github.io/wiki/UefiCpuPkg
>  M: Eric Dong 
> +M: Ruiyu Ni 
>  R: Laszlo Ersek 
> 
>  UnixPkg
> --
> 2.16.1.windows.1

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


[edk2] [PATCH 0/2] fix ineffective guard page issue

2018-11-03 Thread Jian J Wang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1295

Jian J Wang (2):
  MdeModulePkg/Core: fill logic hole in
MemoryProtectionCpuArchProtocolNotify
  MdeModulePkg/Core: fix ineffective guard page issue

 MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c | 44 +--
 1 file changed, 21 insertions(+), 23 deletions(-)

-- 
2.16.2.windows.1

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


[edk2] [PATCH 2/2] MdeModulePkg/Core: fix ineffective guard page issue

2018-11-03 Thread Jian J Wang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1295

This issue originates from following patch which allows to enable
paging if PcdImageProtectionPolicy and PcdDxeNxMemoryProtectionPolicy
(in addition to PcdSetNxForStack) are set to enable related features.

  5267926134d17e86672b84fd57b438f05ffa68e1

Due to above change, PcdImageProtectionPolicy will be set to 0 by
default in many platforms, which, in turn, cause following code in
MdeModulePkg\Core\Dxe\Misc\MemoryProtection.c fail the creation of
notify event of CpuArchProtocol.

1138:  if (mImageProtectionPolicy != 0 ||
   PcdGet64 (PcdDxeNxMemoryProtectionPolicy) != 0) {
1139:  Status = CoreCreateEvent (
...
1142: MemoryProtectionCpuArchProtocolNotify,
...
1145: );

Then following call flow won't be done and Guard pages will not be
set as not-present in SetAllGuardPages() eventually.

   MemoryProtectionCpuArchProtocolNotify()
=> HeapGuardCpuArchProtocolNotify()
=> SetAllGuardPages()

The solution is removing the if(...) statement so that the notify
event will always be created and handler be registered. This won't
cause unnecessary code execution because, in the notify event handler,
the related PCDs like

PcdImageProtectionPolicy and
PcdDxeNxMemoryProtectionPolicy

will be checked again to do its job.

Cc: Star Zeng 
Cc: Jiewen Yao 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang 
---
 MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c 
b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
index 30e5c5153c..30798b05b9 100644
--- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
+++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
@@ -1135,7 +1135,6 @@ CoreInitializeMemoryProtection (
   ASSERT (GetPermissionAttributeForMemoryType (EfiBootServicesData) ==
   GetPermissionAttributeForMemoryType (EfiConventionalMemory));
 
-  if (mImageProtectionPolicy != 0 || PcdGet64 (PcdDxeNxMemoryProtectionPolicy) 
!= 0) {
   Status = CoreCreateEvent (
  EVT_NOTIFY_SIGNAL,
  TPL_CALLBACK,
@@ -1154,7 +1153,6 @@ CoreInitializeMemoryProtection (
  
  );
   ASSERT_EFI_ERROR(Status);
-  }
 
   //
   // Register a callback to disable NULL pointer detection at EndOfDxe
-- 
2.16.2.windows.1

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


[edk2] [PATCH 1/2] MdeModulePkg/Core: fill logic hole in MemoryProtectionCpuArchProtocolNotify

2018-11-03 Thread Jian J Wang
At the end of of MemoryProtectionCpuArchProtocolNotify there's cleanup
code to free resource. But at line 978, 994, 1005 the function returns
directly. This patch use "goto" to replace "return" to make sure the
resource is freed before exit.

1029:  CoreCloseEvent (Event);
1030:  return;

Cc: Star Zeng 
Cc: Jiewen Yao 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang 
---
 MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c | 42 +--
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c 
b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
index 6298b67db1..30e5c5153c 100644
--- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
+++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
@@ -975,7 +975,7 @@ MemoryProtectionCpuArchProtocolNotify (
   DEBUG ((DEBUG_INFO, "MemoryProtectionCpuArchProtocolNotify:\n"));
   Status = CoreLocateProtocol (, NULL, (VOID **));
   if (EFI_ERROR (Status)) {
-return;
+goto Done;
   }
 
   //
@@ -991,7 +991,7 @@ MemoryProtectionCpuArchProtocolNotify (
   HeapGuardCpuArchProtocolNotify ();
 
   if (mImageProtectionPolicy == 0) {
-return;
+goto Done;
   }
 
   Status = gBS->LocateHandleBuffer (
@@ -1002,7 +1002,7 @@ MemoryProtectionCpuArchProtocolNotify (
   
   );
   if (EFI_ERROR (Status) && (NoHandles == 0)) {
-return ;
+goto Done;
   }
 
   for (Index = 0; Index < NoHandles; Index++) {
@@ -1026,8 +1026,8 @@ MemoryProtectionCpuArchProtocolNotify (
 ProtectUefiImage (LoadedImage, LoadedImageDevicePath);
   }
 
+Done:
   CoreCloseEvent (Event);
-  return;
 }
 
 /**
@@ -1136,24 +1136,24 @@ CoreInitializeMemoryProtection (
   GetPermissionAttributeForMemoryType (EfiConventionalMemory));
 
   if (mImageProtectionPolicy != 0 || PcdGet64 (PcdDxeNxMemoryProtectionPolicy) 
!= 0) {
-Status = CoreCreateEvent (
-   EVT_NOTIFY_SIGNAL,
-   TPL_CALLBACK,
-   MemoryProtectionCpuArchProtocolNotify,
-   NULL,
-   
-   );
-ASSERT_EFI_ERROR(Status);
+  Status = CoreCreateEvent (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ MemoryProtectionCpuArchProtocolNotify,
+ NULL,
+ 
+ );
+  ASSERT_EFI_ERROR(Status);
 
-//
-// Register for protocol notifactions on this event
-//
-Status = CoreRegisterProtocolNotify (
-   ,
-   Event,
-   
-   );
-ASSERT_EFI_ERROR(Status);
+  //
+  // Register for protocol notifactions on this event
+  //
+  Status = CoreRegisterProtocolNotify (
+ ,
+ Event,
+ 
+ );
+  ASSERT_EFI_ERROR(Status);
   }
 
   //
-- 
2.16.2.windows.1

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