Re: [edk2] [PATCH] ShellBinPkg: Arm/AArch64 Shell binary update.

2015-08-19 Thread Ard Biesheuvel
On 19 August 2015 at 19:03, Carsey, Jaben  wrote:
> Reviewed-by: Jaben Carsey 
>

Thanks

Committed as SVN r18243

>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>> Leif Lindholm
>> Sent: Wednesday, August 19, 2015 8:53 AM
>> To: Ard Biesheuvel 
>> Cc: edk2-devel@lists.01.org; ryan.har...@linaro.org
>> Subject: Re: [edk2] [PATCH] ShellBinPkg: Arm/AArch64 Shell binary update.
>> Importance: High
>>
>> On Wed, Aug 19, 2015 at 01:46:42PM +0200, Ard Biesheuvel wrote:
>> > The binaries of ShellBinPkg are generated with ShellPkg project 18222.
>> >
>> > Contributed-under: TianoCore Contribution Agreement 1.0
>> > Signed-off-by: Ard Biesheuvel 
>> > ---
>> >
>> > These are built with the tiny code model, note the code size reduction
>> > for AARCH64.
>>
>> Hmm...
>>
>> I would prefer to not update the binaries with this until the
>> -mcmode=tiny patch for BaseTools goes in, though.
>>
>> > Branch:
>> > https://git.linaro.org/people/ard.biesheuvel/uefi-
>> next.git/shortlog/refs/heads/binshell
>> >
>> >  ShellBinPkg/MinUefiShell/AArch64/Shell.efi | Bin 408416 -> 387808 bytes
>> >  ShellBinPkg/MinUefiShell/Arm/Shell.efi | Bin 324480 -> 330208 bytes
>> >  ShellBinPkg/UefiShell/AArch64/Shell.efi| Bin 945152 -> 887136 bytes
>> >  ShellBinPkg/UefiShell/Arm/Shell.efi| Bin 757728 -> 769536 bytes
>> >  4 files changed, 0 insertions(+), 0 deletions(-)
>>
>> Very nice!
>>
>> > diff --git a/ShellBinPkg/MinUefiShell/AArch64/Shell.efi
>> b/ShellBinPkg/MinUefiShell/AArch64/Shell.efi
>> > index 7f63d86230e8..d5756e101342 100755
>> > Binary files a/ShellBinPkg/MinUefiShell/AArch64/Shell.efi and
>> b/ShellBinPkg/MinUefiShell/AArch64/Shell.efi differ
>> > diff --git a/ShellBinPkg/MinUefiShell/Arm/Shell.efi
>> b/ShellBinPkg/MinUefiShell/Arm/Shell.efi
>> > index 782489af6960..8a7d7e5b7946 100755
>> > Binary files a/ShellBinPkg/MinUefiShell/Arm/Shell.efi and
>> b/ShellBinPkg/MinUefiShell/Arm/Shell.efi differ
>> > diff --git a/ShellBinPkg/UefiShell/AArch64/Shell.efi
>> b/ShellBinPkg/UefiShell/AArch64/Shell.efi
>> > index 5a44a8ca6189..056da8d2932a 100755
>> > Binary files a/ShellBinPkg/UefiShell/AArch64/Shell.efi and
>> b/ShellBinPkg/UefiShell/AArch64/Shell.efi differ
>> > diff --git a/ShellBinPkg/UefiShell/Arm/Shell.efi
>> b/ShellBinPkg/UefiShell/Arm/Shell.efi
>> > index 5a61df621047..afa91c4d6caf 100755
>> > Binary files a/ShellBinPkg/UefiShell/Arm/Shell.efi and
>> b/ShellBinPkg/UefiShell/Arm/Shell.efi differ
>> > --
>> > 1.9.1
>> >
>> ___
>> 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] [PATCH v2 1/2] ShellPkg: force use of AARCH64 small model when building DEBUG shell

2015-08-19 Thread Ard Biesheuvel
On 19 August 2015 at 19:03, Carsey, Jaben  wrote:
> Reviewed-by: Jaben Carsey 
>

Thanks.

Series committed as SVN r18241 .. r18242

>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>> Ard Biesheuvel
>> Sent: Wednesday, August 19, 2015 2:48 AM
>> To: edk2-devel@lists.01.org; leif.lindh...@linaro.org
>> Cc: Carsey, Jaben ; Qiu, Shumin
>> ; ler...@redhat.com; Ard Biesheuvel
>> 
>> Subject: [edk2] [PATCH v2 1/2] ShellPkg: force use of AARCH64 small model
>> when building DEBUG shell
>> Importance: High
>>
>> The tiny code model used by AARCH64 only supports binaries of up to
>> 1 MB in size. Since the Shell application exceeds that when built in
>> DEBUG mode, make sure we build it using the small code model instead.
>>
>> Cc: Jaben Carsey ,
>> Cc: Shumin Qiu 
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Ard Biesheuvel 
>> Reviewed-by: Leif Lindholm 
>> Tested-by: Leif Lindholm 
>> ---
>>  ShellPkg/Application/Shell/Shell.inf | 6 ++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/ShellPkg/Application/Shell/Shell.inf
>> b/ShellPkg/Application/Shell/Shell.inf
>> index f7039369227c..09aecf717bd7 100644
>> --- a/ShellPkg/Application/Shell/Shell.inf
>> +++ b/ShellPkg/Application/Shell/Shell.inf
>> @@ -108,3 +108,9 @@ [Pcd]
>>gEfiShellPkgTokenSpaceGuid.PcdShellForceConsole ## CONSUMES
>>gEfiShellPkgTokenSpaceGuid.PcdShellSupplier ## CONSUMES
>>
>> +[BuildOptions.AARCH64]
>> +  # The tiny code model used by AARCH64 only supports binaries of up to 1
>> MB in
>> +  # size. Since the Shell application exceeds that when built in DEBUG mode,
>> +  # make sure we build it using the small code model instead.
>> +  GCC:DEBUG_*_*_CC_FLAGS = -mcmodel=small
>> +  GCC:DEBUG_*_*_DLINK_FLAGS = -z common-page-size=0x1000
>> --
>> 1.9.1
>>
>> ___
>> 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] [PATCH v3 1/2] NetworkPkg: Remove the hostname from the http request URL

2015-08-19 Thread Gary Ching-Pang Lin
On Thu, Aug 20, 2015 at 05:04:38AM +, Fu, Siyuan wrote:
> The patch is good, do you have access authority of edk2? Or I can help to 
> commit this patch.
> 
> Reviewed-by: Fu Siyuan 
> 
I don't have the access right. That would be great if you can help me.

Thanks,

Gary Lin

> 
> 
> 
> -Original Message-
> From: Gary Ching-Pang Lin [mailto:g...@suse.com] 
> Sent: Thursday, August 20, 2015 11:49 AM
> To: edk2-devel@lists.01.org
> Cc: Laszlo Ersek; Justen, Jordan L; Fu, Siyuan
> Subject: [PATCH v3 1/2] NetworkPkg: Remove the hostname from the http request 
> URL
> 
> Per RFC7230, the URL must be a absolute-path when making a request directly 
> to the server. Since proxy is not supported now, all requests to the HTTP 
> driver are actually direct requests. This commit removes the scheme and the 
> hostname from the URL in the http request if the URL is an absolute-URI so 
> that the HTTP server can interpret the request properly.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Gary Ching-Pang Lin 
> Reviewed-by: Ye Ting 
> ---
>  NetworkPkg/HttpDxe/HttpImpl.c | 19 ++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c 
> index 545fe42..6684f77 100644
> --- a/NetworkPkg/HttpDxe/HttpImpl.c
> +++ b/NetworkPkg/HttpDxe/HttpImpl.c
> @@ -227,6 +227,7 @@ EfiHttpRequest (
>CHAR16*HostNameStr;
>HTTP_TOKEN_WRAP   *Wrap;
>HTTP_TCP_TOKEN_WRAP   *TcpWrap;
> +  CHAR8 *FileUrl;
>  
>if ((This == NULL) || (Token == NULL)) {
>  return EFI_INVALID_PARAMETER;
> @@ -450,7 +451,23 @@ EfiHttpRequest (
>//
>// Create request message.
>//
> -  RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, Url);
> +  FileUrl = Url;
> +  if (*FileUrl != '/') {
> +//
> +// Convert the absolute-URI to the absolute-path
> +//
> +while (*FileUrl != ':')
> +  FileUrl++;
> +if ((*(FileUrl+1) == '/') && (*(FileUrl+2) == '/')) {
> +  FileUrl += 3;
> +  while (*FileUrl != '/')
> +FileUrl++;
> +} else {
> +  Status = EFI_INVALID_PARAMETER;
> +  goto Error3;
> +}
> +  }
> +  RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, FileUrl);
>if (RequestStr == NULL) {
>  Status = EFI_OUT_OF_RESOURCES;
>  goto Error3;
> --
> 2.1.4
> 
> ___
> 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] [PATCH v3 1/2] NetworkPkg: Remove the hostname from the http request URL

2015-08-19 Thread Fu, Siyuan
The patch is good, do you have access authority of edk2? Or I can help to 
commit this patch.

Reviewed-by: Fu Siyuan 




-Original Message-
From: Gary Ching-Pang Lin [mailto:g...@suse.com] 
Sent: Thursday, August 20, 2015 11:49 AM
To: edk2-devel@lists.01.org
Cc: Laszlo Ersek; Justen, Jordan L; Fu, Siyuan
Subject: [PATCH v3 1/2] NetworkPkg: Remove the hostname from the http request 
URL

Per RFC7230, the URL must be a absolute-path when making a request directly to 
the server. Since proxy is not supported now, all requests to the HTTP driver 
are actually direct requests. This commit removes the scheme and the hostname 
from the URL in the http request if the URL is an absolute-URI so that the HTTP 
server can interpret the request properly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Ching-Pang Lin 
Reviewed-by: Ye Ting 
---
 NetworkPkg/HttpDxe/HttpImpl.c | 19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c 
index 545fe42..6684f77 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -227,6 +227,7 @@ EfiHttpRequest (
   CHAR16*HostNameStr;
   HTTP_TOKEN_WRAP   *Wrap;
   HTTP_TCP_TOKEN_WRAP   *TcpWrap;
+  CHAR8 *FileUrl;
 
   if ((This == NULL) || (Token == NULL)) {
 return EFI_INVALID_PARAMETER;
@@ -450,7 +451,23 @@ EfiHttpRequest (
   //
   // Create request message.
   //
-  RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, Url);
+  FileUrl = Url;
+  if (*FileUrl != '/') {
+//
+// Convert the absolute-URI to the absolute-path
+//
+while (*FileUrl != ':')
+  FileUrl++;
+if ((*(FileUrl+1) == '/') && (*(FileUrl+2) == '/')) {
+  FileUrl += 3;
+  while (*FileUrl != '/')
+FileUrl++;
+} else {
+  Status = EFI_INVALID_PARAMETER;
+  goto Error3;
+}
+  }
+  RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, FileUrl);
   if (RequestStr == NULL) {
 Status = EFI_OUT_OF_RESOURCES;
 goto Error3;
--
2.1.4

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


[edk2] Fwd: [UEFI runtime driver] SCSI - Block driver runtime driver

2015-08-19 Thread Truong Kevin
Hello all,
I'm working a UEFI project.
Our plan for the project is using a UEFI runtime driver to access our
device through SCSI or block driver protocol.
But i don't know about that my UEFI runtime driver will die/ not die when
my machine transfer from Boot process -> OS boot.
I want to keep the driver still exist even machine transfer from boot
process -> OS boot. Just destroy when I remove my device.

Thank and appreciate  for any suggestion.
Kevin
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v3 1/2] NetworkPkg: Remove the hostname from the http request URL

2015-08-19 Thread Gary Ching-Pang Lin
Per RFC7230, the URL must be a absolute-path when making a request
directly to the server. Since proxy is not supported now, all requests
to the HTTP driver are actually direct requests. This commit removes
the scheme and the hostname from the URL in the http request if the URL
is an absolute-URI so that the HTTP server can interpret the request
properly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Ching-Pang Lin 
Reviewed-by: Ye Ting 
---
 NetworkPkg/HttpDxe/HttpImpl.c | 19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index 545fe42..6684f77 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -227,6 +227,7 @@ EfiHttpRequest (
   CHAR16*HostNameStr;
   HTTP_TOKEN_WRAP   *Wrap;
   HTTP_TCP_TOKEN_WRAP   *TcpWrap;
+  CHAR8 *FileUrl;
 
   if ((This == NULL) || (Token == NULL)) {
 return EFI_INVALID_PARAMETER;
@@ -450,7 +451,23 @@ EfiHttpRequest (
   //
   // Create request message.
   //
-  RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, Url);
+  FileUrl = Url;
+  if (*FileUrl != '/') {
+//
+// Convert the absolute-URI to the absolute-path
+//
+while (*FileUrl != ':')
+  FileUrl++;
+if ((*(FileUrl+1) == '/') && (*(FileUrl+2) == '/')) {
+  FileUrl += 3;
+  while (*FileUrl != '/')
+FileUrl++;
+} else {
+  Status = EFI_INVALID_PARAMETER;
+  goto Error3;
+}
+  }
+  RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, FileUrl);
   if (RequestStr == NULL) {
 Status = EFI_OUT_OF_RESOURCES;
 goto Error3;
-- 
2.1.4

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


[edk2] [PATCH v3 0/2] Add HttpBoot support to OvmfPkg

2015-08-19 Thread Gary Ching-Pang Lin
V3: Amended the HTTP driver patch per Siyuan Fu's suggestion.
Also reworded that patch to explain the problem more clearly.

V2: Updated my git config to generate the reviewer-friendly diff.

This patch series fixes a http request bug in HttpDxe and adds the
HttpBoot support to OvmfPkg.

I've tested the HttpBoot implementation with a simple environment:

[QEMU] <---(tap0)---> [HOST]
 Ovmf   DHCP server
HTTP server

With a proper config for the dhcp and http server in the host, the firmware
successfully fetched the remote EFI file and executed it. It's recommended
to update gnu-efi to the latest version to detect the IPv4 device path
correctly.

Known issues:
* DHCPv6 support is not implemented in HttpBootDxe at this moment.
* The unexpected TCP disconnection isn't handled in HttpDxe so the GET request
  may fail while fetching the EFI image from some featureless http daemon such
  as thttpd.

Gary Ching-Pang Lin (2):
  NetworkPkg: Remove the hostname from the http request URL
  OvmfPkg: Add HttpBoot support

 NetworkPkg/HttpDxe/HttpImpl.c | 19 ++-
 OvmfPkg/OvmfPkgIa32.dsc   | 10 ++
 OvmfPkg/OvmfPkgIa32.fdf   |  5 +
 OvmfPkg/OvmfPkgIa32X64.dsc| 10 ++
 OvmfPkg/OvmfPkgIa32X64.fdf|  5 +
 OvmfPkg/OvmfPkgX64.dsc| 10 ++
 OvmfPkg/OvmfPkgX64.fdf|  5 +
 7 files changed, 63 insertions(+), 1 deletion(-)

-- 
2.1.4

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


[edk2] [PATCH v3 2/2] OvmfPkg: Add HttpBoot support

2015-08-19 Thread Gary Ching-Pang Lin
This commit introdues a new build option to OvmfPkg: HTTP_BOOT_ENABLE.
When HttpBoot is enabled, a new Network boot option will show in the
boot manager menu with the device path like this:

PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/IPv4(0.0.0.0)/Uri()

It works like the PXE one but fetches the NBP from the given http
url instead of the tftp service.

A simple testing environment can be set up with the QEMU tap network
and dnsmasq + lighttpd.

Here is the example of the dnsmasq config:

  interface=
  dhcp-range=192.168.111.100,192.168.111.120,12h
  dhcp-option=60,"HTTPClient"
  dhcp-boot="http:///"

It's similar to the PXE server settings except the tftp function is
disabled, the option 60 must be "HTTPClient", and the boot uri is a
http url.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Ching-Pang Lin 
Reviewed-by: Fu Siyuan 
---
 OvmfPkg/OvmfPkgIa32.dsc| 10 ++
 OvmfPkg/OvmfPkgIa32.fdf|  5 +
 OvmfPkg/OvmfPkgIa32X64.dsc | 10 ++
 OvmfPkg/OvmfPkgIa32X64.fdf |  5 +
 OvmfPkg/OvmfPkgX64.dsc | 10 ++
 OvmfPkg/OvmfPkgX64.fdf |  5 +
 6 files changed, 45 insertions(+)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 4ab618d..9a6de15 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -35,6 +35,7 @@ [Defines]
   #
   DEFINE SECURE_BOOT_ENABLE  = FALSE
   DEFINE NETWORK_IP6_ENABLE  = FALSE
+  DEFINE HTTP_BOOT_ENABLE= FALSE
 
 [BuildOptions]
   GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG
@@ -129,6 +130,10 @@ [LibraryClasses]
   
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
 !endif
 
+!if $(HTTP_BOOT_ENABLE) == TRUE
+  HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
+!endif
+
   
S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf
   
OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
@@ -551,6 +556,11 @@ [Components]
   MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
   MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
+!if $(HTTP_BOOT_ENABLE) == TRUE
+  NetworkPkg/DnsDxe/DnsDxe.inf
+  NetworkPkg/HttpDxe/HttpDxe.inf
+  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
+!endif
   OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
   #
diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index 16675f8..0e4ee49 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -324,6 +324,11 @@ [FV.DXEFV]
   INF  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
   INF  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
+!if $(HTTP_BOOT_ENABLE) == TRUE
+  INF  NetworkPkg/DnsDxe/DnsDxe.inf
+  INF  NetworkPkg/HttpDxe/HttpDxe.inf
+  INF  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
+!endif
   INF  OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
 #
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 90ca42a..2f8006d 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -35,6 +35,7 @@ [Defines]
   #
   DEFINE SECURE_BOOT_ENABLE  = FALSE
   DEFINE NETWORK_IP6_ENABLE  = FALSE
+  DEFINE HTTP_BOOT_ENABLE= FALSE
 
 [BuildOptions]
   GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG
@@ -134,6 +135,10 @@ [LibraryClasses]
   
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
 !endif
 
+!if $(HTTP_BOOT_ENABLE) == TRUE
+  HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
+!endif
+
   
S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf
   
OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
@@ -558,6 +563,11 @@ [Components.X64]
   MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
   MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
+!if $(HTTP_BOOT_ENABLE) == TRUE
+  NetworkPkg/DnsDxe/DnsDxe.inf
+  NetworkPkg/HttpDxe/HttpDxe.inf
+  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
+!endif
   OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
   #
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
index e6c525a..74412d4 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -324,6 +324,11 @@ [FV.DXEFV]
   INF  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
   INF  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
+!if $(HTTP_BOOT_ENABLE) == TRUE
+  INF  NetworkPkg/DnsDxe/DnsDxe.inf
+  INF  NetworkPkg/HttpDxe/HttpDxe.inf
+  INF  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
+!endif
   INF  OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
 #
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index b72eaa9..5407d9d 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -35,6 +35,7 @@ [Defines]
   #
   DEFINE SECURE_BOOT_ENABLE  = FALSE
   DEFINE NETWORK_I

Re: [edk2] [patch] CryptoPkg: Update Package version to 0.96

2015-08-19 Thread Ye, Ting
Reviewed-by: Ye Ting  

-Original Message-
From: Long, Qin 
Sent: Thursday, August 20, 2015 11:37 AM
To: Ye, Ting; edk2-devel@lists.01.org
Subject: [patch] CryptoPkg: Update Package version to 0.96

Update Package version to 0.9.6

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long 
---
 CryptoPkg/CryptoPkg.dec | 4 ++--
 CryptoPkg/CryptoPkg.dsc | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CryptoPkg/CryptoPkg.dec b/CryptoPkg/CryptoPkg.dec
index 6f8bf21..4561f3f 100644
--- a/CryptoPkg/CryptoPkg.dec
+++ b/CryptoPkg/CryptoPkg.dec
@@ -4,7 +4,7 @@
 #  This Package provides cryptographic-related libraries for UEFI security 
modules.
 #  It also provides a test application to test libraries.
 #
-#  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
 #  which accompanies this distribution.  The full text of the license may be 
found at
@@ -20,7 +20,7 @@
   PACKAGE_NAME   = CryptoPkg
   PACKAGE_UNI_FILE   = CryptoPkg.uni
   PACKAGE_GUID   = 36470E80-36F2-4ba0-8CC8-937C7D9FF888
-  PACKAGE_VERSION= 0.94
+  PACKAGE_VERSION= 0.96
 
 [Includes]
   Include
diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc
index 11465a3..19a0fbc 100644
--- a/CryptoPkg/CryptoPkg.dsc
+++ b/CryptoPkg/CryptoPkg.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  Cryptographic Library Package for UEFI Security Implementation.
 #
-#  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
 #  which accompanies this distribution.  The full text of the license may be 
found at
@@ -20,7 +20,7 @@
 [Defines]
   PLATFORM_NAME  = CryptoPkg
   PLATFORM_GUID  = E1063286-6C8C-4c25-AEF0-67A9A5B6E6B6
-  PLATFORM_VERSION   = 0.94
+  PLATFORM_VERSION   = 0.96
   DSC_SPECIFICATION  = 0x00010005
   OUTPUT_DIRECTORY   = Build/CryptoPkg
   SUPPORTED_ARCHITECTURES= IA32|X64|IPF|ARM|AARCH64
-- 
1.9.5.msysgit.1

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


[edk2] [patch] CryptoPkg: Update Package version to 0.96

2015-08-19 Thread Qin Long
Update Package version to 0.9.6

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long 
---
 CryptoPkg/CryptoPkg.dec | 4 ++--
 CryptoPkg/CryptoPkg.dsc | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CryptoPkg/CryptoPkg.dec b/CryptoPkg/CryptoPkg.dec
index 6f8bf21..4561f3f 100644
--- a/CryptoPkg/CryptoPkg.dec
+++ b/CryptoPkg/CryptoPkg.dec
@@ -4,7 +4,7 @@
 #  This Package provides cryptographic-related libraries for UEFI security 
modules.
 #  It also provides a test application to test libraries.
 #
-#  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
 #  which accompanies this distribution.  The full text of the license may be 
found at
@@ -20,7 +20,7 @@
   PACKAGE_NAME   = CryptoPkg
   PACKAGE_UNI_FILE   = CryptoPkg.uni
   PACKAGE_GUID   = 36470E80-36F2-4ba0-8CC8-937C7D9FF888
-  PACKAGE_VERSION= 0.94
+  PACKAGE_VERSION= 0.96
 
 [Includes]
   Include
diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc
index 11465a3..19a0fbc 100644
--- a/CryptoPkg/CryptoPkg.dsc
+++ b/CryptoPkg/CryptoPkg.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  Cryptographic Library Package for UEFI Security Implementation.
 #
-#  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
 #  which accompanies this distribution.  The full text of the license may be 
found at
@@ -20,7 +20,7 @@
 [Defines]
   PLATFORM_NAME  = CryptoPkg
   PLATFORM_GUID  = E1063286-6C8C-4c25-AEF0-67A9A5B6E6B6
-  PLATFORM_VERSION   = 0.94
+  PLATFORM_VERSION   = 0.96
   DSC_SPECIFICATION  = 0x00010005
   OUTPUT_DIRECTORY   = Build/CryptoPkg
   SUPPORTED_ARCHITECTURES= IA32|X64|IPF|ARM|AARCH64
-- 
1.9.5.msysgit.1

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


Re: [edk2] [Patch] ShellPkg: Fix 'ifconfig' getting the address from dhcp error

2015-08-19 Thread Ye, Ting
Reviewed-by: Ye Ting 


-Original Message-
From: Wu, Jiaxin 
Sent: Wednesday, August 19, 2015 4:56 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting; Zhang, Lubo
Subject: [Patch] ShellPkg: Fix 'ifconfig' getting the address from dhcp error

R18201 fix caused ifconfig in shell failed to get the address from dhcp with the
command "ifconfig -s eth0 dhcp" since the default policy is dhcp already.
We can fix it by following the rule to starting the Ip4 auto configuration.

Cc: Ye Ting 
Cc: Zhang Lubo 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu 
---
 .../UefiShellNetwork1CommandsLib/Ifconfig.c| 115 ++---
 1 file changed, 100 insertions(+), 15 deletions(-)

diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c 
b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
index df19a9f..273f1a8 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
@@ -273,10 +273,89 @@ IfConfigManualAddressNotify (
   *((BOOLEAN *) Context) = TRUE;
 }
 
 
 /**
+  Create an IP child, use it to start the auto configuration, then destroy it.
+
+  @param[in] Controller   The controller which has the service installed.
+  @param[in] ImageThe image handle used to open service.
+
+  @retval EFI_SUCCESS The configuration is done.
+**/
+EFI_STATUS
+EFIAPI
+IfConfigStartIp4(
+  IN  EFI_HANDLEController,
+  IN  EFI_HANDLEImage
+  )
+{
+  EFI_IP4_PROTOCOL  *Ip4;
+  EFI_HANDLEIp4Handle;
+  EFI_IP4_CONFIG_DATA   Ip4ConfigData;
+  EFI_STATUSStatus;
+
+  //
+  // Get the Ip4ServiceBinding Protocol
+  //
+  Ip4Handle = NULL;
+  Ip4   = NULL;
+
+  Status = NetLibCreateServiceChild (
+ Controller,
+ Image,
+ &gEfiIp4ServiceBindingProtocolGuid,
+ &Ip4Handle
+ );
+
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+
+  Status = gBS->OpenProtocol (
+ Ip4Handle,
+ &gEfiIp4ProtocolGuid,
+ (VOID **) &Ip4,
+ Controller,
+ Image,
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL
+ );
+
+  if (EFI_ERROR (Status)) {
+goto ON_EXIT;
+  }
+
+  Ip4ConfigData.DefaultProtocol  = EFI_IP_PROTO_ICMP;
+  Ip4ConfigData.AcceptAnyProtocol= FALSE;
+  Ip4ConfigData.AcceptIcmpErrors = FALSE;
+  Ip4ConfigData.AcceptBroadcast  = FALSE;
+  Ip4ConfigData.AcceptPromiscuous= FALSE;
+  Ip4ConfigData.UseDefaultAddress= TRUE;
+  ZeroMem (&Ip4ConfigData.StationAddress, sizeof (EFI_IPv4_ADDRESS));
+  ZeroMem (&Ip4ConfigData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
+  Ip4ConfigData.TypeOfService= 0;
+  Ip4ConfigData.TimeToLive   = 1;
+  Ip4ConfigData.DoNotFragment= FALSE;
+  Ip4ConfigData.RawData  = FALSE;
+  Ip4ConfigData.ReceiveTimeout   = 0;
+  Ip4ConfigData.TransmitTimeout  = 0;
+
+  Ip4->Configure (Ip4, &Ip4ConfigData);
+  
+ON_EXIT: 
+  NetLibDestroyServiceChild (
+Controller,
+Image,
+&gEfiIp4ServiceBindingProtocolGuid,
+Ip4Handle
+);
+  
+  return Status;
+}
+
+
+/**
   Print MAC address.
 
   @param[in]NodeThe pointer of MAC address buffer.
   @param[in]SizeThe size of MAC address buffer.
 
@@ -872,25 +951,31 @@ IfConfigSetInterfaceInfo (
 
 //
 // Process valid variables.
 //
 if (StrCmp(VarArg->Arg, L"dhcp") == 0) {
-  //
-  // Set dhcp config policy
-  //
-  Policy = Ip4Config2PolicyDhcp;
-  Status = IfCb->IfCfg->SetData (
-  IfCb->IfCfg,
-  Ip4Config2DataTypePolicy,
-  sizeof (EFI_IP4_CONFIG2_POLICY),
-  &Policy
-  );
-
-  if (EFI_ERROR(Status)) {
-goto ON_EXIT;
+  if (IfCb->Policy == Ip4Config2PolicyDhcp) {
+Status = IfConfigStartIp4 (IfCb->NicHandle, gImageHandle);
+if (EFI_ERROR(Status)) {
+  goto ON_EXIT;
+}
+  } else {
+//
+// Set dhcp config policy
+//
+Policy = Ip4Config2PolicyDhcp;
+Status = IfCb->IfCfg->SetData (
+IfCb->IfCfg,
+Ip4Config2DataTypePolicy,
+sizeof (EFI_IP4_CONFIG2_POLICY),
+&Policy
+);
+if (EFI_ERROR(Status)) {
+  goto ON_EXIT;
+}
   }
-
+  
   VarArg= VarArg->Next;
 
 } else if (StrCmp (VarArg->Arg, L"static") == 0) {
   //
   // Set manual config policy.
@@ -1036,11 +1121,11 @@ IfConfigSetInterfaceInfo (
 ON_EXIT:
   if (Dns != NULL) {
 FreePool (Dns);
   }
   
-  return EFI_SUCCESS;
+  return S

Re: [edk2] [Patch] MdeModulePkg: Fix default router table and interface missing error

2015-08-19 Thread Ye, Ting
Reviwed-by: Ye Ting  

-Original Message-
From: Wu, Jiaxin 
Sent: Wednesday, August 19, 2015 4:55 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting; Zhang, Lubo
Subject: [Patch] MdeModulePkg: Fix default router table and interface missing 
error

Ip4StartAutoConfig() will always free its default router table and interface,
which may cause IP instance missing its correct default interface. e.g. when
the policy is dhcp, and one child is configured to use default address.

Cc: Ye Ting 
Cc: Zhang Lubo 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu 
---
 .../Universal/Network/Ip4Dxe/Ip4Config2Impl.c  | 74 --
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c  |  4 ++
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c|  2 +
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h|  2 +
 4 files changed, 49 insertions(+), 33 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
index caf84fb..637d7cd 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
@@ -147,10 +147,11 @@ Ip4Config2OnPolicyChanged (
 
   //
   // Start the dhcp configuration.
   //
   if (NewPolicy == Ip4Config2PolicyDhcp) {
+IpSb->Reconfig = TRUE;
 Ip4StartAutoConfig (&IpSb->Ip4Config2Instance);
   }
 
 }
 
@@ -461,72 +462,72 @@ Ip4Config2OnDhcp4SbInstalled (
 }
 
 /**
   Set the station address and subnetmask for the default interface.
 
-  @param[in]  Instance   The pointer to the IP4 config2 instance data.
+  @param[in]  IpSb   The pointer to the IP4 service binding 
instance.
   @param[in]  StationAddress Ip address to be set.
   @param[in]  SubnetMask Subnet to be set.
 
   @retval EFI_SUCCESS   Set default address successful. 
   @retval OthersSome errors occur in setting. 
 
 **/
 EFI_STATUS
 Ip4Config2SetDefaultAddr (
-  IN IP4_CONFIG2_INSTANCE   *Instance,
+  IN IP4_SERVICE*IpSb,
   IN IP4_ADDR   StationAddress,
   IN IP4_ADDR   SubnetMask
   )
 {
   EFI_STATUSStatus;
-  IP4_SERVICE   *IpSb;
   IP4_INTERFACE *IpIf;
   IP4_PROTOCOL  *Ip4Instance;
   EFI_ARP_PROTOCOL  *Arp;
   LIST_ENTRY*Entry;
   IP4_ADDR  Subnet;
   IP4_ROUTE_TABLE   *RouteTable;
 
-  IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
   IpIf = IpSb->DefaultInterface;
   ASSERT (IpIf != NULL);
 
   if ((IpIf->Ip == StationAddress) && (IpIf->SubnetMask == SubnetMask)) {
 IpSb->State = IP4_SERVICE_CONFIGED;
 return EFI_SUCCESS;
   }
 
-  //
-  // The default address is changed, free the previous interface first.
-  //
-  if (IpSb->DefaultRouteTable != NULL) {
-Ip4FreeRouteTable (IpSb->DefaultRouteTable);
-IpSb->DefaultRouteTable = NULL;
-  }
+  if (IpSb->Reconfig) {
+//
+// The default address is changed, free the previous interface first.
+//
+if (IpSb->DefaultRouteTable != NULL) {
+  Ip4FreeRouteTable (IpSb->DefaultRouteTable);
+  IpSb->DefaultRouteTable = NULL;
+}
 
-  Ip4CancelReceive (IpSb->DefaultInterface);
-  Ip4FreeInterface (IpSb->DefaultInterface, NULL);
-  IpSb->DefaultInterface = NULL;
-  //
-  // Create new default interface and route table.
-  //
-  IpIf = Ip4CreateInterface (IpSb->Mnp, IpSb->Controller, IpSb->Image);
-  if (IpIf == NULL) {
-return EFI_OUT_OF_RESOURCES;
-  }
+Ip4CancelReceive (IpSb->DefaultInterface);
+Ip4FreeInterface (IpSb->DefaultInterface, NULL);
+IpSb->DefaultInterface = NULL;
+//
+// Create new default interface and route table.
+//
+IpIf = Ip4CreateInterface (IpSb->Mnp, IpSb->Controller, IpSb->Image);
+if (IpIf == NULL) {
+  return EFI_OUT_OF_RESOURCES;
+}
 
-  RouteTable = Ip4CreateRouteTable ();
-  if (RouteTable == NULL) {
-Ip4FreeInterface (IpIf, NULL);
-return EFI_OUT_OF_RESOURCES;
+RouteTable = Ip4CreateRouteTable ();
+if (RouteTable == NULL) {
+  Ip4FreeInterface (IpIf, NULL);
+  return EFI_OUT_OF_RESOURCES;
+}
+
+IpSb->DefaultInterface  = IpIf;
+InsertHeadList (&IpSb->Interfaces, &IpIf->Link);
+IpSb->DefaultRouteTable = RouteTable;
+Ip4ReceiveFrame (IpIf, NULL, Ip4AccpetFrame, IpSb);
   }
-  
-  IpSb->DefaultInterface  = IpIf;
-  InsertHeadList (&IpSb->Interfaces, &IpIf->Link);
-  IpSb->DefaultRouteTable = RouteTable;
-  Ip4ReceiveFrame (IpIf, NULL, Ip4AccpetFrame, IpSb);
 
   if (IpSb->State == IP4_SERVICE_CONFIGED) {
 IpSb->State = IP4_SERVICE_UNSTARTED;
   }
 
@@ -576,10 +577,12 @@ Ip4Config2SetDefaultAddr (
 SubnetMask,
 IP4_ALLZERO_ADDRESS
 );
 
   IpSb->State = IP4_SERVICE_CONFIGED;
+  IpSb->Reconfig = FALSE;
+  
   return EFI_SUCCESS;
 }
 
 /**
   Set the station address, subnetmask and gateway address for the default 
interface.
@@ -602,19 

Re: [edk2] [PATCH v2] MdeModulePkg:Full support F10 hot key in UiApp.

2015-08-19 Thread Dong, Eric
Reviewed-by:  Eric Dong 

-Original Message-
From: Bi, Dandan 
Sent: Wednesday, August 19, 2015 7:59 PM
To: Dong, Eric; Gao, Liming; edk2-devel@lists.01.org
Subject: [PATCH v2] MdeModulePkg:Full support F10 hot key in UiApp.

In current UiApp/Boot Maintenance manager,some pages don't support F10,
they use Commit Changes and Exit menu to save changes.Now support F10
in these pages.Compared with previous patch,mainly update the console page.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi 
---
 .../Application/UiApp/BootMaint/Bmstring.uni   | Bin 41522 -> 42370 bytes
 .../Application/UiApp/BootMaint/BootMaint.c| 433 ++---
 .../Application/UiApp/BootMaint/BootMaint.h| 123 +-
 .../Application/UiApp/BootMaint/ConsoleOption.c| 147 +++
 MdeModulePkg/Application/UiApp/BootMaint/Data.c|  13 +
 MdeModulePkg/Application/UiApp/BootMaint/FE.vfr|  24 +-
 .../Application/UiApp/BootMaint/FileExplorer.c | 187 +++--
 .../Application/UiApp/BootMaint/FormGuid.h |  32 +-
 .../Application/UiApp/BootMaint/UpdatePage.c   | 176 ++---
 .../Application/UiApp/BootMaint/Variable.c |  26 +-
 10 files changed, 804 insertions(+), 357 deletions(-)

diff --git a/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni 
b/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni
index 
8d9544db450322835972597234a07d76207e1102..f64837b7735f247eb0704c7d21d6639e4eac181b
 100644
GIT binary patch
delta 272
zcmdmVgsJH?(}o2p;%*E+4E_w^4Dk%kK-!NXgdqq>`%F$`6Q4YRO=WU|0>|XKBo3gu
z9EN;`as~yUx_pK_h7yJ%Ae}S$p;;qd`M_Mu$y3~@k1X`E^bO4Z^ESQ=-c>}8eKZ+g2*`Wm!MGW(CG+
WPCmdTFuAOu0AvD?=9|1^VIKf3g+yrp

delta 18
acmZoV&9vzV(}o2pn;)dI*iQbkqz?dBZV7Gx

diff --git a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c 
b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c
index 0a6eb6c..0a187f5 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c
@@ -294,13 +294,16 @@ BootMaintRouteConfig (
   EFI_STATUS  Status;
   UINTN   BufferSize;
   EFI_HII_CONFIG_ROUTING_PROTOCOL *ConfigRouting;
   BMM_FAKE_NV_DATA*NewBmmData;
   BMM_FAKE_NV_DATA*OldBmmData;
+  BM_CONSOLE_CONTEXT  *NewConsoleContext;
+  BM_TERMINAL_CONTEXT *NewTerminalContext;
   BM_MENU_ENTRY   *NewMenuEntry;
   BM_LOAD_CONTEXT *NewLoadContext;
-  UINT16  Index;  
+  UINT16  Index;
+  BOOLEAN TerminalAttChange;
   BMM_CALLBACK_DATA   *Private; 
 
   if (Progress == NULL) {
 return EFI_INVALID_PARAMETER;
   }
@@ -366,18 +369,32 @@ BootMaintRouteConfig (
  Index ++) {
   NewMenuEntry= BOpt_GetMenuEntry (&BootOptionMenu, Index);
   NewLoadContext  = (BM_LOAD_CONTEXT *) 
NewMenuEntry->VariableContext;
   NewLoadContext->Deleted = NewBmmData->BootOptionDel[Index];
   NewBmmData->BootOptionDel[Index] = FALSE;
+  NewBmmData->BootOptionDelMark[Index] = FALSE;
 }
 
 Var_DelBootOption ();
   }
   
   if (CompareMem (NewBmmData->BootOptionOrder, OldBmmData->BootOptionOrder, 
sizeof (NewBmmData->BootOptionOrder)) != 0) {  
 Status = Var_UpdateBootOrder (Private);
-  } 
+  }
+
+  if (CompareMem (&NewBmmData->BootTimeOut, &OldBmmData->BootTimeOut, sizeof 
(NewBmmData->BootTimeOut)) != 0){
+Status = gRT->SetVariable(
+L"Timeout",
+&gEfiGlobalVariableGuid,
+EFI_VARIABLE_BOOTSERVICE_ACCESS | 
EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
+sizeof(UINT16),
+&(NewBmmData->BootTimeOut)
+);
+ASSERT_EFI_ERROR(Status);
+
+Private->BmmOldFakeNVData.BootTimeOut = NewBmmData->BootTimeOut;
+  }
 
   //
   // Check data which located in Driver Options Menu and save the settings if 
need
   //  
   if (CompareMem (NewBmmData->DriverOptionDel, OldBmmData->DriverOptionDel, 
sizeof (NewBmmData->DriverOptionDel)) != 0) {   
@@ -386,17 +403,116 @@ BootMaintRouteConfig (
  Index++) {
   NewMenuEntry= BOpt_GetMenuEntry (&DriverOptionMenu, Index);
   NewLoadContext  = (BM_LOAD_CONTEXT *) 
NewMenuEntry->VariableContext;
   NewLoadContext->Deleted = NewBmmData->DriverOptionDel[Index];
   NewBmmData->DriverOptionDel[Index] = FALSE;
+  NewBmmData->DriverOptionDelMark[Index] = FALSE;
 }
 Var_DelDriverOption ();  
   }
   
   if (CompareMem (NewBmmData->DriverOptionOrder, 
OldBmmData->DriverOptionOrder, sizeof (NewBmmData->DriverOptionOrder)) != 0) {  
 Status = Var_UpdateDriverOrder (Private);
-  }  
+  }
+
+  if (CompareMem (&NewBmmData->ConsoleOutMode, &OldBmmData->ConsoleOutMode, 
sizeof (NewBmmData->ConsoleOutMode)) != 0){
+Var_UpdateConMode(Private);
+  }

Re: [edk2] [PATCH] SecurityPkg: Update Package version to 0.96

2015-08-19 Thread Long, Qin
Reviewed-by: Qin Long 


> -Original Message-
> From: Zhang, Chao B
> Sent: Thursday, August 20, 2015 10:11 AM
> To: edk2-devel@lists.01.org
> Cc: Long, Qin; Zhang, Chao B
> Subject: [PATCH] SecurityPkg: Update Package version to 0.96
> 
> Update Package version to 0.96
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Chao Zhang 
> ---
>  SecurityPkg/SecurityPkg.dec | 2 +-
>  SecurityPkg/SecurityPkg.dsc | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/SecurityPkg/SecurityPkg.dec b/SecurityPkg/SecurityPkg.dec index
> b0ef20b..0601954 100644
> --- a/SecurityPkg/SecurityPkg.dec
> +++ b/SecurityPkg/SecurityPkg.dec
> @@ -21,7 +21,7 @@
>PACKAGE_NAME   = SecurityPkg
>PACKAGE_UNI_FILE   = SecurityPkg.uni
>PACKAGE_GUID   = 4EFC4F66-6219-4427-B780-FB99F470767F
> -  PACKAGE_VERSION= 0.95
> +  PACKAGE_VERSION= 0.96
> 
>  [Includes]
>Include
> diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc index
> fa94d90..f885dd9 100644
> --- a/SecurityPkg/SecurityPkg.dsc
> +++ b/SecurityPkg/SecurityPkg.dsc
> @@ -15,7 +15,7 @@
>  [Defines]
>PLATFORM_NAME  = SecurityPkg
>PLATFORM_GUID  = B2C4614D-AE76-47ba-B876-5988BFED064F
> -  PLATFORM_VERSION   = 0.95
> +  PLATFORM_VERSION   = 0.96
>DSC_SPECIFICATION  = 0x00010005
>OUTPUT_DIRECTORY   = Build/SecurityPkg
>SUPPORTED_ARCHITECTURES= IA32|IPF|X64|EBC
> --
> 1.9.5.msysgit.1

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


[edk2] [PATCH] SecurityPkg: Update Package version to 0.96

2015-08-19 Thread Zhang, Chao B
Update Package version to 0.96

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang 
---
 SecurityPkg/SecurityPkg.dec | 2 +-
 SecurityPkg/SecurityPkg.dsc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/SecurityPkg/SecurityPkg.dec b/SecurityPkg/SecurityPkg.dec
index b0ef20b..0601954 100644
--- a/SecurityPkg/SecurityPkg.dec
+++ b/SecurityPkg/SecurityPkg.dec
@@ -21,7 +21,7 @@
   PACKAGE_NAME   = SecurityPkg
   PACKAGE_UNI_FILE   = SecurityPkg.uni
   PACKAGE_GUID   = 4EFC4F66-6219-4427-B780-FB99F470767F
-  PACKAGE_VERSION= 0.95
+  PACKAGE_VERSION= 0.96
 
 [Includes]
   Include
diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc
index fa94d90..f885dd9 100644
--- a/SecurityPkg/SecurityPkg.dsc
+++ b/SecurityPkg/SecurityPkg.dsc
@@ -15,7 +15,7 @@
 [Defines]
   PLATFORM_NAME  = SecurityPkg
   PLATFORM_GUID  = B2C4614D-AE76-47ba-B876-5988BFED064F
-  PLATFORM_VERSION   = 0.95
+  PLATFORM_VERSION   = 0.96
   DSC_SPECIFICATION  = 0x00010005
   OUTPUT_DIRECTORY   = Build/SecurityPkg
   SUPPORTED_ARCHITECTURES= IA32|IPF|X64|EBC
-- 
1.9.5.msysgit.1

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


Re: [edk2] [patch] IntelFrameworkPkg: Update DEC and DSC version from 0.94 to 0.96

2015-08-19 Thread Gao, Liming
Reviewed-by: Liming Gao 

-Original Message-
From: Tian, Feng 
Sent: Thursday, August 20, 2015 9:26 AM
To: Gao, Liming
Cc: edk2-devel@lists.01.org; Tian, Feng
Subject: [patch] IntelFrameworkPkg: Update DEC and DSC version from 0.94 to 0.96

Update DEC and DSC version to reflect new changes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian 
---
 IntelFrameworkPkg/IntelFrameworkPkg.dec | 4 ++--  
IntelFrameworkPkg/IntelFrameworkPkg.dsc | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/IntelFrameworkPkg/IntelFrameworkPkg.dec 
b/IntelFrameworkPkg/IntelFrameworkPkg.dec
index 7620ec8..5cfe99c 100644
--- a/IntelFrameworkPkg/IntelFrameworkPkg.dec
+++ b/IntelFrameworkPkg/IntelFrameworkPkg.dec
@@ -2,7 +2,7 @@
 # Intel Framework Package Reference Implementations  #  # This package 
provides definitions and libraries that comply to Intel Framework 
Specifications.
-# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2015, Intel Corporation. All rights 
+reserved.
 #
 #This program and the accompanying materials are licensed and made 
available
 #under the terms and conditions of the BSD License which accompanies this 
distribution.
@@ -17,7 +17,7 @@
   PACKAGE_NAME   = IntelFrameworkPkg
   PACKAGE_UNI_FILE   = IntelFrameworkPkg.uni
   PACKAGE_GUID   = 2759ded5-bb57-4b06-af4f-c398fa552719
-  PACKAGE_VERSION= 0.94
+  PACKAGE_VERSION= 0.96
 
 [Includes]
   Include# Root include for the package
diff --git a/IntelFrameworkPkg/IntelFrameworkPkg.dsc 
b/IntelFrameworkPkg/IntelFrameworkPkg.dsc
index 15f4665..93a76d6 100644
--- a/IntelFrameworkPkg/IntelFrameworkPkg.dsc
+++ b/IntelFrameworkPkg/IntelFrameworkPkg.dsc
@@ -3,7 +3,7 @@
 #
 # This DSC file is used for Package Level build.
 #
-# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2015, Intel Corporation. All rights 
+reserved.
 #
 #This program and the accompanying materials
 #are licensed and made available under the terms and conditions of the BSD 
License
@@ -23,7 +23,7 @@
 [Defines]
   PLATFORM_NAME  = IntelFramework
   PLATFORM_GUID  = E76EB141-6EDB-43f3-A455-EF24A79673DD
-  PLATFORM_VERSION   = 0.94
+  PLATFORM_VERSION   = 0.96
   DSC_SPECIFICATION  = 0x00010005
   OUTPUT_DIRECTORY   = Build/IntelFramework
   SUPPORTED_ARCHITECTURES= IA32|IPF|X64|EBC|ARM
--
1.9.5.msysgit.0

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


Re: [edk2] [PATCH v2 1/2] NetworkPkg: Remove the hostname from the http request url

2015-08-19 Thread Fu, Siyuan
Hi, Gray

Sorry for that I didn't notice some details in RFC2616 and RFC7230 about this 
problem and I want to correct my previous comments.
First, the RFC requires all client must send only the abs path form when making 
a request directly to an origin server. Our HTTP driver obviously belongs to 
this case since proxy is not supported now, so I think the intention of your 
path make sense.
Next, since there is no restriction about the input URI form to Http.Request(), 
so the caller may pass either an absolute URI or an abs path to HTTP driver. I 
suggest to make a little update on your path to check whether the Url is 
already an abs path as below.

If Url starts with '/',
Already abs path, skip the conversion.
Else, 
Remove scheme and hostname field as your path.

Thanks,
Siyuan

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Fu, 
Siyuan
Sent: Thursday, August 20, 2015 9:13 AM
To: Gary Ching-Pang Lin; edk2-devel@lists.01.org
Cc: Justen, Jordan L; Laszlo Ersek
Subject: Re: [edk2] [PATCH v2 1/2] NetworkPkg: Remove the hostname from the 
http request url

Hi, Gray

The URI in the request line could be either an absolute URI or an abs path, 
both are allowed according to RFC2616 section 5.1.2, so we let the caller of 
EFI_HTTP_PROTOCOL to decide what kind of the URI they want to use, and not 
modify it. In your patch you assume the input RequestData->Url is always an abs 
path so I think it's not a correct fix.

Quote from RFC2616:

Request-URI= "*" | absoluteURI | abs_path | authority

example would be
OPTIONS * HTTP/1.1
Or
GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1 Or
GET /pub/WWW/TheProject.html HTTP/1.1

Siyuan

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Gary 
Ching-Pang Lin
Sent: Monday, August 17, 2015 4:21 PM
To: edk2-devel@lists.01.org
Cc: Justen, Jordan L; Fu, Siyuan; Laszlo Ersek
Subject: [edk2] [PATCH v2 1/2] NetworkPkg: Remove the hostname from the http 
request url

The hostname is already set in the header of the http request.
The url shouldn't contain the hostname since the hostname will be prepended to 
the url when the server interprets the request.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Ching-Pang Lin 
Reviewed-by: Ye Ting 
---
 NetworkPkg/HttpDxe/HttpImpl.c | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c 
index 545fe42..030dcfe 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -227,6 +227,7 @@ EfiHttpRequest (
   CHAR16*HostNameStr;
   HTTP_TOKEN_WRAP   *Wrap;
   HTTP_TCP_TOKEN_WRAP   *TcpWrap;
+  CHAR8 *FileUrl;
 
   if ((This == NULL) || (Token == NULL)) {
 return EFI_INVALID_PARAMETER;
@@ -450,7 +451,18 @@ EfiHttpRequest (
   //
   // Create request message.
   //
-  RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, Url);
+  FileUrl = Url;
+  while (*FileUrl != ':')
+FileUrl++;
+  if ((*(FileUrl+1) == '/') && (*(FileUrl+2) == '/')) {
+FileUrl += 3;
+while (*FileUrl != '/')
+  FileUrl++;
+  } else {
+Status = EFI_INVALID_PARAMETER;
+goto Error3;
+  }
+  RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, FileUrl);
   if (RequestStr == NULL) {
 Status = EFI_OUT_OF_RESOURCES;
 goto Error3;
--
2.1.4

___
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] [patch] IntelFrameworkModulePkg: Update DEC and DSC version from 0.94 to 0.96

2015-08-19 Thread Gao, Liming
Reviewed-by: Liming Gao 

-Original Message-
From: Tian, Feng 
Sent: Thursday, August 20, 2015 9:26 AM
To: Gao, Liming
Cc: edk2-devel@lists.01.org; Tian, Feng
Subject: [patch] IntelFrameworkModulePkg: Update DEC and DSC version from 0.94 
to 0.96

Update DEC and DSC version to reflect new changes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian 
---
 IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec | 2 +-  
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec 
b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
index 66310e6..8bbde8e 100644
--- a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
+++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
@@ -21,7 +21,7 @@
   PACKAGE_NAME   = IntelFrameworkModulePkg
   PACKAGE_UNI_FILE   = IntelFrameworkModulePkg.uni
   PACKAGE_GUID   = 88894582-7553-4822-B484-624E24B6DECF
-  PACKAGE_VERSION= 0.94
+  PACKAGE_VERSION= 0.96
 
 [Includes]
   Include# Root include for the package
diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc 
b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
index 3e1297c..b4adab1 100644
--- a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
+++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
@@ -22,7 +22,7 @@
 [Defines]
   PLATFORM_NAME  = IntelFrameworkModuleAll
   PLATFORM_GUID  = FFF87D9A-E5BB-4AFF-9ADE-8645492E8087
-  PLATFORM_VERSION   = 0.94
+  PLATFORM_VERSION   = 0.96
   DSC_SPECIFICATION  = 0x00010005
   OUTPUT_DIRECTORY   = Build/IntelFrameworkModuleAll
   SUPPORTED_ARCHITECTURES= IA32|IPF|X64|EBC|ARM
--
1.9.5.msysgit.0

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


[edk2] [patch] IntelFrameworkPkg: Update DEC and DSC version from 0.94 to 0.96

2015-08-19 Thread Tian Feng
Update DEC and DSC version to reflect new changes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian 
---
 IntelFrameworkPkg/IntelFrameworkPkg.dec | 4 ++--
 IntelFrameworkPkg/IntelFrameworkPkg.dsc | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/IntelFrameworkPkg/IntelFrameworkPkg.dec 
b/IntelFrameworkPkg/IntelFrameworkPkg.dec
index 7620ec8..5cfe99c 100644
--- a/IntelFrameworkPkg/IntelFrameworkPkg.dec
+++ b/IntelFrameworkPkg/IntelFrameworkPkg.dec
@@ -2,7 +2,7 @@
 # Intel Framework Package Reference Implementations
 #
 # This package provides definitions and libraries that comply to Intel 
Framework Specifications.
-# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
 #
 #This program and the accompanying materials are licensed and made 
available
 #under the terms and conditions of the BSD License which accompanies this 
distribution.
@@ -17,7 +17,7 @@
   PACKAGE_NAME   = IntelFrameworkPkg
   PACKAGE_UNI_FILE   = IntelFrameworkPkg.uni
   PACKAGE_GUID   = 2759ded5-bb57-4b06-af4f-c398fa552719
-  PACKAGE_VERSION= 0.94
+  PACKAGE_VERSION= 0.96
 
 [Includes]
   Include# Root include for the package
diff --git a/IntelFrameworkPkg/IntelFrameworkPkg.dsc 
b/IntelFrameworkPkg/IntelFrameworkPkg.dsc
index 15f4665..93a76d6 100644
--- a/IntelFrameworkPkg/IntelFrameworkPkg.dsc
+++ b/IntelFrameworkPkg/IntelFrameworkPkg.dsc
@@ -3,7 +3,7 @@
 #
 # This DSC file is used for Package Level build.
 #
-# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
 #
 #This program and the accompanying materials
 #are licensed and made available under the terms and conditions of the BSD 
License
@@ -23,7 +23,7 @@
 [Defines]
   PLATFORM_NAME  = IntelFramework
   PLATFORM_GUID  = E76EB141-6EDB-43f3-A455-EF24A79673DD
-  PLATFORM_VERSION   = 0.94
+  PLATFORM_VERSION   = 0.96
   DSC_SPECIFICATION  = 0x00010005
   OUTPUT_DIRECTORY   = Build/IntelFramework
   SUPPORTED_ARCHITECTURES= IA32|IPF|X64|EBC|ARM
-- 
1.9.5.msysgit.0

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


[edk2] [patch] MdeModulePkg: Update DSC version from 0.94 to 0.96

2015-08-19 Thread Tian Feng
Update DSC version to reflect new changes for UEFI2.5 and PI1.4.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian 
---
 MdeModulePkg/MdeModulePkg.dsc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index 20edc08..c99167b 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -17,7 +17,7 @@
 [Defines]
   PLATFORM_NAME  = MdeModule
   PLATFORM_GUID  = 587CE499-6CBE-43cd-94E2-186218569478
-  PLATFORM_VERSION   = 0.94
+  PLATFORM_VERSION   = 0.96
   DSC_SPECIFICATION  = 0x00010005
   OUTPUT_DIRECTORY   = Build/MdeModule
   SUPPORTED_ARCHITECTURES= IA32|IPF|X64|EBC|ARM|AARCH64
-- 
1.9.5.msysgit.0

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


[edk2] [patch] IntelFrameworkModulePkg: Update DEC and DSC version from 0.94 to 0.96

2015-08-19 Thread Tian Feng
Update DEC and DSC version to reflect new changes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian 
---
 IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec | 2 +-
 IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec 
b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
index 66310e6..8bbde8e 100644
--- a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
+++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
@@ -21,7 +21,7 @@
   PACKAGE_NAME   = IntelFrameworkModulePkg
   PACKAGE_UNI_FILE   = IntelFrameworkModulePkg.uni
   PACKAGE_GUID   = 88894582-7553-4822-B484-624E24B6DECF
-  PACKAGE_VERSION= 0.94
+  PACKAGE_VERSION= 0.96
 
 [Includes]
   Include# Root include for the package
diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc 
b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
index 3e1297c..b4adab1 100644
--- a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
+++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
@@ -22,7 +22,7 @@
 [Defines]
   PLATFORM_NAME  = IntelFrameworkModuleAll
   PLATFORM_GUID  = FFF87D9A-E5BB-4AFF-9ADE-8645492E8087
-  PLATFORM_VERSION   = 0.94
+  PLATFORM_VERSION   = 0.96
   DSC_SPECIFICATION  = 0x00010005
   OUTPUT_DIRECTORY   = Build/IntelFrameworkModuleAll
   SUPPORTED_ARCHITECTURES= IA32|IPF|X64|EBC|ARM
-- 
1.9.5.msysgit.0

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


Re: [edk2] [PATCH v2 2/2] OvmfPkg: Add HttpBoot support

2015-08-19 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 

-Original Message-
From: Gary Ching-Pang Lin [mailto:g...@suse.com] 
Sent: Monday, August 17, 2015 4:21 PM
To: edk2-devel@lists.01.org
Cc: Laszlo Ersek; Justen, Jordan L; Fu, Siyuan
Subject: [PATCH v2 2/2] OvmfPkg: Add HttpBoot support

This commit introdues a new build option to OvmfPkg: HTTP_BOOT_ENABLE.
When HttpBoot is enabled, a new Network boot option will show in the boot 
manager menu with the device path like this:

PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/IPv4(0.0.0.0)/Uri()

It works like the PXE one but fetches the NBP from the given http url instead 
of the tftp service.

A simple testing environment can be set up with the QEMU tap network and 
dnsmasq + lighttpd.

Here is the example of the dnsmasq config:

  interface=
  dhcp-range=192.168.111.100,192.168.111.120,12h
  dhcp-option=60,"HTTPClient"
  dhcp-boot="http:///"

It's similar to the PXE server settings except the tftp function is disabled, 
the option 60 must be "HTTPClient", and the boot uri is a http url.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Ching-Pang Lin 
---
 OvmfPkg/OvmfPkgIa32.dsc| 10 ++
 OvmfPkg/OvmfPkgIa32.fdf|  5 +
 OvmfPkg/OvmfPkgIa32X64.dsc | 10 ++  OvmfPkg/OvmfPkgIa32X64.fdf |  5 
+
 OvmfPkg/OvmfPkgX64.dsc | 10 ++
 OvmfPkg/OvmfPkgX64.fdf |  5 +
 6 files changed, 45 insertions(+)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 
4ab618d..9a6de15 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -35,6 +35,7 @@ [Defines]
   #
   DEFINE SECURE_BOOT_ENABLE  = FALSE
   DEFINE NETWORK_IP6_ENABLE  = FALSE
+  DEFINE HTTP_BOOT_ENABLE= FALSE
 
 [BuildOptions]
   GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG
@@ -129,6 +130,10 @@ [LibraryClasses]
   
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
 !endif
 
+!if $(HTTP_BOOT_ENABLE) == TRUE
+  HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
+!endif
+
   
S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf
   
OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
@@ -551,6 +556,11 @@ [Components]
   MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
   MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
+!if $(HTTP_BOOT_ENABLE) == TRUE
+  NetworkPkg/DnsDxe/DnsDxe.inf
+  NetworkPkg/HttpDxe/HttpDxe.inf
+  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
+!endif
   OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
   #
diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf index 
16675f8..0e4ee49 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -324,6 +324,11 @@ [FV.DXEFV]
   INF  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
   INF  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
+!if $(HTTP_BOOT_ENABLE) == TRUE
+  INF  NetworkPkg/DnsDxe/DnsDxe.inf
+  INF  NetworkPkg/HttpDxe/HttpDxe.inf
+  INF  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
+!endif
   INF  OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
 #
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 
90ca42a..2f8006d 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -35,6 +35,7 @@ [Defines]
   #
   DEFINE SECURE_BOOT_ENABLE  = FALSE
   DEFINE NETWORK_IP6_ENABLE  = FALSE
+  DEFINE HTTP_BOOT_ENABLE= FALSE
 
 [BuildOptions]
   GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG
@@ -134,6 +135,10 @@ [LibraryClasses]
   
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
 !endif
 
+!if $(HTTP_BOOT_ENABLE) == TRUE
+  HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
+!endif
+
   
S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf
   
OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
@@ -558,6 +563,11 @@ [Components.X64]
   MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
   MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
+!if $(HTTP_BOOT_ENABLE) == TRUE
+  NetworkPkg/DnsDxe/DnsDxe.inf
+  NetworkPkg/HttpDxe/HttpDxe.inf
+  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
+!endif
   OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
   #
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf index 
e6c525a..74412d4 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -324,6 +324,11 @@ [FV.DXEFV]
   INF  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
   INF  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
+!if $(HTTP_BOOT_ENABLE) == TRUE
+  INF  NetworkPkg/DnsDxe/DnsDxe.inf
+  INF  NetworkPkg/HttpDxe/HttpDxe.inf
+  INF  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
+!endif
   INF  OvmfPkg/VirtioNetDxe/VirtioN

Re: [edk2] [PATCH v2 1/2] NetworkPkg: Remove the hostname from the http request url

2015-08-19 Thread Fu, Siyuan
Hi, Gray

The URI in the request line could be either an absolute URI or an abs path, 
both are allowed according to RFC2616 section 5.1.2, so we let the caller of 
EFI_HTTP_PROTOCOL to decide what kind of the URI they want to use, and not 
modify it. In your patch you assume the input RequestData->Url is always an abs 
path so I think it's not a correct fix.

Quote from RFC2616:

Request-URI= "*" | absoluteURI | abs_path | authority

example would be
OPTIONS * HTTP/1.1
Or
GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1
Or
GET /pub/WWW/TheProject.html HTTP/1.1

Siyuan

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Gary 
Ching-Pang Lin
Sent: Monday, August 17, 2015 4:21 PM
To: edk2-devel@lists.01.org
Cc: Justen, Jordan L; Fu, Siyuan; Laszlo Ersek
Subject: [edk2] [PATCH v2 1/2] NetworkPkg: Remove the hostname from the http 
request url

The hostname is already set in the header of the http request.
The url shouldn't contain the hostname since the hostname will be prepended to 
the url when the server interprets the request.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Ching-Pang Lin 
Reviewed-by: Ye Ting 
---
 NetworkPkg/HttpDxe/HttpImpl.c | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c 
index 545fe42..030dcfe 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -227,6 +227,7 @@ EfiHttpRequest (
   CHAR16*HostNameStr;
   HTTP_TOKEN_WRAP   *Wrap;
   HTTP_TCP_TOKEN_WRAP   *TcpWrap;
+  CHAR8 *FileUrl;
 
   if ((This == NULL) || (Token == NULL)) {
 return EFI_INVALID_PARAMETER;
@@ -450,7 +451,18 @@ EfiHttpRequest (
   //
   // Create request message.
   //
-  RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, Url);
+  FileUrl = Url;
+  while (*FileUrl != ':')
+FileUrl++;
+  if ((*(FileUrl+1) == '/') && (*(FileUrl+2) == '/')) {
+FileUrl += 3;
+while (*FileUrl != '/')
+  FileUrl++;
+  } else {
+Status = EFI_INVALID_PARAMETER;
+goto Error3;
+  }
+  RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, FileUrl);
   if (RequestStr == NULL) {
 Status = EFI_OUT_OF_RESOURCES;
 goto Error3;
--
2.1.4

___
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] Help debugging PEIM on Minnowboard Max

2015-08-19 Thread Tian, Feng
EDKII mass storage PEIM drivers were developed for recovery mode, that's why 
you can see a gEfiPeiBootInRecoveryModePpiGuid dependency in their INF files.

So they don't meet your usage model and you need make some code changes and 
introduce a usb host controller PEIM driver like I said before.

As for the BAR, a simple way is booting to shell and see which bar is used in 
DXE phase and then hardcode it in your usb host controller PEIM driver.

Last, as far as I know there is no reference platform enabling pure xhci pei 
support.

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Eric 
Wittmayer
Sent: Tuesday, August 18, 2015 13:00
To: Tian, Feng; edk2-devel@lists.01.org
Subject: Re: [edk2] Help debugging PEIM on Minnowboard Max

Hi Feng,
   Now I understand the concept.  I was expecting that PEIM would already be 
available for the Minnowboard Max.  Is Usb in the PEI phase not supported in 
Minnowboard?

>From my digging in the code today, it seems to enable the xhci controller, 
>it's PCI BAR needs to be set and enabled for memory access.  I found memory 
>base addresses for some devices in 
>Vlv2DeviceRefCodePkg\ValleyView2Soc\NorthCluster\Include\PlatformBaseAddress
es.h but not for XHCI.  From looking at the Atom E3800 datasheet, the xhci 
memory base doesn't have a fixed location so I believe I need to pick an unused 
range in the Low MMIO space to set as the xhci BAR. 

If you or someone else on the list can recommend a different platform that 
already supports xhci in the PEI phase to use as a development platform that 
might be a better option for me.

Thank you again for your patience and prompt responses.

Eric

> -Original Message-
> From: Tian, Feng [mailto:feng.t...@intel.com]
> Sent: Sunday, August 16, 2015 10:20 PM
> To: Eric Wittmayer; edk2-devel@lists.01.org
> Cc: Tian, Feng
> Subject: RE: [edk2] Help debugging PEIM on Minnowboard Max
> 
> Do you look into the UsbController.h in MdeModulePkg/Include/Ppi 
> directory?
> 
> typedef
> EFI_STATUS
> (EFIAPI *PEI_GET_USB_CONTROLLER)(
>   IN  EFI_PEI_SERVICES**PeiServices,
>   IN  PEI_USB_CONTROLLER_PPI  *This,
>   IN  UINT8   UsbControllerId,
>   OUT UINTN   *ControllerType,
>   OUT UINTN   *BaseAddress
>   );
> 
> You need write a PEIM to produce this PPI and implement the above 
> interface according to your platform setting.
> 
> For how to write a PEIM module, you can refer to EDKII Module Writer's 
> Guide in edk2.sourceforge.net
> 
> Thanks
> Feng
> 
> -Original Message-
> From: Eric Wittmayer [mailto:e...@frescologic.com]
> Sent: Monday, August 17, 2015 11:50
> To: Tian, Feng; edk2-devel@lists.01.org
> Subject: RE: [edk2] Help debugging PEIM on Minnowboard Max
> 
> Hi Feng,
>I see now that XhciPei needs gPeiUsbControllerPpiGuid and creates 
> gPeiUsbHostControllerPpiGuid  which UsbBusPei needs.
> 
> I can't seem to figure out what creates gPeiUsbControllerPpiGuid?  I 
> see
it
> listed in the .dec file I'm using but that apparently isn't enough to
> install the Ppi.   What should be installing the gPeiUsbControllerPpiGuid?
> 
> Thanks,
> Eric
> 
> > -Original Message-
> > From: Tian, Feng [mailto:feng.t...@intel.com]
> > Sent: Sunday, August 16, 2015 6:09 PM
> > To: Eric Wittmayer; edk2-devel@lists.01.org
> > Cc: Tian, Feng
> > Subject: RE: [edk2] Help debugging PEIM on Minnowboard Max
> >
> > Eric,
> >
> > I must agree the naming of these usb pei related ppi guids are not 
> > good, which misleads you.
> >
> > There is no the chicken and egg problem. 
> > gPeiUsbHostControllerPpiGuid and gPeiUsbControllerPpiGuid are two 
> > different ppis. The former is consumed by UsbPei and the latter is 
> > consumed by XhciPei. You need write a pei module to produce 
> > PeiUsbControllerPpi (see MdeModulePkg/Include/Ppi for
> > definitions) at first.
> >
> > Thanks
> > Feng
> >
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf 
> > Of Eric Wittmayer
> > Sent: Saturday, August 15, 2015 08:12
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] Help debugging PEIM on Minnowboard Max
> >
> > I'm writing a PEIM for a USB3 device but having trouble even getting 
> > the UsbBusPie and XhciPei modules to load during boot.
> >
> > I thought getting the existing Usb Peims to load would be a good 
> > first
> step.
> > I looked at the DEPEX for both of the above modules and tried 
> > removing "gEfiPeiBootInRecoveryModePpiGuid" but I didn't see them 
> > load.  If I set both of their DEPEX == TRUE then I see some print 
> > statements that show they are at least trying to load but then I 
> > have a chicken and egg problem
> in
> > that UsbBusPie needs either gPeiUsbHostControllerPpiGuid or 
> > gPeiUsb2HostControllerPpiGuid which come from XhciPei.  However, 
> > XhciPei needs gPeiUsbControllerPpiGuid which comes from UsbBusPei 
> > before  it will install the gPeiUsb2HostCo

[edk2] Measured boot in OVMF with QEMU TPM passthrough?

2015-08-19 Thread David Van Arnem

Hello,

Should it be possible to perform measured boot in OVMF to measure a QEMU 
guest (extend and log PCRs) using a TPM passed-through from the host?


I have a host machine with a TPM (v1.2), and a QEMU Linux guest booting 
using an OVMF image with the modifications suggested in the following 
link (modifications were done to OvmfX64.dsc): 
http://tianocore.sourceforge.net/wiki/How_to_Enable_Security (section 
"How To Enable TCG TPM").  I've enabled QEMU TPM passthrough from the 
host to the guest, and I'm able to query the TPM in the guest using 
commands like tpm_version, tpm_getpubek, etc.  However, there are no 
measurements recorded in 
/sys/kernel/security/tpm0/ascii_bios_measurements.  Additionally, though 
I can view the PCR list from /sys/class/tpm/tpm0/device/pcrs, the list 
contains the same values that I saw when looking at the same file on my 
host before enabling TPM passthrough.  So, it appears measurement is not 
happening on the guest, and I wanted to check here to see if that's a 
limitation of OVMF/TPM passthrough, or if I just did something 
incorrectly when modifying the OVMF package.


Thanks,
David

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


Re: [edk2] [PATCH v2 1/2] ShellPkg: force use of AARCH64 small model when building DEBUG shell

2015-08-19 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Ard Biesheuvel
> Sent: Wednesday, August 19, 2015 2:48 AM
> To: edk2-devel@lists.01.org; leif.lindh...@linaro.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> ; ler...@redhat.com; Ard Biesheuvel
> 
> Subject: [edk2] [PATCH v2 1/2] ShellPkg: force use of AARCH64 small model
> when building DEBUG shell
> Importance: High
> 
> The tiny code model used by AARCH64 only supports binaries of up to
> 1 MB in size. Since the Shell application exceeds that when built in
> DEBUG mode, make sure we build it using the small code model instead.
> 
> Cc: Jaben Carsey ,
> Cc: Shumin Qiu 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel 
> Reviewed-by: Leif Lindholm 
> Tested-by: Leif Lindholm 
> ---
>  ShellPkg/Application/Shell/Shell.inf | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/ShellPkg/Application/Shell/Shell.inf
> b/ShellPkg/Application/Shell/Shell.inf
> index f7039369227c..09aecf717bd7 100644
> --- a/ShellPkg/Application/Shell/Shell.inf
> +++ b/ShellPkg/Application/Shell/Shell.inf
> @@ -108,3 +108,9 @@ [Pcd]
>gEfiShellPkgTokenSpaceGuid.PcdShellForceConsole ## CONSUMES
>gEfiShellPkgTokenSpaceGuid.PcdShellSupplier ## CONSUMES
> 
> +[BuildOptions.AARCH64]
> +  # The tiny code model used by AARCH64 only supports binaries of up to 1
> MB in
> +  # size. Since the Shell application exceeds that when built in DEBUG mode,
> +  # make sure we build it using the small code model instead.
> +  GCC:DEBUG_*_*_CC_FLAGS = -mcmodel=small
> +  GCC:DEBUG_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> --
> 1.9.1
> 
> ___
> 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] [PATCH] ShellBinPkg: Arm/AArch64 Shell binary update.

2015-08-19 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Leif Lindholm
> Sent: Wednesday, August 19, 2015 8:53 AM
> To: Ard Biesheuvel 
> Cc: edk2-devel@lists.01.org; ryan.har...@linaro.org
> Subject: Re: [edk2] [PATCH] ShellBinPkg: Arm/AArch64 Shell binary update.
> Importance: High
> 
> On Wed, Aug 19, 2015 at 01:46:42PM +0200, Ard Biesheuvel wrote:
> > The binaries of ShellBinPkg are generated with ShellPkg project 18222.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Ard Biesheuvel 
> > ---
> >
> > These are built with the tiny code model, note the code size reduction
> > for AARCH64.
> 
> Hmm...
> 
> I would prefer to not update the binaries with this until the
> -mcmode=tiny patch for BaseTools goes in, though.
> 
> > Branch:
> > https://git.linaro.org/people/ard.biesheuvel/uefi-
> next.git/shortlog/refs/heads/binshell
> >
> >  ShellBinPkg/MinUefiShell/AArch64/Shell.efi | Bin 408416 -> 387808 bytes
> >  ShellBinPkg/MinUefiShell/Arm/Shell.efi | Bin 324480 -> 330208 bytes
> >  ShellBinPkg/UefiShell/AArch64/Shell.efi| Bin 945152 -> 887136 bytes
> >  ShellBinPkg/UefiShell/Arm/Shell.efi| Bin 757728 -> 769536 bytes
> >  4 files changed, 0 insertions(+), 0 deletions(-)
> 
> Very nice!
> 
> > diff --git a/ShellBinPkg/MinUefiShell/AArch64/Shell.efi
> b/ShellBinPkg/MinUefiShell/AArch64/Shell.efi
> > index 7f63d86230e8..d5756e101342 100755
> > Binary files a/ShellBinPkg/MinUefiShell/AArch64/Shell.efi and
> b/ShellBinPkg/MinUefiShell/AArch64/Shell.efi differ
> > diff --git a/ShellBinPkg/MinUefiShell/Arm/Shell.efi
> b/ShellBinPkg/MinUefiShell/Arm/Shell.efi
> > index 782489af6960..8a7d7e5b7946 100755
> > Binary files a/ShellBinPkg/MinUefiShell/Arm/Shell.efi and
> b/ShellBinPkg/MinUefiShell/Arm/Shell.efi differ
> > diff --git a/ShellBinPkg/UefiShell/AArch64/Shell.efi
> b/ShellBinPkg/UefiShell/AArch64/Shell.efi
> > index 5a44a8ca6189..056da8d2932a 100755
> > Binary files a/ShellBinPkg/UefiShell/AArch64/Shell.efi and
> b/ShellBinPkg/UefiShell/AArch64/Shell.efi differ
> > diff --git a/ShellBinPkg/UefiShell/Arm/Shell.efi
> b/ShellBinPkg/UefiShell/Arm/Shell.efi
> > index 5a61df621047..afa91c4d6caf 100755
> > Binary files a/ShellBinPkg/UefiShell/Arm/Shell.efi and
> b/ShellBinPkg/UefiShell/Arm/Shell.efi differ
> > --
> > 1.9.1
> >
> ___
> 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] [PATCH] ArmPkg: Fix GCC5 build fail

2015-08-19 Thread Leif Lindholm
Hi Scott,

Thanks for this. Apologies, I somehow missed it going past.
This same fix went in as part of Ard's CLANG series (r18193).

Regards,

Leif

On Sun, Jul 19, 2015 at 03:23:17PM -0500, Scott Duplichan wrote:
> Add type cast to fix new GCC5 warning for discarded-array-qualifiers.
> Also remove an unneeded '&'.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Scott Duplichan 
> ---
> 
>  ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c 
> b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c
> index b1d9c02..296d5c6 100644
> --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c
> +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c
> @@ -111,7 +111,7 @@ WatchdogInterruptHandler (
>   EfiResetCold,
>   EFI_TIMEOUT,
>   StrSize (ResetString),
> - &ResetString
> + (VOID *)ResetString
>   );
>  
>// If we got here then the reset didn't work
> 
> 
> ___
> 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] [Patch] ShellPkg: Fix 'ifconfig' getting the address from dhcp error

2015-08-19 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jiaxin Wu
> Sent: Wednesday, August 19, 2015 1:56 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting ; Zhang, Lubo 
> Subject: [edk2] [Patch] ShellPkg: Fix 'ifconfig' getting the address from dhcp
> error
> Importance: High
> 
> R18201 fix caused ifconfig in shell failed to get the address from dhcp with
> the
> command "ifconfig -s eth0 dhcp" since the default policy is dhcp already.
> We can fix it by following the rule to starting the Ip4 auto configuration.
> 
> Cc: Ye Ting 
> Cc: Zhang Lubo 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu 
> ---
>  .../UefiShellNetwork1CommandsLib/Ifconfig.c| 115
> ++---
>  1 file changed, 100 insertions(+), 15 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> index df19a9f..273f1a8 100644
> --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> @@ -273,10 +273,89 @@ IfConfigManualAddressNotify (
>*((BOOLEAN *) Context) = TRUE;
>  }
> 
> 
>  /**
> +  Create an IP child, use it to start the auto configuration, then destroy 
> it.
> +
> +  @param[in] Controller   The controller which has the service installed.
> +  @param[in] ImageThe image handle used to open service.
> +
> +  @retval EFI_SUCCESS The configuration is done.
> +**/
> +EFI_STATUS
> +EFIAPI
> +IfConfigStartIp4(
> +  IN  EFI_HANDLEController,
> +  IN  EFI_HANDLEImage
> +  )
> +{
> +  EFI_IP4_PROTOCOL  *Ip4;
> +  EFI_HANDLEIp4Handle;
> +  EFI_IP4_CONFIG_DATA   Ip4ConfigData;
> +  EFI_STATUSStatus;
> +
> +  //
> +  // Get the Ip4ServiceBinding Protocol
> +  //
> +  Ip4Handle = NULL;
> +  Ip4   = NULL;
> +
> +  Status = NetLibCreateServiceChild (
> + Controller,
> + Image,
> + &gEfiIp4ServiceBindingProtocolGuid,
> + &Ip4Handle
> + );
> +
> +  if (EFI_ERROR (Status)) {
> +return Status;
> +  }
> +
> +  Status = gBS->OpenProtocol (
> + Ip4Handle,
> + &gEfiIp4ProtocolGuid,
> + (VOID **) &Ip4,
> + Controller,
> + Image,
> + EFI_OPEN_PROTOCOL_GET_PROTOCOL
> + );
> +
> +  if (EFI_ERROR (Status)) {
> +goto ON_EXIT;
> +  }
> +
> +  Ip4ConfigData.DefaultProtocol  = EFI_IP_PROTO_ICMP;
> +  Ip4ConfigData.AcceptAnyProtocol= FALSE;
> +  Ip4ConfigData.AcceptIcmpErrors = FALSE;
> +  Ip4ConfigData.AcceptBroadcast  = FALSE;
> +  Ip4ConfigData.AcceptPromiscuous= FALSE;
> +  Ip4ConfigData.UseDefaultAddress= TRUE;
> +  ZeroMem (&Ip4ConfigData.StationAddress, sizeof (EFI_IPv4_ADDRESS));
> +  ZeroMem (&Ip4ConfigData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
> +  Ip4ConfigData.TypeOfService= 0;
> +  Ip4ConfigData.TimeToLive   = 1;
> +  Ip4ConfigData.DoNotFragment= FALSE;
> +  Ip4ConfigData.RawData  = FALSE;
> +  Ip4ConfigData.ReceiveTimeout   = 0;
> +  Ip4ConfigData.TransmitTimeout  = 0;
> +
> +  Ip4->Configure (Ip4, &Ip4ConfigData);
> +
> +ON_EXIT:
> +  NetLibDestroyServiceChild (
> +Controller,
> +Image,
> +&gEfiIp4ServiceBindingProtocolGuid,
> +Ip4Handle
> +);
> +
> +  return Status;
> +}
> +
> +
> +/**
>Print MAC address.
> 
>@param[in]NodeThe pointer of MAC address buffer.
>@param[in]SizeThe size of MAC address buffer.
> 
> @@ -872,25 +951,31 @@ IfConfigSetInterfaceInfo (
> 
>  //
>  // Process valid variables.
>  //
>  if (StrCmp(VarArg->Arg, L"dhcp") == 0) {
> -  //
> -  // Set dhcp config policy
> -  //
> -  Policy = Ip4Config2PolicyDhcp;
> -  Status = IfCb->IfCfg->SetData (
> -  IfCb->IfCfg,
> -  Ip4Config2DataTypePolicy,
> -  sizeof (EFI_IP4_CONFIG2_POLICY),
> -  &Policy
> -  );
> -
> -  if (EFI_ERROR(Status)) {
> -goto ON_EXIT;
> +  if (IfCb->Policy == Ip4Config2PolicyDhcp) {
> +Status = IfConfigStartIp4 (IfCb->NicHandle, gImageHandle);
> +if (EFI_ERROR(Status)) {
> +  goto ON_EXIT;
> +}
> +  } else {
> +//
> +// Set dhcp config policy
> +//
> +Policy = Ip4Config2PolicyDhcp;
> +Status = IfCb->IfCfg->SetData (
> +IfCb->IfCfg,
> +Ip4Config2DataTypePolicy,
> +sizeof (EFI_IP4_CONFIG2_POLICY),
> +&Policy
> +   

Re: [edk2] [PATCH] ShellBinPkg: Arm/AArch64 Shell binary update.

2015-08-19 Thread Leif Lindholm
On Wed, Aug 19, 2015 at 01:46:42PM +0200, Ard Biesheuvel wrote:
> The binaries of ShellBinPkg are generated with ShellPkg project 18222.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel 
> ---
> 
> These are built with the tiny code model, note the code size reduction
> for AARCH64.

Hmm...

I would prefer to not update the binaries with this until the
-mcmode=tiny patch for BaseTools goes in, though.

> Branch:
> https://git.linaro.org/people/ard.biesheuvel/uefi-next.git/shortlog/refs/heads/binshell
> 
>  ShellBinPkg/MinUefiShell/AArch64/Shell.efi | Bin 408416 -> 387808 bytes
>  ShellBinPkg/MinUefiShell/Arm/Shell.efi | Bin 324480 -> 330208 bytes
>  ShellBinPkg/UefiShell/AArch64/Shell.efi| Bin 945152 -> 887136 bytes
>  ShellBinPkg/UefiShell/Arm/Shell.efi| Bin 757728 -> 769536 bytes
>  4 files changed, 0 insertions(+), 0 deletions(-)

Very nice!

> diff --git a/ShellBinPkg/MinUefiShell/AArch64/Shell.efi 
> b/ShellBinPkg/MinUefiShell/AArch64/Shell.efi
> index 7f63d86230e8..d5756e101342 100755
> Binary files a/ShellBinPkg/MinUefiShell/AArch64/Shell.efi and 
> b/ShellBinPkg/MinUefiShell/AArch64/Shell.efi differ
> diff --git a/ShellBinPkg/MinUefiShell/Arm/Shell.efi 
> b/ShellBinPkg/MinUefiShell/Arm/Shell.efi
> index 782489af6960..8a7d7e5b7946 100755
> Binary files a/ShellBinPkg/MinUefiShell/Arm/Shell.efi and 
> b/ShellBinPkg/MinUefiShell/Arm/Shell.efi differ
> diff --git a/ShellBinPkg/UefiShell/AArch64/Shell.efi 
> b/ShellBinPkg/UefiShell/AArch64/Shell.efi
> index 5a44a8ca6189..056da8d2932a 100755
> Binary files a/ShellBinPkg/UefiShell/AArch64/Shell.efi and 
> b/ShellBinPkg/UefiShell/AArch64/Shell.efi differ
> diff --git a/ShellBinPkg/UefiShell/Arm/Shell.efi 
> b/ShellBinPkg/UefiShell/Arm/Shell.efi
> index 5a61df621047..afa91c4d6caf 100755
> Binary files a/ShellBinPkg/UefiShell/Arm/Shell.efi and 
> b/ShellBinPkg/UefiShell/Arm/Shell.efi differ
> -- 
> 1.9.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 00/16] unify GCC command line options

2015-08-19 Thread Ard Biesheuvel
On 19 August 2015 at 09:53, Ard Biesheuvel  wrote:
> On 18 August 2015 at 22:29, Ard Biesheuvel  wrote:
>> On 18 August 2015 at 22:03, Ard Biesheuvel  wrote:
>>> On 18 August 2015 at 19:35, David Woodhouse  wrote:
 On Tue, 2015-08-18 at 17:52 +0200, Ard Biesheuvel wrote:
> On 18 August 2015 at 17:19, Jordan Justen  
> wrote:
> > Last time I checked, GCC44 ~ GCC49 all produced images roughly in the
> > same ball park size-wise. UNIXGCC produced much larger images because
> > it could not strip unused functions/data.
>
> Yeah, that is still true, unfortunately.

 Is it really still true?

 https://sourceware.org/bugzilla/show_bug.cgi?id=11539#c14

 If the patch that Nick committed to fix this *isn't* working, please
 add a comment telling him that :)

>>>
>>> I did a quick test with the gdb-7.10-branch of binutils-gdb, and while
>>> it does make some difference, it is still not sufficient
>>>
>>> Building OvmfX64 in RELEASE mode gives me
>>>
>>> Before:
>>>   the required fv image size 0xd67c0 exceeds the set fv image size 0xcc000
>>>
>>> After:
>>>   the required fv image size 0xd2a18 exceeds the set fv image size 0xcc000
>>>
>>> where GCC/ELF obviously produces something < 0xcc000
>>>
>>
>> I had mistakenly omitted the -ffunction-sections -fdata-sections
>> switches, but adding those makes it even worse
>>
>>   the required fv image size 0xdbf98 exceeds the set fv image size 0xcc000
>>
>> so there is definitely something dodgy going on here.
>>
>
> I managed to make this work by also adding the
> -fno-asynchronous-unwind-tables option. It appears that
> (unsurprisingly) the unwinding info is preventing code from being
> pruned.
>
> So with  -Os -ffunction-sections -fdata-sections
> -fno-asynchronous-unwind-tables, we get even better results than
> GCC49, since we can actually turn on size optimization for MinGW.
> On GCC49, we can only enable optimization if we also enable
> -maccumulate-outgoing-args, which -according to the man page- results
> in a notable increase in code size. (I assume this is the reason we
> don't optimize the GCC49 X64 builds at all)
>
> If I just look at VolInfo of the FVMAIN_COMPACT.Fv generated by each
> build (UNIXGCC with mingw 4.9 vs GCC49), I get 767 KB for MinGW for
> the file length of the first embedded FV, where GCC49 takes up 794 KB.
> Maybe not spectacular, but more than significant.

As it turns out, the -mcmodel=large we use for GCC4x/X64 is causing
much of the bloat here. If I remove it, the GCC49 build shrinks to 751
KB (Again, the size of the first FV. Note that this is compressed
size, but it is relevant nonetheless)

Does anyone remember why we use that? My build runs fine without it
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2] MdeModulePkg:Full support F10 hot key in UiApp.

2015-08-19 Thread Dandan Bi
In current UiApp/Boot Maintenance manager,some pages don't support F10,
they use Commit Changes and Exit menu to save changes.Now support F10
in these pages.Compared with previous patch,mainly update the console page.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi 
---
 .../Application/UiApp/BootMaint/Bmstring.uni   | Bin 41522 -> 42370 bytes
 .../Application/UiApp/BootMaint/BootMaint.c| 433 ++---
 .../Application/UiApp/BootMaint/BootMaint.h| 123 +-
 .../Application/UiApp/BootMaint/ConsoleOption.c| 147 +++
 MdeModulePkg/Application/UiApp/BootMaint/Data.c|  13 +
 MdeModulePkg/Application/UiApp/BootMaint/FE.vfr|  24 +-
 .../Application/UiApp/BootMaint/FileExplorer.c | 187 +++--
 .../Application/UiApp/BootMaint/FormGuid.h |  32 +-
 .../Application/UiApp/BootMaint/UpdatePage.c   | 176 ++---
 .../Application/UiApp/BootMaint/Variable.c |  26 +-
 10 files changed, 804 insertions(+), 357 deletions(-)

diff --git a/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni 
b/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni
index 
8d9544db450322835972597234a07d76207e1102..f64837b7735f247eb0704c7d21d6639e4eac181b
 100644
GIT binary patch
delta 272
zcmdmVgsJH?(}o2p;%*E+4E_w^4Dk%kK-!NXgdqq>`%F$`6Q4YRO=WU|0>|XKBo3gu
z9EN;`as~yUx_pK_h7yJ%Ae}S$p;;qd`M_Mu$y3~@k1X`E^bO4Z^ESQ=-c>}8eKZ+g2*`Wm!MGW(CG+
WPCmdTFuAOu0AvD?=9|1^VIKf3g+yrp

delta 18
acmZoV&9vzV(}o2pn;)dI*iQbkqz?dBZV7Gx

diff --git a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c 
b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c
index 0a6eb6c..0a187f5 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c
@@ -294,13 +294,16 @@ BootMaintRouteConfig (
   EFI_STATUS  Status;
   UINTN   BufferSize;
   EFI_HII_CONFIG_ROUTING_PROTOCOL *ConfigRouting;
   BMM_FAKE_NV_DATA*NewBmmData;
   BMM_FAKE_NV_DATA*OldBmmData;
+  BM_CONSOLE_CONTEXT  *NewConsoleContext;
+  BM_TERMINAL_CONTEXT *NewTerminalContext;
   BM_MENU_ENTRY   *NewMenuEntry;
   BM_LOAD_CONTEXT *NewLoadContext;
-  UINT16  Index;  
+  UINT16  Index;
+  BOOLEAN TerminalAttChange;
   BMM_CALLBACK_DATA   *Private; 
 
   if (Progress == NULL) {
 return EFI_INVALID_PARAMETER;
   }
@@ -366,18 +369,32 @@ BootMaintRouteConfig (
  Index ++) {
   NewMenuEntry= BOpt_GetMenuEntry (&BootOptionMenu, Index);
   NewLoadContext  = (BM_LOAD_CONTEXT *) 
NewMenuEntry->VariableContext;
   NewLoadContext->Deleted = NewBmmData->BootOptionDel[Index];
   NewBmmData->BootOptionDel[Index] = FALSE;
+  NewBmmData->BootOptionDelMark[Index] = FALSE;
 }
 
 Var_DelBootOption ();
   }
   
   if (CompareMem (NewBmmData->BootOptionOrder, OldBmmData->BootOptionOrder, 
sizeof (NewBmmData->BootOptionOrder)) != 0) {  
 Status = Var_UpdateBootOrder (Private);
-  } 
+  }
+
+  if (CompareMem (&NewBmmData->BootTimeOut, &OldBmmData->BootTimeOut, sizeof 
(NewBmmData->BootTimeOut)) != 0){
+Status = gRT->SetVariable(
+L"Timeout",
+&gEfiGlobalVariableGuid,
+EFI_VARIABLE_BOOTSERVICE_ACCESS | 
EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
+sizeof(UINT16),
+&(NewBmmData->BootTimeOut)
+);
+ASSERT_EFI_ERROR(Status);
+
+Private->BmmOldFakeNVData.BootTimeOut = NewBmmData->BootTimeOut;
+  }
 
   //
   // Check data which located in Driver Options Menu and save the settings if 
need
   //  
   if (CompareMem (NewBmmData->DriverOptionDel, OldBmmData->DriverOptionDel, 
sizeof (NewBmmData->DriverOptionDel)) != 0) {   
@@ -386,17 +403,116 @@ BootMaintRouteConfig (
  Index++) {
   NewMenuEntry= BOpt_GetMenuEntry (&DriverOptionMenu, Index);
   NewLoadContext  = (BM_LOAD_CONTEXT *) 
NewMenuEntry->VariableContext;
   NewLoadContext->Deleted = NewBmmData->DriverOptionDel[Index];
   NewBmmData->DriverOptionDel[Index] = FALSE;
+  NewBmmData->DriverOptionDelMark[Index] = FALSE;
 }
 Var_DelDriverOption ();  
   }
   
   if (CompareMem (NewBmmData->DriverOptionOrder, 
OldBmmData->DriverOptionOrder, sizeof (NewBmmData->DriverOptionOrder)) != 0) {  
 Status = Var_UpdateDriverOrder (Private);
-  }  
+  }
+
+  if (CompareMem (&NewBmmData->ConsoleOutMode, &OldBmmData->ConsoleOutMode, 
sizeof (NewBmmData->ConsoleOutMode)) != 0){
+Var_UpdateConMode(Private);
+  }
+
+  TerminalAttChange = FALSE;
+  for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
+
+//
+// only need update modified items
+//
+if (CompareMem (&NewBmmData->COMBaudRate[Index], 
&OldBmmData->COMBaudRate[I

[edk2] [PATCH] ShellBinPkg: Arm/AArch64 Shell binary update.

2015-08-19 Thread Ard Biesheuvel
The binaries of ShellBinPkg are generated with ShellPkg project 18222.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---

These are built with the tiny code model, note the code size reduction
for AARCH64.

Branch:
https://git.linaro.org/people/ard.biesheuvel/uefi-next.git/shortlog/refs/heads/binshell

 ShellBinPkg/MinUefiShell/AArch64/Shell.efi | Bin 408416 -> 387808 bytes
 ShellBinPkg/MinUefiShell/Arm/Shell.efi | Bin 324480 -> 330208 bytes
 ShellBinPkg/UefiShell/AArch64/Shell.efi| Bin 945152 -> 887136 bytes
 ShellBinPkg/UefiShell/Arm/Shell.efi| Bin 757728 -> 769536 bytes
 4 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/ShellBinPkg/MinUefiShell/AArch64/Shell.efi 
b/ShellBinPkg/MinUefiShell/AArch64/Shell.efi
index 7f63d86230e8..d5756e101342 100755
Binary files a/ShellBinPkg/MinUefiShell/AArch64/Shell.efi and 
b/ShellBinPkg/MinUefiShell/AArch64/Shell.efi differ
diff --git a/ShellBinPkg/MinUefiShell/Arm/Shell.efi 
b/ShellBinPkg/MinUefiShell/Arm/Shell.efi
index 782489af6960..8a7d7e5b7946 100755
Binary files a/ShellBinPkg/MinUefiShell/Arm/Shell.efi and 
b/ShellBinPkg/MinUefiShell/Arm/Shell.efi differ
diff --git a/ShellBinPkg/UefiShell/AArch64/Shell.efi 
b/ShellBinPkg/UefiShell/AArch64/Shell.efi
index 5a44a8ca6189..056da8d2932a 100755
Binary files a/ShellBinPkg/UefiShell/AArch64/Shell.efi and 
b/ShellBinPkg/UefiShell/AArch64/Shell.efi differ
diff --git a/ShellBinPkg/UefiShell/Arm/Shell.efi 
b/ShellBinPkg/UefiShell/Arm/Shell.efi
index 5a61df621047..afa91c4d6caf 100755
Binary files a/ShellBinPkg/UefiShell/Arm/Shell.efi and 
b/ShellBinPkg/UefiShell/Arm/Shell.efi differ
-- 
1.9.1

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


Re: [edk2] [PATCH v2] ArmPkg: remove ARMv6 support code

2015-08-19 Thread Ard Biesheuvel
On 19 August 2015 at 12:47, Leif Lindholm  wrote:
> On Wed, Aug 19, 2015 at 11:51:46AM +0200, Ard Biesheuvel wrote:
>> No platforms use the ARMv6 (ARM11) support code anymore. In fact, the
>> only reference to it in ArmPkg.dsc was commented out by Andrew in SVN
>> r11298 (2011-02-03) so it may well be broken. So remove it.
>
> 48h have passed.
> Reviewed-by: Leif Lindholm 
>

Thanks
Committed as SVN r18237

-- 
Ard.

>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Ard Biesheuvel 
>> ---
>> v2: remove more outdated '#ifdef ARM_CPU_ARMv6' from ArmLib
>>
>>  ArmPkg/ArmPkg.dsc  |   4 -
>>  ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11Lib.c |  37 ---
>>  ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11MpCoreLib.inf |  32 ---
>>  ArmPkg/Include/Library/ArmLib.h|   6 +-
>>  ArmPkg/Library/ArmLib/Arm11/Arm11Lib.c |  49 
>>  ArmPkg/Library/ArmLib/Arm11/Arm11Lib.inf   |  50 
>>  ArmPkg/Library/ArmLib/Arm11/Arm11LibMem.c  | 135 --
>>  ArmPkg/Library/ArmLib/Arm11/Arm11LibPrePi.inf  |  50 
>>  ArmPkg/Library/ArmLib/Arm11/Arm11LibSec.inf|  46 
>>  ArmPkg/Library/ArmLib/Arm11/Arm11Support.S | 257 
>> 
>>  ArmPkg/Library/ArmLib/Arm11/Arm11Support.asm   | 157 
>> 
>>  ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.S   |   6 -
>>  ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.asm |   6 -
>>  13 files changed, 1 insertion(+), 834 deletions(-)
>>
>> diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
>> index 10e8a1a83d46..1237eed65953 100644
>> --- a/ArmPkg/ArmPkg.dsc
>> +++ b/ArmPkg/ArmPkg.dsc
>> @@ -152,10 +152,6 @@ [Components.ARM]
>>ArmPkg/Drivers/ArmCpuLib/ArmCortexA9Lib/ArmCortexA9Lib.inf
>>ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.inf
>>
>> -#  ArmPkg/Library/ArmLib/Arm11/Arm11ArmLib.inf
>> -#  ArmPkg/Library/ArmLib/Arm11/Arm11ArmLibPrePi.inf
>> -#  ArmPkg/Library/ArmLib/Arm9/Arm9ArmLib.inf
>> -#  ArmPkg/Library/ArmLib/Arm9/Arm9ArmLibPrePi.inf
>>ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf
>>ArmPkg/Library/ArmLib/ArmV7/ArmV7LibPrePi.inf
>>
>> diff --git a/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11Lib.c 
>> b/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11Lib.c
>> deleted file mode 100644
>> index a08b7b1aee3f..
>> --- a/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11Lib.c
>> +++ /dev/null
>> @@ -1,37 +0,0 @@
>> -/** @file
>> -
>> -  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
>> -
>> -  This program and the accompanying materials
>> -  are licensed and made available under the terms and conditions of the BSD 
>> License
>> -  which accompanies this distribution.  The full text of the license may be 
>> found at
>> -  http://opensource.org/licenses/bsd-license.php
>> -
>> -  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
>> -  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
>> IMPLIED.
>> -
>> -**/
>> -
>> -#include 
>> -#include 
>> -#include 
>> -#include 
>> -#include 
>> -
>> -VOID
>> -ArmCpuSetup (
>> -  IN  UINTN MpId
>> -  )
>> -{
>> -  ASSERT(0); //TODO: Implement me
>> -}
>> -
>> -
>> -VOID
>> -ArmCpuSetupSmpNonSecure (
>> -  IN  UINTN MpId
>> -  )
>> -{
>> -  ASSERT(0); //TODO: Implement me
>> -}
>> -
>> diff --git a/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11MpCoreLib.inf 
>> b/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11MpCoreLib.inf
>> deleted file mode 100644
>> index 3a796c19d0cc..
>> --- a/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11MpCoreLib.inf
>> +++ /dev/null
>> @@ -1,32 +0,0 @@
>> -#/* @file
>> -#  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
>> -#
>> -#  This program and the accompanying materials
>> -#  are licensed and made available under the terms and conditions of the 
>> BSD License
>> -#  which accompanies this distribution.  The full text of the license may 
>> be found at
>> -#  http://opensource.org/licenses/bsd-license.php
>> -#
>> -#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
>> -#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
>> IMPLIED.
>> -#
>> -#*/
>> -
>> -[Defines]
>> -  INF_VERSION= 0x00010005
>> -  BASE_NAME  = Arm11MpCoreLib
>> -  FILE_GUID  = dc8a69e0-6be0-469c-94d3-5e6d71aa9808
>> -  MODULE_TYPE= BASE
>> -  VERSION_STRING = 1.0
>> -  LIBRARY_CLASS  = ArmCpuLib
>> -
>> -[Packages]
>> -  MdePkg/MdePkg.dec
>> -  ArmPkg/ArmPkg.dec
>> -
>> -[LibraryClasses]
>> -  ArmLib
>> -  IoLib
>> -  PcdLib
>> -
>> -[Sources.common]
>> -  Arm11Lib.c
>> diff --git a/ArmPkg/Include/Library/ArmLib.h 
>> b/ArmPkg/Include/Library/ArmLib.h
>> index 9effb3eea9bf..c83a5a7f1b3c 100644
>> --- a/ArmPkg/Include/Library/Ar

Re: [edk2] [PATCH v2] ArmPkg: remove ARMv6 support code

2015-08-19 Thread Leif Lindholm
On Wed, Aug 19, 2015 at 11:51:46AM +0200, Ard Biesheuvel wrote:
> No platforms use the ARMv6 (ARM11) support code anymore. In fact, the
> only reference to it in ArmPkg.dsc was commented out by Andrew in SVN
> r11298 (2011-02-03) so it may well be broken. So remove it.

48h have passed.
Reviewed-by: Leif Lindholm 

> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel 
> ---
> v2: remove more outdated '#ifdef ARM_CPU_ARMv6' from ArmLib
> 
>  ArmPkg/ArmPkg.dsc  |   4 -
>  ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11Lib.c |  37 ---
>  ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11MpCoreLib.inf |  32 ---
>  ArmPkg/Include/Library/ArmLib.h|   6 +-
>  ArmPkg/Library/ArmLib/Arm11/Arm11Lib.c |  49 
>  ArmPkg/Library/ArmLib/Arm11/Arm11Lib.inf   |  50 
>  ArmPkg/Library/ArmLib/Arm11/Arm11LibMem.c  | 135 --
>  ArmPkg/Library/ArmLib/Arm11/Arm11LibPrePi.inf  |  50 
>  ArmPkg/Library/ArmLib/Arm11/Arm11LibSec.inf|  46 
>  ArmPkg/Library/ArmLib/Arm11/Arm11Support.S | 257 
> 
>  ArmPkg/Library/ArmLib/Arm11/Arm11Support.asm   | 157 
>  ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.S   |   6 -
>  ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.asm |   6 -
>  13 files changed, 1 insertion(+), 834 deletions(-)
> 
> diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
> index 10e8a1a83d46..1237eed65953 100644
> --- a/ArmPkg/ArmPkg.dsc
> +++ b/ArmPkg/ArmPkg.dsc
> @@ -152,10 +152,6 @@ [Components.ARM]
>ArmPkg/Drivers/ArmCpuLib/ArmCortexA9Lib/ArmCortexA9Lib.inf
>ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.inf
>  
> -#  ArmPkg/Library/ArmLib/Arm11/Arm11ArmLib.inf
> -#  ArmPkg/Library/ArmLib/Arm11/Arm11ArmLibPrePi.inf
> -#  ArmPkg/Library/ArmLib/Arm9/Arm9ArmLib.inf
> -#  ArmPkg/Library/ArmLib/Arm9/Arm9ArmLibPrePi.inf
>ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf
>ArmPkg/Library/ArmLib/ArmV7/ArmV7LibPrePi.inf
>  
> diff --git a/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11Lib.c 
> b/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11Lib.c
> deleted file mode 100644
> index a08b7b1aee3f..
> --- a/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11Lib.c
> +++ /dev/null
> @@ -1,37 +0,0 @@
> -/** @file
> -
> -  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
> -
> -  This program and the accompanying materials
> -  are licensed and made available under the terms and conditions of the BSD 
> License
> -  which accompanies this distribution.  The full text of the license may be 
> found at
> -  http://opensource.org/licenses/bsd-license.php
> -
> -  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> -  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> -
> -**/
> -
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -
> -VOID
> -ArmCpuSetup (
> -  IN  UINTN MpId
> -  )
> -{
> -  ASSERT(0); //TODO: Implement me
> -}
> -
> -
> -VOID
> -ArmCpuSetupSmpNonSecure (
> -  IN  UINTN MpId
> -  )
> -{
> -  ASSERT(0); //TODO: Implement me
> -}
> -
> diff --git a/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11MpCoreLib.inf 
> b/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11MpCoreLib.inf
> deleted file mode 100644
> index 3a796c19d0cc..
> --- a/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11MpCoreLib.inf
> +++ /dev/null
> @@ -1,32 +0,0 @@
> -#/* @file
> -#  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
> -#
> -#  This program and the accompanying materials
> -#  are licensed and made available under the terms and conditions of the BSD 
> License
> -#  which accompanies this distribution.  The full text of the license may be 
> found at
> -#  http://opensource.org/licenses/bsd-license.php
> -#
> -#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> -#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> -#
> -#*/
> -
> -[Defines]
> -  INF_VERSION= 0x00010005
> -  BASE_NAME  = Arm11MpCoreLib
> -  FILE_GUID  = dc8a69e0-6be0-469c-94d3-5e6d71aa9808
> -  MODULE_TYPE= BASE
> -  VERSION_STRING = 1.0
> -  LIBRARY_CLASS  = ArmCpuLib
> -
> -[Packages]
> -  MdePkg/MdePkg.dec
> -  ArmPkg/ArmPkg.dec
> -
> -[LibraryClasses]
> -  ArmLib
> -  IoLib
> -  PcdLib
> -
> -[Sources.common]
> -  Arm11Lib.c
> diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h
> index 9effb3eea9bf..c83a5a7f1b3c 100644
> --- a/ArmPkg/Include/Library/ArmLib.h
> +++ b/ArmPkg/Include/Library/ArmLib.h
> @@ -19,11 +19,7 @@
>  #include 
>  
>  #ifdef MDE_CPU_ARM
> -  #ifdef ARM_CPU_ARMv6
> -#include 
> -  #else
> -#include 
> -  #endif
> +  #include 
>  #elif defined(MDE_CPU_AARC

[edk2] [PATCH v2] ArmPkg: remove ARMv6 support code

2015-08-19 Thread Ard Biesheuvel
No platforms use the ARMv6 (ARM11) support code anymore. In fact, the
only reference to it in ArmPkg.dsc was commented out by Andrew in SVN
r11298 (2011-02-03) so it may well be broken. So remove it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---
v2: remove more outdated '#ifdef ARM_CPU_ARMv6' from ArmLib

 ArmPkg/ArmPkg.dsc  |   4 -
 ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11Lib.c |  37 ---
 ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11MpCoreLib.inf |  32 ---
 ArmPkg/Include/Library/ArmLib.h|   6 +-
 ArmPkg/Library/ArmLib/Arm11/Arm11Lib.c |  49 
 ArmPkg/Library/ArmLib/Arm11/Arm11Lib.inf   |  50 
 ArmPkg/Library/ArmLib/Arm11/Arm11LibMem.c  | 135 --
 ArmPkg/Library/ArmLib/Arm11/Arm11LibPrePi.inf  |  50 
 ArmPkg/Library/ArmLib/Arm11/Arm11LibSec.inf|  46 
 ArmPkg/Library/ArmLib/Arm11/Arm11Support.S | 257 

 ArmPkg/Library/ArmLib/Arm11/Arm11Support.asm   | 157 
 ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.S   |   6 -
 ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.asm |   6 -
 13 files changed, 1 insertion(+), 834 deletions(-)

diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
index 10e8a1a83d46..1237eed65953 100644
--- a/ArmPkg/ArmPkg.dsc
+++ b/ArmPkg/ArmPkg.dsc
@@ -152,10 +152,6 @@ [Components.ARM]
   ArmPkg/Drivers/ArmCpuLib/ArmCortexA9Lib/ArmCortexA9Lib.inf
   ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.inf
 
-#  ArmPkg/Library/ArmLib/Arm11/Arm11ArmLib.inf
-#  ArmPkg/Library/ArmLib/Arm11/Arm11ArmLibPrePi.inf
-#  ArmPkg/Library/ArmLib/Arm9/Arm9ArmLib.inf
-#  ArmPkg/Library/ArmLib/Arm9/Arm9ArmLibPrePi.inf
   ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf
   ArmPkg/Library/ArmLib/ArmV7/ArmV7LibPrePi.inf
 
diff --git a/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11Lib.c 
b/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11Lib.c
deleted file mode 100644
index a08b7b1aee3f..
--- a/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11Lib.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
-
-  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
-
-  This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD 
License
-  which accompanies this distribution.  The full text of the license may be 
found at
-  http://opensource.org/licenses/bsd-license.php
-
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-VOID
-ArmCpuSetup (
-  IN  UINTN MpId
-  )
-{
-  ASSERT(0); //TODO: Implement me
-}
-
-
-VOID
-ArmCpuSetupSmpNonSecure (
-  IN  UINTN MpId
-  )
-{
-  ASSERT(0); //TODO: Implement me
-}
-
diff --git a/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11MpCoreLib.inf 
b/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11MpCoreLib.inf
deleted file mode 100644
index 3a796c19d0cc..
--- a/ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11MpCoreLib.inf
+++ /dev/null
@@ -1,32 +0,0 @@
-#/* @file
-#  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
-#
-#  This program and the accompanying materials
-#  are licensed and made available under the terms and conditions of the BSD 
License
-#  which accompanies this distribution.  The full text of the license may be 
found at
-#  http://opensource.org/licenses/bsd-license.php
-#
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
-#
-#*/
-
-[Defines]
-  INF_VERSION= 0x00010005
-  BASE_NAME  = Arm11MpCoreLib
-  FILE_GUID  = dc8a69e0-6be0-469c-94d3-5e6d71aa9808
-  MODULE_TYPE= BASE
-  VERSION_STRING = 1.0
-  LIBRARY_CLASS  = ArmCpuLib
-
-[Packages]
-  MdePkg/MdePkg.dec
-  ArmPkg/ArmPkg.dec
-
-[LibraryClasses]
-  ArmLib
-  IoLib
-  PcdLib
-
-[Sources.common]
-  Arm11Lib.c
diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h
index 9effb3eea9bf..c83a5a7f1b3c 100644
--- a/ArmPkg/Include/Library/ArmLib.h
+++ b/ArmPkg/Include/Library/ArmLib.h
@@ -19,11 +19,7 @@
 #include 
 
 #ifdef MDE_CPU_ARM
-  #ifdef ARM_CPU_ARMv6
-#include 
-  #else
-#include 
-  #endif
+  #include 
 #elif defined(MDE_CPU_AARCH64)
   #include 
 #else
diff --git a/ArmPkg/Library/ArmLib/Arm11/Arm11Lib.c 
b/ArmPkg/Library/ArmLib/Arm11/Arm11Lib.c
deleted file mode 100644
index 8c54b6cc8fd5..
--- a/ArmPkg/Library/ArmLib/Arm11/Arm11Lib.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/** @file
-
-  Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-  Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.
-
-  

[edk2] [PATCH v2 2/2] BaseTools AARCH64: use tiny code model by default

2015-08-19 Thread Ard Biesheuvel
The AARCH64 tiny code model produces more efficient code, since it
uses relative symbol references rather than absolute references, i.e.,
an emitted relative reference refers to the symbol directly rather
than a literal containing its 64-bit absolute address. This saves
space in the binary, and reduces the number of relocation fixups that
need to be applied by the PE/COFF loader.

So now that we support relative relocations in GenFw, move to the
tiny code model by default. Note that the large model can still be
selected by individual modules by adding -mcmodel=large to the
appropriate CC_FLAGS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
Reviewed-by: Laszlo Ersek 
Reviewed-by: Leif Lindholm 
Tested-by: Leif Lindholm 
---
 BaseTools/Conf/tools_def.template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index 5e710dce3e86..aa2b6b1488c4 100644
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -3812,7 +3812,7 @@ DEFINE GCC_IA32_CC_FLAGS   = 
DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -
 DEFINE GCC_X64_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS) -mno-red-zone 
-Wno-address -mno-stack-arg-probe
 DEFINE GCC_IPF_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS) 
-minline-int-divide-min-latency
 DEFINE GCC_ARM_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS) -mword-relocations 
-mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char 
-ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb 
-mfloat-abi=soft
-DEFINE GCC_AARCH64_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS) -mcmodel=large 
-mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char  
-ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin 
-Wno-address -fno-asynchronous-unwind-tables
+DEFINE GCC_AARCH64_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS) -mcmodel=tiny 
-mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char  
-ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin 
-Wno-address -fno-asynchronous-unwind-tables
 DEFINE GCC_DLINK_FLAGS_COMMON  = -nostdlib --pie
 DEFINE GCC_DLINK2_FLAGS_COMMON = 
--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
 DEFINE GCC_IA32_X64_DLINK_COMMON   = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections
-- 
1.9.1

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


[edk2] [PATCH v2 0/2] AARCH64 tiny code model support

2015-08-19 Thread Ard Biesheuvel
The AARCH64 GCC builds use the GCC large code model by default, simply
because it is the code model that requires the least amount of hacking
to produce code that supports the PE/COFF conversion applied by Tianocore.

However, it is suboptimal in more than one way:
- each symbol reference requires a PC-relative literal load (to obtain the
  address of the memory location that stores the address of the symbol) and 8
  bytes to store the address itself, so it uses more space than necessary;
- loading the symbol address may stall on the D-cache
- each symbol address is an absolute address which requires fixing up by the
  PE/COFF loader
- the large model is not recommended by the GCC developers, and not used very
  widely so it does not receive a lot of testing coverage.

Now that we can support relative AARCH64 relocations, we can actually switch to
the GCC tiny code model, which does away with the literals, and simply uses
PC-relative references to refer to the symbol directly. This does impose a
1 MB size limit on modules, but this limit is exceeded only very rarely, and
we can work around it by switching to the small or large model in that case.

Patch #1 overrides the BuildOptions for the DEBUG Shell build to use the small
model, since its size exceeds the 1 MB limit.

Patch #2 sets the AARCH64 code model to 'tiny' by default.

For the ArmVirtQemu AARCH64 RELEASE build, the size reduction is 10% before
compression, 3% after compression, with the number of PE/COFF fixups reduced
by 80% (see below for details)

Ard Biesheuvel (2):
  ShellPkg: force use of AARCH64 small model when building DEBUG shell
  BaseTools AARCH64: use tiny code model by default

 BaseTools/Conf/tools_def.template| 2 +-
 ShellPkg/Application/Shell/Shell.inf | 6 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

-- 
1.9.1

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


[edk2] [PATCH v2 1/2] ShellPkg: force use of AARCH64 small model when building DEBUG shell

2015-08-19 Thread Ard Biesheuvel
The tiny code model used by AARCH64 only supports binaries of up to
1 MB in size. Since the Shell application exceeds that when built in
DEBUG mode, make sure we build it using the small code model instead.

Cc: Jaben Carsey ,
Cc: Shumin Qiu 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
Reviewed-by: Leif Lindholm 
Tested-by: Leif Lindholm 
---
 ShellPkg/Application/Shell/Shell.inf | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/ShellPkg/Application/Shell/Shell.inf 
b/ShellPkg/Application/Shell/Shell.inf
index f7039369227c..09aecf717bd7 100644
--- a/ShellPkg/Application/Shell/Shell.inf
+++ b/ShellPkg/Application/Shell/Shell.inf
@@ -108,3 +108,9 @@ [Pcd]
   gEfiShellPkgTokenSpaceGuid.PcdShellForceConsole ## CONSUMES
   gEfiShellPkgTokenSpaceGuid.PcdShellSupplier ## CONSUMES
 
+[BuildOptions.AARCH64]
+  # The tiny code model used by AARCH64 only supports binaries of up to 1 MB in
+  # size. Since the Shell application exceeds that when built in DEBUG mode,
+  # make sure we build it using the small code model instead.
+  GCC:DEBUG_*_*_CC_FLAGS = -mcmodel=small
+  GCC:DEBUG_*_*_DLINK_FLAGS = -z common-page-size=0x1000
-- 
1.9.1

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


Re: [edk2] [Patch] MdeModulePkg: Update UiApp to handle terminal type TtyTerm

2015-08-19 Thread Dong, Eric
Reviewed-by: Eric Dong 

-Original Message-
From: Ni, Ruiyu 
Sent: Wednesday, August 19, 2015 5:35 PM
To: edk2-devel@lists.01.org
Cc: Ni, Ruiyu; Dong, Eric
Subject: [Patch] MdeModulePkg: Update UiApp to handle terminal type TtyTerm

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni 
Cc: Eric Dong 
---
 .../Application/UiApp/BootMaint/Bmstring.uni| Bin 41522 -> 41794 bytes
 .../Application/UiApp/BootMaint/BootMaint.h |   8 +---
 .../Application/UiApp/BootMaint/ConsoleOption.c |   9 +++--
 MdeModulePkg/Application/UiApp/BootMaint/Data.c |   6 --
 .../Application/UiApp/BootMaint/UpdatePage.c|   2 +-
 5 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni 
b/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni
index 
8d9544db450322835972597234a07d76207e1102..a208127ac6ea76ec5dde6824babf05583a1cfa8d
 100644 GIT binary patch delta 66
zcmdmVgz3;RrVSN6lLNYh7)>T8vMEoVz^1|#4)VKkE8
JT+y>j6ad0a6I=iQ

delta 14
WcmX?fjA_#mrVSN6n>%`Ui2?vQ4+l;F

diff --git a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h 
b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
index 69cf760..e1ac307 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
+++ b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
@@ -18,6 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 #include "Ui.h"
 #include "FormGuid.h"
 #include "FrontPage.h"
+#include 
 
 //
 // Constants which are variable names used to access variables @@ -81,7 +82,8 
@@ typedef enum _TYPE_OF_TERMINAL {
   TerminalTypePcAnsi = 0,
   TerminalTypeVt100,
   TerminalTypeVt100Plus,
-  TerminalTypeVtUtf8
+  TerminalTypeVtUtf8,
+  TerminalTypeTtyTerm
 } TYPE_OF_TERMINAL;
 
 typedef enum _FILE_EXPLORER_STATE {
@@ -1452,12 +1454,12 @@ extern BM_MENU_OPTION ConsoleErrMenu;
 extern BM_MENU_OPTION DirectoryMenu;
 extern BM_MENU_OPTION DriverMenu;
 extern BM_MENU_OPTION TerminalMenu;
-extern UINT16 TerminalType[];
+extern UINT16 TerminalType[5];
 extern COM_ATTR   BaudRateList[19];
 extern COM_ATTR   DataBitsList[4];
 extern COM_ATTR   ParityList[5];
 extern COM_ATTR   StopBitsList[3];
-extern EFI_GUID   TerminalTypeGuid[4];
+extern EFI_GUID   TerminalTypeGuid[5];
 extern STRING_DEPOSITORY  *FileOptionStrDepository;
 extern STRING_DEPOSITORY  *ConsoleOptionStrDepository;
 extern STRING_DEPOSITORY  *BootOptionStrDepository;
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c 
b/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c
index d86c733..f164db2 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c
@@ -564,7 +564,7 @@ LocateSerialIo (
 Vendor.Header.Type= MESSAGING_DEVICE_PATH;
 Vendor.Header.SubType = MSG_VENDOR_DP;
 
-for (Index2 = 0; Index2 < 4; Index2++) {
+for (Index2 = 0; Index2 < (sizeof (TerminalTypeGuid) / sizeof 
+ (TerminalTypeGuid[0])); Index2++) {
   CopyMem (&Vendor.Guid, &TerminalTypeGuid[Index2], sizeof (EFI_GUID));
   SetDevicePathNodeLength (&Vendor.Header, sizeof (VENDOR_DEVICE_PATH));
   NewDevicePath = AppendDevicePathNode ( @@ -940,7 +940,12 @@ 
IsTerminalDevicePath (
   *Termi  = TerminalTypeVtUtf8;
   IsTerminal  = TRUE;
 } else {
-  IsTerminal = FALSE;
+  if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[4])) {
+*Termi  = TerminalTypeTtyTerm;
+IsTerminal  = TRUE;
+  } else {
+IsTerminal = FALSE;
+  }
 }
   }
 }
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/Data.c 
b/MdeModulePkg/Application/UiApp/BootMaint/Data.c
index 7e86211..caf6c60 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/Data.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/Data.c
@@ -35,6 +35,7 @@ UINT16  TerminalType[] = {
   STRING_TOKEN(STR_COM_TYPE_1),
   STRING_TOKEN(STR_COM_TYPE_2),
   STRING_TOKEN(STR_COM_TYPE_3),
+  STRING_TOKEN(STR_COM_TYPE_4),
 };
 
 ///
@@ -266,9 +267,10 @@ COM_ATTRStopBitsList[3] = {
 ///
 /// Guid for messaging path, used in Serial port setting.
 ///
-EFI_GUIDTerminalTypeGuid[4] = {
+EFI_GUIDTerminalTypeGuid[] = {
   DEVICE_PATH_MESSAGING_PC_ANSI,
   DEVICE_PATH_MESSAGING_VT_100,
   DEVICE_PATH_MESSAGING_VT_100_PLUS,
-  DEVICE_PATH_MESSAGING_VT_UTF8
+  DEVICE_PATH_MESSAGING_VT_UTF8,
+  EFI_TTY_TERM_GUID
 };
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c 
b/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c
index d85f2ea..26de91b 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/UpdatePag

[edk2] [Patch] MdeModulePkg: Update UiApp to handle terminal type TtyTerm

2015-08-19 Thread Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni 
Cc: Eric Dong 
---
 .../Application/UiApp/BootMaint/Bmstring.uni| Bin 41522 -> 41794 bytes
 .../Application/UiApp/BootMaint/BootMaint.h |   8 +---
 .../Application/UiApp/BootMaint/ConsoleOption.c |   9 +++--
 MdeModulePkg/Application/UiApp/BootMaint/Data.c |   6 --
 .../Application/UiApp/BootMaint/UpdatePage.c|   2 +-
 5 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni 
b/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni
index 
8d9544db450322835972597234a07d76207e1102..a208127ac6ea76ec5dde6824babf05583a1cfa8d
 100644
GIT binary patch
delta 66
zcmdmVgz3;RrVSN6lLNYh7)>T8vMEoVz^1|#4)VKkE8
JT+y>j6ad0a6I=iQ

delta 14
WcmX?fjA_#mrVSN6n>%`Ui2?vQ4+l;F

diff --git a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h 
b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
index 69cf760..e1ac307 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
+++ b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
@@ -18,6 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 #include "Ui.h"
 #include "FormGuid.h"
 #include "FrontPage.h"
+#include 
 
 //
 // Constants which are variable names used to access variables
@@ -81,7 +82,8 @@ typedef enum _TYPE_OF_TERMINAL {
   TerminalTypePcAnsi = 0,
   TerminalTypeVt100,
   TerminalTypeVt100Plus,
-  TerminalTypeVtUtf8
+  TerminalTypeVtUtf8,
+  TerminalTypeTtyTerm
 } TYPE_OF_TERMINAL;
 
 typedef enum _FILE_EXPLORER_STATE {
@@ -1452,12 +1454,12 @@ extern BM_MENU_OPTION ConsoleErrMenu;
 extern BM_MENU_OPTION DirectoryMenu;
 extern BM_MENU_OPTION DriverMenu;
 extern BM_MENU_OPTION TerminalMenu;
-extern UINT16 TerminalType[];
+extern UINT16 TerminalType[5];
 extern COM_ATTR   BaudRateList[19];
 extern COM_ATTR   DataBitsList[4];
 extern COM_ATTR   ParityList[5];
 extern COM_ATTR   StopBitsList[3];
-extern EFI_GUID   TerminalTypeGuid[4];
+extern EFI_GUID   TerminalTypeGuid[5];
 extern STRING_DEPOSITORY  *FileOptionStrDepository;
 extern STRING_DEPOSITORY  *ConsoleOptionStrDepository;
 extern STRING_DEPOSITORY  *BootOptionStrDepository;
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c 
b/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c
index d86c733..f164db2 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c
@@ -564,7 +564,7 @@ LocateSerialIo (
 Vendor.Header.Type= MESSAGING_DEVICE_PATH;
 Vendor.Header.SubType = MSG_VENDOR_DP;
 
-for (Index2 = 0; Index2 < 4; Index2++) {
+for (Index2 = 0; Index2 < (sizeof (TerminalTypeGuid) / sizeof 
(TerminalTypeGuid[0])); Index2++) {
   CopyMem (&Vendor.Guid, &TerminalTypeGuid[Index2], sizeof (EFI_GUID));
   SetDevicePathNodeLength (&Vendor.Header, sizeof (VENDOR_DEVICE_PATH));
   NewDevicePath = AppendDevicePathNode (
@@ -940,7 +940,12 @@ IsTerminalDevicePath (
   *Termi  = TerminalTypeVtUtf8;
   IsTerminal  = TRUE;
 } else {
-  IsTerminal = FALSE;
+  if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[4])) {
+*Termi  = TerminalTypeTtyTerm;
+IsTerminal  = TRUE;
+  } else {
+IsTerminal = FALSE;
+  }
 }
   }
 }
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/Data.c 
b/MdeModulePkg/Application/UiApp/BootMaint/Data.c
index 7e86211..caf6c60 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/Data.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/Data.c
@@ -35,6 +35,7 @@ UINT16  TerminalType[] = {
   STRING_TOKEN(STR_COM_TYPE_1),
   STRING_TOKEN(STR_COM_TYPE_2),
   STRING_TOKEN(STR_COM_TYPE_3),
+  STRING_TOKEN(STR_COM_TYPE_4),
 };
 
 ///
@@ -266,9 +267,10 @@ COM_ATTRStopBitsList[3] = {
 ///
 /// Guid for messaging path, used in Serial port setting.
 ///
-EFI_GUIDTerminalTypeGuid[4] = {
+EFI_GUIDTerminalTypeGuid[] = {
   DEVICE_PATH_MESSAGING_PC_ANSI,
   DEVICE_PATH_MESSAGING_VT_100,
   DEVICE_PATH_MESSAGING_VT_100_PLUS,
-  DEVICE_PATH_MESSAGING_VT_UTF8
+  DEVICE_PATH_MESSAGING_VT_UTF8,
+  EFI_TTY_TERM_GUID
 };
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c 
b/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c
index d85f2ea..26de91b 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c
@@ -1056,7 +1056,7 @@ UpdateTerminalPage (
   OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
   ASSERT (OptionsOpCodeHandle != NULL);
 
-  for (Index = 0; Index < 4; Index++) {
+

Re: [edk2] [PATCH 2/2] BaseTools AARCH64: use tiny code model by default

2015-08-19 Thread Leif Lindholm
On Mon, Aug 10, 2015 at 12:27:27PM +0200, Ard Biesheuvel wrote:
> The AARCH64 tiny code model produces more efficient code, since it
> uses relative symbol references rather than absolute references, i.e.,
> an emitted relative reference refers to the symbol directly rather
> than a literal containing its 64-bit absolute address. This saves
> space in the binary, and reduces the number of relocation fixups that
> need to be applied by the PE/COFF loader.
> 
> So now that we support relative relocations in GenFw, move to the
> tiny code model by default. Note that the large model can still be
> selected by individual modules by adding -mcmodel=large to the
> appropriate CC_FLAGS.

Once ShellPkg situation resolves one way or the other:
Reviewed-by: Leif Lindholm 
Tested-by: Leif Lindholm 

Thanks for this.

/
Leif

> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel 
> ---
>  BaseTools/Conf/tools_def.template | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Conf/tools_def.template 
> b/BaseTools/Conf/tools_def.template
> index 0c41c862af83..918348757767 100644
> --- a/BaseTools/Conf/tools_def.template
> +++ b/BaseTools/Conf/tools_def.template
> @@ -3824,7 +3824,7 @@ DEFINE GCC_IA32_CC_FLAGS   = 
> DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -
>  DEFINE GCC_X64_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS) -mno-red-zone 
> -Wno-address -mno-stack-arg-probe
>  DEFINE GCC_IPF_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS) 
> -minline-int-divide-min-latency
>  DEFINE GCC_ARM_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS) 
> -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums 
> -save-temps -fsigned-char -ffunction-sections -fdata-sections 
> -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft
> -DEFINE GCC_AARCH64_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS) -mcmodel=large 
> -mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char  
> -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin 
> -Wno-address -fno-asynchronous-unwind-tables
> +DEFINE GCC_AARCH64_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS) -mcmodel=tiny 
> -mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char  
> -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin 
> -Wno-address -fno-asynchronous-unwind-tables
>  DEFINE GCC_DLINK_FLAGS_COMMON  = -nostdlib --pie
>  DEFINE GCC_DLINK2_FLAGS_COMMON = 
> --script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
>  DEFINE GCC_IA32_X64_DLINK_COMMON   = DEF(GCC_DLINK_FLAGS_COMMON) 
> --gc-sections
> -- 
> 1.9.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 1/2] ArmVirtPkg: build our DEBUG Shell using the small code model

2015-08-19 Thread Leif Lindholm
Hi Ard,

Apologies for tardiness.

Could we move this into ShellPkg instead, since the mcmodel=tiny is
globally applied for AARCH64, and any other direct consumers would
also be affected by 2/2?

/
Leif

On Mon, Aug 10, 2015 at 12:27:26PM +0200, Ard Biesheuvel wrote:
> The DEBUG build of the Shell exceeds 1 MB in size, which means that
> it cannot be built using the tiny code model. So force the use of
> the code model in this case.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel 
> ---
>  ArmVirtPkg/ArmVirt.dsc.inc | 9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
> index 7bba6eba05a8..1ff126b2f6dc 100644
> --- a/ArmVirtPkg/ArmVirt.dsc.inc
> +++ b/ArmVirtPkg/ArmVirt.dsc.inc
> @@ -406,4 +406,13 @@ [Components.common]
>gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF
>gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
>gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
> +
> +
> +  #
> +  # The DEBUG target of the Shell module may well end up being over 1 MB
> +  # in size, which exceeds the range of the AArch64 tiny code model. So
> +  # override the code model to 'small' in this case.
> +  #
> +  GCC:DEBUG_*_AARCH64_CC_FLAGS = -mcmodel=small
> +  GCC:DEBUG_*_AARCH64_DLINK_FLAGS = -z common-page-size=0x1000
>}
> -- 
> 1.9.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] ShellPkg: Fix 'ifconfig' getting the address from dhcp error

2015-08-19 Thread Jiaxin Wu
R18201 fix caused ifconfig in shell failed to get the address from dhcp with the
command "ifconfig -s eth0 dhcp" since the default policy is dhcp already.
We can fix it by following the rule to starting the Ip4 auto configuration.

Cc: Ye Ting 
Cc: Zhang Lubo 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu 
---
 .../UefiShellNetwork1CommandsLib/Ifconfig.c| 115 ++---
 1 file changed, 100 insertions(+), 15 deletions(-)

diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c 
b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
index df19a9f..273f1a8 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
@@ -273,10 +273,89 @@ IfConfigManualAddressNotify (
   *((BOOLEAN *) Context) = TRUE;
 }
 
 
 /**
+  Create an IP child, use it to start the auto configuration, then destroy it.
+
+  @param[in] Controller   The controller which has the service installed.
+  @param[in] ImageThe image handle used to open service.
+
+  @retval EFI_SUCCESS The configuration is done.
+**/
+EFI_STATUS
+EFIAPI
+IfConfigStartIp4(
+  IN  EFI_HANDLEController,
+  IN  EFI_HANDLEImage
+  )
+{
+  EFI_IP4_PROTOCOL  *Ip4;
+  EFI_HANDLEIp4Handle;
+  EFI_IP4_CONFIG_DATA   Ip4ConfigData;
+  EFI_STATUSStatus;
+
+  //
+  // Get the Ip4ServiceBinding Protocol
+  //
+  Ip4Handle = NULL;
+  Ip4   = NULL;
+
+  Status = NetLibCreateServiceChild (
+ Controller,
+ Image,
+ &gEfiIp4ServiceBindingProtocolGuid,
+ &Ip4Handle
+ );
+
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+
+  Status = gBS->OpenProtocol (
+ Ip4Handle,
+ &gEfiIp4ProtocolGuid,
+ (VOID **) &Ip4,
+ Controller,
+ Image,
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL
+ );
+
+  if (EFI_ERROR (Status)) {
+goto ON_EXIT;
+  }
+
+  Ip4ConfigData.DefaultProtocol  = EFI_IP_PROTO_ICMP;
+  Ip4ConfigData.AcceptAnyProtocol= FALSE;
+  Ip4ConfigData.AcceptIcmpErrors = FALSE;
+  Ip4ConfigData.AcceptBroadcast  = FALSE;
+  Ip4ConfigData.AcceptPromiscuous= FALSE;
+  Ip4ConfigData.UseDefaultAddress= TRUE;
+  ZeroMem (&Ip4ConfigData.StationAddress, sizeof (EFI_IPv4_ADDRESS));
+  ZeroMem (&Ip4ConfigData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
+  Ip4ConfigData.TypeOfService= 0;
+  Ip4ConfigData.TimeToLive   = 1;
+  Ip4ConfigData.DoNotFragment= FALSE;
+  Ip4ConfigData.RawData  = FALSE;
+  Ip4ConfigData.ReceiveTimeout   = 0;
+  Ip4ConfigData.TransmitTimeout  = 0;
+
+  Ip4->Configure (Ip4, &Ip4ConfigData);
+  
+ON_EXIT: 
+  NetLibDestroyServiceChild (
+Controller,
+Image,
+&gEfiIp4ServiceBindingProtocolGuid,
+Ip4Handle
+);
+  
+  return Status;
+}
+
+
+/**
   Print MAC address.
 
   @param[in]NodeThe pointer of MAC address buffer.
   @param[in]SizeThe size of MAC address buffer.
 
@@ -872,25 +951,31 @@ IfConfigSetInterfaceInfo (
 
 //
 // Process valid variables.
 //
 if (StrCmp(VarArg->Arg, L"dhcp") == 0) {
-  //
-  // Set dhcp config policy
-  //
-  Policy = Ip4Config2PolicyDhcp;
-  Status = IfCb->IfCfg->SetData (
-  IfCb->IfCfg,
-  Ip4Config2DataTypePolicy,
-  sizeof (EFI_IP4_CONFIG2_POLICY),
-  &Policy
-  );
-
-  if (EFI_ERROR(Status)) {
-goto ON_EXIT;
+  if (IfCb->Policy == Ip4Config2PolicyDhcp) {
+Status = IfConfigStartIp4 (IfCb->NicHandle, gImageHandle);
+if (EFI_ERROR(Status)) {
+  goto ON_EXIT;
+}
+  } else {
+//
+// Set dhcp config policy
+//
+Policy = Ip4Config2PolicyDhcp;
+Status = IfCb->IfCfg->SetData (
+IfCb->IfCfg,
+Ip4Config2DataTypePolicy,
+sizeof (EFI_IP4_CONFIG2_POLICY),
+&Policy
+);
+if (EFI_ERROR(Status)) {
+  goto ON_EXIT;
+}
   }
-
+  
   VarArg= VarArg->Next;
 
 } else if (StrCmp (VarArg->Arg, L"static") == 0) {
   //
   // Set manual config policy.
@@ -1036,11 +1121,11 @@ IfConfigSetInterfaceInfo (
 ON_EXIT:
   if (Dns != NULL) {
 FreePool (Dns);
   }
   
-  return EFI_SUCCESS;
+  return Status;
 
 }
 
 /**
   The ifconfig command main process.
-- 
1.9.5.msysgit.1

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


[edk2] [Patch] MdeModulePkg: Fix default router table and interface missing error

2015-08-19 Thread Jiaxin Wu
Ip4StartAutoConfig() will always free its default router table and interface,
which may cause IP instance missing its correct default interface. e.g. when
the policy is dhcp, and one child is configured to use default address.

Cc: Ye Ting 
Cc: Zhang Lubo 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu 
---
 .../Universal/Network/Ip4Dxe/Ip4Config2Impl.c  | 74 --
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c  |  4 ++
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c|  2 +
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h|  2 +
 4 files changed, 49 insertions(+), 33 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
index caf84fb..637d7cd 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
@@ -147,10 +147,11 @@ Ip4Config2OnPolicyChanged (
 
   //
   // Start the dhcp configuration.
   //
   if (NewPolicy == Ip4Config2PolicyDhcp) {
+IpSb->Reconfig = TRUE;
 Ip4StartAutoConfig (&IpSb->Ip4Config2Instance);
   }
 
 }
 
@@ -461,72 +462,72 @@ Ip4Config2OnDhcp4SbInstalled (
 }
 
 /**
   Set the station address and subnetmask for the default interface.
 
-  @param[in]  Instance   The pointer to the IP4 config2 instance data.
+  @param[in]  IpSb   The pointer to the IP4 service binding 
instance.
   @param[in]  StationAddress Ip address to be set.
   @param[in]  SubnetMask Subnet to be set.
 
   @retval EFI_SUCCESS   Set default address successful. 
   @retval OthersSome errors occur in setting. 
 
 **/
 EFI_STATUS
 Ip4Config2SetDefaultAddr (
-  IN IP4_CONFIG2_INSTANCE   *Instance,
+  IN IP4_SERVICE*IpSb,
   IN IP4_ADDR   StationAddress,
   IN IP4_ADDR   SubnetMask
   )
 {
   EFI_STATUSStatus;
-  IP4_SERVICE   *IpSb;
   IP4_INTERFACE *IpIf;
   IP4_PROTOCOL  *Ip4Instance;
   EFI_ARP_PROTOCOL  *Arp;
   LIST_ENTRY*Entry;
   IP4_ADDR  Subnet;
   IP4_ROUTE_TABLE   *RouteTable;
 
-  IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
   IpIf = IpSb->DefaultInterface;
   ASSERT (IpIf != NULL);
 
   if ((IpIf->Ip == StationAddress) && (IpIf->SubnetMask == SubnetMask)) {
 IpSb->State = IP4_SERVICE_CONFIGED;
 return EFI_SUCCESS;
   }
 
-  //
-  // The default address is changed, free the previous interface first.
-  //
-  if (IpSb->DefaultRouteTable != NULL) {
-Ip4FreeRouteTable (IpSb->DefaultRouteTable);
-IpSb->DefaultRouteTable = NULL;
-  }
+  if (IpSb->Reconfig) {
+//
+// The default address is changed, free the previous interface first.
+//
+if (IpSb->DefaultRouteTable != NULL) {
+  Ip4FreeRouteTable (IpSb->DefaultRouteTable);
+  IpSb->DefaultRouteTable = NULL;
+}
 
-  Ip4CancelReceive (IpSb->DefaultInterface);
-  Ip4FreeInterface (IpSb->DefaultInterface, NULL);
-  IpSb->DefaultInterface = NULL;
-  //
-  // Create new default interface and route table.
-  //
-  IpIf = Ip4CreateInterface (IpSb->Mnp, IpSb->Controller, IpSb->Image);
-  if (IpIf == NULL) {
-return EFI_OUT_OF_RESOURCES;
-  }
+Ip4CancelReceive (IpSb->DefaultInterface);
+Ip4FreeInterface (IpSb->DefaultInterface, NULL);
+IpSb->DefaultInterface = NULL;
+//
+// Create new default interface and route table.
+//
+IpIf = Ip4CreateInterface (IpSb->Mnp, IpSb->Controller, IpSb->Image);
+if (IpIf == NULL) {
+  return EFI_OUT_OF_RESOURCES;
+}
 
-  RouteTable = Ip4CreateRouteTable ();
-  if (RouteTable == NULL) {
-Ip4FreeInterface (IpIf, NULL);
-return EFI_OUT_OF_RESOURCES;
+RouteTable = Ip4CreateRouteTable ();
+if (RouteTable == NULL) {
+  Ip4FreeInterface (IpIf, NULL);
+  return EFI_OUT_OF_RESOURCES;
+}
+
+IpSb->DefaultInterface  = IpIf;
+InsertHeadList (&IpSb->Interfaces, &IpIf->Link);
+IpSb->DefaultRouteTable = RouteTable;
+Ip4ReceiveFrame (IpIf, NULL, Ip4AccpetFrame, IpSb);
   }
-  
-  IpSb->DefaultInterface  = IpIf;
-  InsertHeadList (&IpSb->Interfaces, &IpIf->Link);
-  IpSb->DefaultRouteTable = RouteTable;
-  Ip4ReceiveFrame (IpIf, NULL, Ip4AccpetFrame, IpSb);
 
   if (IpSb->State == IP4_SERVICE_CONFIGED) {
 IpSb->State = IP4_SERVICE_UNSTARTED;
   }
 
@@ -576,10 +577,12 @@ Ip4Config2SetDefaultAddr (
 SubnetMask,
 IP4_ALLZERO_ADDRESS
 );
 
   IpSb->State = IP4_SERVICE_CONFIGED;
+  IpSb->Reconfig = FALSE;
+  
   return EFI_SUCCESS;
 }
 
 /**
   Set the station address, subnetmask and gateway address for the default 
interface.
@@ -602,19 +605,20 @@ Ip4Config2SetDefaultIf (
   )
 {
   EFI_STATUSStatus;
   IP4_SERVICE   *IpSb;
 
-  Status = Ip4Config2SetDefaultAddr (Instance, StationAddress, SubnetMask);
+  IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Inst

Re: [edk2] [Patch 2/3] OvmfPkg: use new BDS and UiApp in MdeModulePkg

2015-08-19 Thread Ni, Ruiyu
I found it in my junk folder.

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo 
Ersek
Sent: Friday, August 14, 2015 8:20 PM
To: Ni, Ruiyu 
Cc: Justen, Jordan L ; edk2-de...@ml01.01.org
Subject: Re: [edk2] [Patch 2/3] OvmfPkg: use new BDS and UiApp in MdeModulePkg

On 08/14/15 10:28, Ni, Ruiyu wrote:
> Laszlo,
> Where can I read your first 17 remarks? I didn't find it in my mail folder.

Strange; your email address  was the only one in the
To: field. (The list and Jordan were Cc'd.)

In any case, here's the link into the archive:

http://thread.gmane.org/gmane.comp.bios.edk2.devel/759/focus=1153

Thanks!
Laszlo


> 
> Thanks,
> Ray
> 
> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com] 
> Sent: Wednesday, August 12, 2015 10:59 PM
> To: Ni, Ruiyu 
> Cc: Justen, Jordan L ; edk2-de...@ml01.01.org
> Subject: Re: [edk2] [Patch 2/3] OvmfPkg: use new BDS and UiApp in MdeModulePkg
> 
> Continuing:
> 
> On 08/12/15 00:53, Laszlo Ersek wrote:
>> On 08/03/15 07:41, Ruiyu Ni wrote:
>>> Compare to the old BDS, the new BDS separates the UI part to a standalone
>>> application UiApp.
>>> QemuBootOrderLib was changed to depend on the UefiBootManagerLib.
> 
>> I've covered the following files thus far:
>>>  OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
>>>   | 347 +++
>>>  OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf  
>>>   |   4 +-
>>>  OvmfPkg/OvmfPkg.dec
>>>   |   5 +-
>>>  OvmfPkg/OvmfPkgIa32.dsc
>>>   |  28 +-
>>>  OvmfPkg/OvmfPkgIa32.fdf
>>>   |   3 +-
>>>  OvmfPkg/OvmfPkgIa32X64.dsc 
>>>   |  30 +-
>>>  OvmfPkg/OvmfPkgIa32X64.fdf 
>>>   |   3 +-
>>>  OvmfPkg/OvmfPkgX64.dsc 
>>>   |  28 +-
>>>  OvmfPkg/OvmfPkgX64.fdf 
>>>   |   3 +-
>>
>> and made 17 remarks that should be addressed in v2.
>>
>> I will continue the review later; the rest of the patch is preserved in
>> the trailing context, so I will follow up on that. The remaining
>> diffstat is, with rename & copy detection enabled:
>>
> 
> (sorting the below)
> 
>>>  EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Graphics.c => 
>>> OvmfPkg/Library/PlatformBootManagerLib/QuietBoot.c | 559 +-
>>>  OvmfPkg/Library/PlatformBootManagerLib/Strings.uni 
>>>   | Bin 0 -> 3658 bytes
>>>  OvmfPkg/Library/{PlatformBdsLib => PlatformBootManagerLib}/BdsPlatform.c   
>>>   | 611 
>>>  OvmfPkg/Library/{PlatformBdsLib => PlatformBootManagerLib}/BdsPlatform.h   
>>>   | 132 ++---
>>>  OvmfPkg/Library/{PlatformBdsLib => PlatformBootManagerLib}/PlatformData.c  
>>>   |  18 +-
>>>  OvmfPkg/Library/{PlatformBdsLib => PlatformBootManagerLib}/QemuKernel.c
>>>   |   0
>>>  OvmfPkg/Library/{PlatformBdsLib/PlatformBdsLib.inf => 
>>> PlatformBootManagerLib/PlatformBootManagerLib.inf} |  20 +-
>>>  {IntelFrameworkModulePkg/Universal/BdsDxe => 
>>> OvmfPkg/Library/PlatformBootManagerLib}/MemoryTest.c
>>> | 227 
> 
> Let's see "MemoryTest.c" and "Strings.uni" first.
> 
>>> diff --git a/OvmfPkg/Library/PlatformBootManagerLib/MemoryTest.c 
>>> b/OvmfPkg/Library/PlatformBootManagerLib/MemoryTest.c
>>> new file mode 100644
>>> index 000..c9a7ecb
>>> --- /dev/null
>>> +++ b/OvmfPkg/Library/PlatformBootManagerLib/MemoryTest.c
> 
> [contents snipped]
> 
>>> diff --git a/OvmfPkg/Library/PlatformBootManagerLib/Strings.uni 
>>> b/OvmfPkg/Library/PlatformBootManagerLib/Strings.uni
>>> new file mode 100644
>>> index 
>>> ..7300975620fef86ea31c556a6fa66c098e8a0538
>>> GIT binary patch
>>> literal 3658
> 
> [contents snipped]
> 
> These two files do the following:
> 
> - "MemoryTest.c" is a slightly customized copy of
>   "IntelFrameworkModulePkg/Universal/BdsDxe/MemoryTest.c". The
>   customization comprises:
> 
>   - hard-coding PcdBootlogoOnlyEnable as FALSE
>   - removing DEBUG messages
>   - open coding some HII string lookup helper fun

[edk2] [PATCH v2] MdePkg: Update DEC and DSC version from 1.05 to 1.06

2015-08-19 Thread Liming Gao
UEFI2.5 and PI1.4 have been added in MdePkg. Update DEC and DSC version
to reflect those changes in MdePkg.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao 
---
 MdePkg/MdePkg.dec | 2 +-
 MdePkg/MdePkg.dsc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 64dc5f9..c2e3ebe 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -21,11 +21,11 @@
 [Defines]
   DEC_SPECIFICATION  = 0x00010005
   PACKAGE_NAME   = MdePkg
   PACKAGE_UNI_FILE   = MdePkg.uni
   PACKAGE_GUID   = 1E73767F-8F52-4603-AEB4-F29B510B6766
-  PACKAGE_VERSION= 1.05
+  PACKAGE_VERSION= 1.06
 
 
 [Includes]
   Include
 
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index a9301fb..89fc630 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -15,11 +15,11 @@
 ##
 
 [Defines]
   PLATFORM_NAME  = Mde
   PLATFORM_GUID  = 082F8BFC-0455-4859-AE3C-ECD64FB81642
-  PLATFORM_VERSION   = 1.05
+  PLATFORM_VERSION   = 1.06
   DSC_SPECIFICATION  = 0x00010005
   OUTPUT_DIRECTORY   = Build/Mde
   SUPPORTED_ARCHITECTURES= IA32|IPF|X64|EBC|ARM|AARCH64
   BUILD_TARGETS  = DEBUG|RELEASE
   SKUID_IDENTIFIER   = DEFAULT
-- 
1.9.5.msysgit.0

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


[edk2] [Patch] MdePkg: Update DEC and DSC version from 1.05 to 1.06

2015-08-19 Thread Liming Gao
UEFI2.5 and PI1.4 have been added in MdePkg. Update DEC and DSC version
to reflect those changes in MdePkg.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao 
---
 MdePkg/MdePkg.dec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 64dc5f9..c2e3ebe 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -21,11 +21,11 @@
 [Defines]
   DEC_SPECIFICATION  = 0x00010005
   PACKAGE_NAME   = MdePkg
   PACKAGE_UNI_FILE   = MdePkg.uni
   PACKAGE_GUID   = 1E73767F-8F52-4603-AEB4-F29B510B6766
-  PACKAGE_VERSION= 1.05
+  PACKAGE_VERSION= 1.06
 
 
 [Includes]
   Include
 
-- 
1.9.5.msysgit.0

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


[edk2] [PATCH] ArmPlatformPkg: Bds: delete BootNext when fail

2015-08-19 Thread Haojian Zhuang
If Bds launches BootNext with failure, delete it.

Otherwise, we'll create BootNext variable by BdsStartOption() & delete
it in BdsEntry() for each boot. It doesn't make sense to update
this variable in non-volatile variable area for each boot. And the
non-volatile variable area may be full of this message until overflow.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang 
---
 ArmPlatformPkg/Bds/Bds.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/ArmPlatformPkg/Bds/Bds.c b/ArmPlatformPkg/Bds/Bds.c
index ffae4bc..512e8e1 100644
--- a/ArmPlatformPkg/Bds/Bds.c
+++ b/ArmPlatformPkg/Bds/Bds.c
@@ -530,12 +530,12 @@ BdsEntry (
   // BootNext has not been succeeded launched
   if (EFI_ERROR(Status)) {
 Print(L"Fail to start BootNext.\n");
-  }
 
-  // Delete the BootNext environment variable
-  gRT->SetVariable (L"BootNext", &gEfiGlobalVariableGuid,
-  EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | 
EFI_VARIABLE_RUNTIME_ACCESS,
-  0, NULL);
+// Delete the BootNext environment variable
+gRT->SetVariable (L"BootNext", &gEfiGlobalVariableGuid,
+EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | 
EFI_VARIABLE_RUNTIME_ACCESS,
+0, NULL);
+  }
 }
 
 // Clear BootCurrent variable
-- 
2.1.4

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


[edk2] [Patch] BaseTools: Add NULL pointer check in AutoGen code

2015-08-19 Thread Liming Gao
For DynamicEx PCD, if NULL pointer is specified as token space GUID,
it will directly be used to compare GUID value in AutoGen code.
To avoid access NULL pointer, NULL pointer will be checked first.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao 
---
 BaseTools/Source/Python/AutoGen/GenC.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/BaseTools/Source/Python/AutoGen/GenC.py 
b/BaseTools/Source/Python/AutoGen/GenC.py
index b76d315..66756a3 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -715,10 +715,11 @@ def DynExPcdTokenNumberMapping(Info, AutoGenH):
 for Pcd in PcdExList:
 if Pcd.Type in gDynamicExPcd and Pcd.TokenCName == TokenCName:
 Index = Index + 1
 if Index == 1:
 AutoGenH.Append('\n#define __PCD_%s_VAL_CMP(GuidPtr)  (' % 
(Pcd.TokenCName))
+AutoGenH.Append('\\\n  (GuidPtr == NULL) ? 0:')
 AutoGenH.Append('\\\n  COMPAREGUID (GuidPtr, &%s) ? 
_PCD_TOKEN_%s_%s:' 
 % (Pcd.TokenSpaceGuidCName, 
Pcd.TokenSpaceGuidCName, Pcd.TokenCName))
 else:
 AutoGenH.Append('\\\n  COMPAREGUID (GuidPtr, &%s) ? 
_PCD_TOKEN_%s_%s:' 
 % (Pcd.TokenSpaceGuidCName, 
Pcd.TokenSpaceGuidCName, Pcd.TokenCName))
-- 
1.9.5.msysgit.0

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


[edk2] [PATCH v4 2/3] EmbeddedPkg: enhance for multiple gpio controllers

2015-08-19 Thread Haojian Zhuang
EmbeddedGpio only supports one gpio controller in one platform. Now create
PLATFORM_GPIO_CONTROLLER to support multiple gpio controllers in one platform.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang 
---
 EmbeddedPkg/EmbeddedPkg.dec |  1 +
 EmbeddedPkg/Include/Protocol/EmbeddedGpio.h | 17 +
 2 files changed, 18 insertions(+)

diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec
index 4bac580..bd3e301 100644
--- a/EmbeddedPkg/EmbeddedPkg.dec
+++ b/EmbeddedPkg/EmbeddedPkg.dec
@@ -65,6 +65,7 @@
   gAndroidFastbootTransportProtocolGuid = { 0x74bd9fe0, 0x8902, 0x11e3, {0xb9, 
0xd3, 0xf7, 0x22, 0x38, 0xfc, 0x9a, 0x31}}
   gAndroidFastbootPlatformProtocolGuid =  { 0x524685a0, 0x89a0, 0x11e3, {0x9d, 
0x4d, 0xbf, 0xa9, 0xf6, 0xa4, 0x03, 0x08}}
   gUsbDeviceProtocolGuid =  { 0x021bd2ca, 0x51d2, 0x11e3, {0x8e, 0x56, 0xb7, 
0x54, 0x17, 0xc7,  0x0b, 0x44 }}
+  gPlatformGpioProtocolGuid = { 0x52ce9845, 0x5af4, 0x43e2, {0xba, 0xfd, 0x23, 
0x08, 0x12, 0x54, 0x7a, 0xc2 }}
 
 [PcdsFeatureFlag.common]
   gEmbeddedTokenSpaceGuid.PcdEmbeddedMacBoot|FALSE|BOOLEAN|0x0001
diff --git a/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h 
b/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h
index 4e7c8db..b8bc929 100644
--- a/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h
+++ b/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h
@@ -164,4 +164,21 @@ struct _EMBEDDED_GPIO {
 
 extern EFI_GUID gEmbeddedGpioProtocolGuid;
 
+typedef struct _GPIO_CONTROLLER  GPIO_CONTROLLER;
+typedef struct _PLATFORM_GPIO_CONTROLLER PLATFORM_GPIO_CONTROLLER;
+
+struct _GPIO_CONTROLLER {
+  UINTN   RegisterBase;
+  UINTN   GpioIndex;
+  UINTN   InternalGpioCount;
+};
+
+struct _PLATFORM_GPIO_CONTROLLER {
+  UINTN   GpioCount;
+  UINTN   GpioControllerCount;
+  GPIO_CONTROLLER *GpioController;
+};
+
+extern EFI_GUID gPlatformGpioProtocolGuid;
+
 #endif
-- 
2.1.4

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


[edk2] [PATCH v4 1/3] ArmPlatformPkg: PL061: fix accessing GPIO DATA

2015-08-19 Thread Haojian Zhuang
// All bits low except one bit high, restricted to 8 bits
// (i.e. ensures zeros above 8bits)

But '&&' is wrong at here. It'll only return 1 or 0 as the result
of GPIO_PIN_MASK_HIGH_8BIT(Pin).

Since PL061 spec said in below.

In order to write to GPIODATA, the corresponding bits in the mask,
resulting from the address bus, PADDR[9:2], must be HIGH. Otherwise
the bit values remain unchanged by the write.
Similarly, the values read from this register are determined for
each bit, by the mask bit derived from the address used to access
the data register, PADDR[9:2]. Bits that are 1 in the address mask
cause the corresponding bits in GPIODATA to be read, and bits that
are 0 in the address mask cause the corresponding bits in GPIODATA
to be read as 0, regardless of their value.

Now simplify the way to read/write bit of GPIO_DATA register.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang 
---
 ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c | 16 
 ArmPlatformPkg/Include/Drivers/PL061Gpio.h  |  4 
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c 
b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
index ff05662..042fc76 100644
--- a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
+++ b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
@@ -125,7 +125,7 @@ Get (
 }
   }
 
-  if (MmioRead8 (PL061_GPIO_DATA_REG) & GPIO_PIN_MASK_HIGH_8BIT(Gpio)) {
+  if (MmioRead8 (PL061_GPIO_DATA_REG + (GPIO_PIN_MASK(Gpio) << 2))) {
 *Value = 1;
   } else {
 *Value = 0;
@@ -181,21 +181,21 @@ Set (
   {
 case GPIO_MODE_INPUT:
   // Set the corresponding direction bit to LOW for input
-  MmioAnd8 (PL061_GPIO_DIR_REG, GPIO_PIN_MASK_LOW_8BIT(Gpio));
+  MmioAnd8 (PL061_GPIO_DIR_REG, ~GPIO_PIN_MASK(Gpio));
   break;
 
 case GPIO_MODE_OUTPUT_0:
   // Set the corresponding data bit to LOW for 0
-  MmioAnd8 (PL061_GPIO_DATA_REG, GPIO_PIN_MASK_LOW_8BIT(Gpio));
+  MmioWrite8 (PL061_GPIO_DATA_REG + (GPIO_PIN_MASK(Gpio) << 2), 0);
   // Set the corresponding direction bit to HIGH for output
-  MmioOr8 (PL061_GPIO_DIR_REG, GPIO_PIN_MASK_HIGH_8BIT(Gpio));
+  MmioOr8 (PL061_GPIO_DIR_REG, GPIO_PIN_MASK(Gpio));
   break;
 
 case GPIO_MODE_OUTPUT_1:
   // Set the corresponding data bit to HIGH for 1
-  MmioOr8 (PL061_GPIO_DATA_REG, GPIO_PIN_MASK_HIGH_8BIT(Gpio));
+  MmioWrite8 (PL061_GPIO_DATA_REG + (GPIO_PIN_MASK(Gpio) << 2), 0xff);
   // Set the corresponding direction bit to HIGH for output
-  MmioOr8 (PL061_GPIO_DIR_REG, GPIO_PIN_MASK_HIGH_8BIT(Gpio));
+  MmioOr8 (PL061_GPIO_DIR_REG, GPIO_PIN_MASK(Gpio));
   break;
 
 default:
@@ -250,9 +250,9 @@ GetMode (
   }
 
   // Check if it is input or output
-  if (MmioRead8 (PL061_GPIO_DIR_REG) & GPIO_PIN_MASK_HIGH_8BIT(Gpio)) {
+  if (MmioRead8 (PL061_GPIO_DIR_REG) & GPIO_PIN_MASK(Gpio)) {
 // Pin set to output
-if (MmioRead8 (PL061_GPIO_DATA_REG) & GPIO_PIN_MASK_HIGH_8BIT(Gpio)) {
+if (MmioRead8 (PL061_GPIO_DATA_REG + (GPIO_PIN_MASK(Gpio) << 2))) {
   *Mode = GPIO_MODE_OUTPUT_1;
 } else {
   *Mode = GPIO_MODE_OUTPUT_0;
diff --git a/ArmPlatformPkg/Include/Drivers/PL061Gpio.h 
b/ArmPlatformPkg/Include/Drivers/PL061Gpio.h
index 38458f4..d436fd4 100644
--- a/ArmPlatformPkg/Include/Drivers/PL061Gpio.h
+++ b/ArmPlatformPkg/Include/Drivers/PL061Gpio.h
@@ -46,9 +46,5 @@
 
 // All bits low except one bit high, native bit length
 #define GPIO_PIN_MASK(Pin)  (1UL << ((UINTN)(Pin)))
-// All bits low except one bit high, restricted to 8 bits (i.e. ensures zeros 
above 8bits)
-#define GPIO_PIN_MASK_HIGH_8BIT(Pin)(GPIO_PIN_MASK(Pin) && 0xFF)
-// All bits high except one bit low, restricted to 8 bits (i.e. ensures zeros 
above 8bits)
-#define GPIO_PIN_MASK_LOW_8BIT(Pin) ((~GPIO_PIN_MASK(Pin)) && 0xFF)
 
 #endif  // __PL061_GPIO_H__
-- 
2.1.4

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


[edk2] [PATCH v4 3/3] ArmPlatformPkg: PL061: support multiple controller

2015-08-19 Thread Haojian Zhuang
Support multiple PL061 controllers. If platform gpio driver couldn't be found,
PL061 gpio driver will continue to load PcdPL061GpioBase as the register base.
It could be compatible with the use case of current PL061 gpio driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang 
---
 ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c| 137 +++--
 .../Drivers/PL061GpioDxe/PL061GpioDxe.inf  |   1 +
 ArmPlatformPkg/Include/Drivers/PL061Gpio.h |  47 ---
 3 files changed, 125 insertions(+), 60 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c 
b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
index 042fc76..02da8e1 100644
--- a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
+++ b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -28,6 +29,7 @@
 #include 
 
 BOOLEAN mPL061Initialized = FALSE;
+PLATFORM_GPIO_CONTROLLER *mPL061PlatformGpio;
 
 /**
   Function implementations
@@ -38,20 +40,36 @@ PL061Identify (
   VOID
   )
 {
-  // Check if this is a PrimeCell Peripheral
-  if ((MmioRead8 (PL061_GPIO_PCELL_ID0) != 0x0D)
-  ||  (MmioRead8 (PL061_GPIO_PCELL_ID1) != 0xF0)
-  ||  (MmioRead8 (PL061_GPIO_PCELL_ID2) != 0x05)
-  ||  (MmioRead8 (PL061_GPIO_PCELL_ID3) != 0xB1)) {
-return EFI_NOT_FOUND;
+  UINTNIndex;
+  UINTNRegisterBase;
+
+  if (   (mPL061PlatformGpio->GpioCount == 0)
+  || (mPL061PlatformGpio->GpioControllerCount == 0)) {
+ return EFI_NOT_FOUND;
   }
 
-  // Check if this PrimeCell Peripheral is the PL061 GPIO
-  if ((MmioRead8 (PL061_GPIO_PERIPH_ID0) != 0x61)
-  ||  (MmioRead8 (PL061_GPIO_PERIPH_ID1) != 0x10)
-  ||  ((MmioRead8 (PL061_GPIO_PERIPH_ID2) & 0xF) != 0x04)
-  ||  (MmioRead8 (PL061_GPIO_PERIPH_ID3) != 0x00)) {
-return EFI_NOT_FOUND;
+  for (Index = 0; Index < mPL061PlatformGpio->GpioControllerCount; Index++) {
+if (mPL061PlatformGpio->GpioController[Index].InternalGpioCount != 
PL061_GPIO_PINS) {
+  return EFI_INVALID_PARAMETER;
+}
+
+RegisterBase = mPL061PlatformGpio->GpioController[Index].RegisterBase;
+
+// Check if this is a PrimeCell Peripheral
+if ((MmioRead8 (RegisterBase + PL061_GPIO_PCELL_ID0) != 0x0D)
+||  (MmioRead8 (RegisterBase + PL061_GPIO_PCELL_ID1) != 0xF0)
+||  (MmioRead8 (RegisterBase + PL061_GPIO_PCELL_ID2) != 0x05)
+||  (MmioRead8 (RegisterBase + PL061_GPIO_PCELL_ID3) != 0xB1)) {
+  return EFI_NOT_FOUND;
+}
+   
+// Check if this PrimeCell Peripheral is the PL061 GPIO
+if ((MmioRead8 (RegisterBase + PL061_GPIO_PERIPH_ID0) != 0x61)
+||  (MmioRead8 (RegisterBase + PL061_GPIO_PERIPH_ID1) != 0x10)
+||  ((MmioRead8 (RegisterBase + PL061_GPIO_PERIPH_ID2) & 0xF) != 0x04)
+||  (MmioRead8 (RegisterBase + PL061_GPIO_PERIPH_ID3) != 0x00)) {
+  return EFI_NOT_FOUND;
+}
   }
 
   return EFI_SUCCESS;
@@ -84,6 +102,31 @@ PL061Initialize (
   return Status;
 }
 
+EFI_STATUS
+EFIAPI
+PL061Locate (
+  IN  EMBEDDED_GPIO_PIN Gpio,
+  OUT UINTN *ControllerIndex,
+  OUT UINTN *ControllerOffset,
+  OUT UINTN *RegisterBase
+  )
+{
+  UINT32Index;
+
+  for (Index = 0; Index < mPL061PlatformGpio->GpioControllerCount; Index++) {
+if ((Gpio >= mPL061PlatformGpio->GpioController[Index].GpioIndex)
+&&  (Gpio < mPL061PlatformGpio->GpioController[Index].GpioIndex
+ + mPL061PlatformGpio->GpioController[Index].InternalGpioCount)) {
+  *ControllerIndex = Index;
+  *ControllerOffset = Gpio % 
mPL061PlatformGpio->GpioController[Index].InternalGpioCount;
+  *RegisterBase = mPL061PlatformGpio->GpioController[Index].RegisterBase;
+  return EFI_SUCCESS;
+}
+  }
+  DEBUG ((EFI_D_ERROR, "%a, failed to locate gpio %d\n", __func__, Gpio));
+  return EFI_INVALID_PARAMETER;
+}
+
 /**
 
 Routine Description:
@@ -110,11 +153,15 @@ Get (
   )
 {
   EFI_STATUSStatus = EFI_SUCCESS;
+  UINTN Index, Offset, RegisterBase;
 
-  if ((Value == NULL)
-  ||  (Gpio > LAST_GPIO_PIN))
-  {
-return EFI_INVALID_PARAMETER;
+  Status = PL061Locate (Gpio, &Index, &Offset, &RegisterBase);
+  if (EFI_ERROR (Status))
+goto EXIT;
+
+  if (Value == NULL) {
+Status = EFI_INVALID_PARAMETER;
+goto EXIT;
   }
 
   // Initialize the hardware if not already done
@@ -125,7 +172,7 @@ Get (
 }
   }
 
-  if (MmioRead8 (PL061_GPIO_DATA_REG + (GPIO_PIN_MASK(Gpio) << 2))) {
+  if (MmioRead8 (RegisterBase + PL061_GPIO_DATA_REG + (GPIO_PIN_MASK(Offset) 
<< 2))) {
 *Value = 1;
   } else {
 *Value = 0;
@@ -162,12 +209,11 @@ Set (
   )
 {
   EFI_STATUSStatus = EFI_SUCCESS;
+  UINTN Index, Offset, RegisterBase;
 
-  // Check for errors
-  if (Gpio > LAST_GPIO_PIN) {
-Status = EFI_INVALID_PARAMETER;
+  Status = PL061Locate (Gpio, &Index, &Offset, &RegisterBase);
+

[edk2] [PATCH v4 0/3] support multiple PL061 gpio controllers

2015-08-19 Thread Haojian Zhuang
Changelog:
  v4:
* Use 64-bit value on PL061 register base address.
* Use fallback to be compatible with current PcdPL061GpioBase value
  when platform gpio driver isn't present.
* Remove the dependancy on PL061. Move the dependancy to platform
  gpio driver instead.
  v3:
* Remove GPIO_PIN_MASK_HIGH_8BIT() and GPIO_PIN_MASK_LOW_8BIT().
* Avoid to use MmioAnd8() on updating GPIO DATA register, since PL061
  could access each bit by specified register offset.
* Add PLATFORM_GPIO_CONTROLLER structure in embedded gpio.
* Support multiple PL061 gpio controllers in one platform.
  v2:
* Append the patch to fix gpio pin mask macro.

Haojian Zhuang (3):
  ArmPlatformPkg: PL061: fix accessing GPIO DATA
  EmbeddedPkg: enhance for multiple gpio controllers
  ArmPlatformPkg: PL061: support multiple controller

 ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c| 137 +++--
 .../Drivers/PL061GpioDxe/PL061GpioDxe.inf  |   1 +
 ArmPlatformPkg/Include/Drivers/PL061Gpio.h |  51 
 EmbeddedPkg/EmbeddedPkg.dec|   1 +
 EmbeddedPkg/Include/Protocol/EmbeddedGpio.h|  17 +++
 5 files changed, 143 insertions(+), 64 deletions(-)

-- 
2.1.4

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


Re: [edk2] [PATCH v2 00/16] unify GCC command line options

2015-08-19 Thread Ard Biesheuvel
On 18 August 2015 at 22:29, Ard Biesheuvel  wrote:
> On 18 August 2015 at 22:03, Ard Biesheuvel  wrote:
>> On 18 August 2015 at 19:35, David Woodhouse  wrote:
>>> On Tue, 2015-08-18 at 17:52 +0200, Ard Biesheuvel wrote:
 On 18 August 2015 at 17:19, Jordan Justen  
 wrote:
 > Last time I checked, GCC44 ~ GCC49 all produced images roughly in the
 > same ball park size-wise. UNIXGCC produced much larger images because
 > it could not strip unused functions/data.

 Yeah, that is still true, unfortunately.
>>>
>>> Is it really still true?
>>>
>>> https://sourceware.org/bugzilla/show_bug.cgi?id=11539#c14
>>>
>>> If the patch that Nick committed to fix this *isn't* working, please
>>> add a comment telling him that :)
>>>
>>
>> I did a quick test with the gdb-7.10-branch of binutils-gdb, and while
>> it does make some difference, it is still not sufficient
>>
>> Building OvmfX64 in RELEASE mode gives me
>>
>> Before:
>>   the required fv image size 0xd67c0 exceeds the set fv image size 0xcc000
>>
>> After:
>>   the required fv image size 0xd2a18 exceeds the set fv image size 0xcc000
>>
>> where GCC/ELF obviously produces something < 0xcc000
>>
>
> I had mistakenly omitted the -ffunction-sections -fdata-sections
> switches, but adding those makes it even worse
>
>   the required fv image size 0xdbf98 exceeds the set fv image size 0xcc000
>
> so there is definitely something dodgy going on here.
>

I managed to make this work by also adding the
-fno-asynchronous-unwind-tables option. It appears that
(unsurprisingly) the unwinding info is preventing code from being
pruned.

So with  -Os -ffunction-sections -fdata-sections
-fno-asynchronous-unwind-tables, we get even better results than
GCC49, since we can actually turn on size optimization for MinGW.
On GCC49, we can only enable optimization if we also enable
-maccumulate-outgoing-args, which -according to the man page- results
in a notable increase in code size. (I assume this is the reason we
don't optimize the GCC49 X64 builds at all)

If I just look at VolInfo of the FVMAIN_COMPACT.Fv generated by each
build (UNIXGCC with mingw 4.9 vs GCC49), I get 767 KB for MinGW for
the file length of the first embedded FV, where GCC49 takes up 794 KB.
Maybe not spectacular, but more than significant.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel