[edk2] DXE loading order

2015-08-16 Thread Michael Zimmermann
I've enabled both SimpleTextInOutSerial and ConPlatformDxe on my device but
it seems like ConPlatformDxe doesn't get notified about the binding of the
simpletext protocol.
I've noticed that SimpleText gets loaded before ConPlatform - Does that
matter? Apparently yes.
So, is this a bug by the EDK or should ConPlatform iterate all handles when
initializing?
___
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-16 Thread Tian, Feng
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 
gPeiUsb2HostControllerPpiGuid.  The same cross dependency is shown in the DEPEX 
for these two modules.

I feel like I'm missing something simple and fundamental and I'm hoping someone 
will point me in the right direction.

Thanks,
Eric W

___
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] Fix typo in BaseCrypto2HashInit() which causes sanity check incorrect.

2015-08-16 Thread Zhang, Chao B
The patch is good to me
Reviewed-by: Chao Zhangchao.b.zh...@intel.com





Thanks  Best regards
Chao Zhang


-Original Message-
From: Yao, Jiewen 
Sent: Saturday, August 15, 2015 6:59 AM
To: edk2-devel@lists.01.org
Cc: Yao, Jiewen; Zhang, Chao B
Subject: [patch] Fix typo in BaseCrypto2HashInit() which causes sanity check 
incorrect.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yao, Jiewen jiewen@intel.com
Cc: Zhang, Chao B chao.b.zh...@intel.com
---
 SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.c 
b/SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.c
index 6a7ecf2..dab0299 100644
--- a/SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.c
+++ b/SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.c
@@ -454,7 +454,7 @@ BaseCrypto2HashInit (
   // Consistency Check
   //
   Instance = HASH2_INSTANCE_DATA_FROM_THIS(This);
-  if ((Instance-HashContext != NULL) || (Instance-HashInfoContext != 
HashInfo)) {
+  if ((Instance-HashContext != NULL) || (Instance-HashInfoContext != NULL)) {
 return EFI_ALREADY_STARTED;
   }
 
-- 
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 0/2] Add HttpBoot support to OvmfPkg

2015-08-16 Thread Gary Ching-Pang Lin
On Fri, Aug 14, 2015 at 07:58:31AM -0700, Blibbet wrote:
 
 On 08/14/2015 02:03 AM, Gary Ching-Pang Lin wrote:
  Although the current HttpBoot implementation is incomplete, it would be
  easier to develop and test the software stack with a virtual machine.
 
 THANKS for adding to OVMF!
 
 Besides 1219 UEFI.Next Feature - UEFI TLS API, what else is missing?
 
The DHCPv6 support in HttpBoot is not implemented. Besides, the unexpected
disconnection wasn't handled in HttpIo. I was using thttpd in the beginning,
and the http daemon dropped the connection after a http request but HttpIo
thought it's still alive and failed the next request.

I started to suspect the strange devpath I had might be caused by gnu-efi.
I'll update my finding and post a v2 patchset after fixing the git config
requested by Laszlo.

Cheers,

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


Re: [edk2] [patch] SecurityPkg: Fixed build error due to FixedAtBuild PcdTcg2HashAlgorithmBitmap

2015-08-16 Thread Yao, Jiewen
HI Samer
Yes, I can, if you can attach you patch.

I think it is good idea, but I have not seen your patch yet.

Thank you
Yao Jiewen

From: El-Haj-Mahmoud, Samer [mailto:samer.el-haj-mahm...@hp.com]
Sent: Saturday, August 15, 2015 7:45 PM
To: edk2-devel@lists.01.org; Yao, Jiewen
Cc: Zhang, Chao B; Yao, Jiewen
Subject: RE: [edk2] [patch] SecurityPkg: Fixed build error due to FixedAtBuild 
PcdTcg2HashAlgorithmBitmap

thanks Jiewen. Can you commit the code please?





-Original Message-
From: Yao, Jiewen [jiewen@intel.com]
Received: Saturday, 15 Aug 2015, 1:10AM
To: El-Haj-Mahmoud, Samer [samer.el-haj-mahm...@hp.com]; 
edk2-devel@lists.01.orgmailto:edk2-devel@lists.01.org 
[edk2-devel@lists.01.org]
CC: Zhang, Chao B [chao.b.zh...@intel.com]; Yao, Jiewen [jiewen@intel.com]
Subject: RE: [edk2] [patch] SecurityPkg: Fixed build error due to FixedAtBuild 
PcdTcg2HashAlgorithmBitmap
Sounds good to me.

Thank you
Yao Jiewen

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
El-Haj-Mahmoud, Samer
Sent: Saturday, August 15, 2015 8:55 AM
To: edk2-devel@lists.01.orgmailto:edk2-devel@lists.01.org
Cc: El-Haj-Mahmoud, Samer; Zhang, Chao B
Subject: [edk2] [patch] SecurityPkg: Fixed build error due to FixedAtBuild 
PcdTcg2HashAlgorithmBitmap

PcdTcg2HashAlgorithmBitmap is declared in a section that allows it to be Fixed 
or PatchableAtBuild, but there is code that sets it. This breaks the build on 
some platforms. Changed it to be PcdsDynamic and PcdsDynamicEx only.

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Samer El-Haj-Mahmoud 
samer.el-haj-mahm...@hp.commailto:samer.el-haj-mahm...@hp.com





Samer El-Haj-Mahmoud
System Firmware Architect
HP Servers

el...@hp.commailto:el...@hp.com
T +1.281.514.5973
C +1.512.659.1523
Hewlett-Packard Company
hp.com/go/proliant/uefi



___
edk2-devel mailing list
edk2-devel@lists.01.orgmailto: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 00/15] unify GCC command line options

2015-08-16 Thread Scott Duplichan
]Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] wrote:

 . . .

] Thanks for this much needed tool chain definition consolidation. I ran
] a build test with and without the patch. The build test uses GCC44-49
] and Microsoft tool chains. Log files are here: http://notabs.org/uefi/tmp/.
]
]Thanks a lot for giving it a spin.
]
] Here is what is see in the log files with respect to the patch:
] 1) GCC49 X64 and IA32
]GenFw: ERROR 3000: Invalid Unsupported section alignment.
]
]I cannot reproduce this, unfortunately. Can you please check whether
]your BaseTools are up to date? There have been some changes recently
]to GenFw regarding section alignment which may cause this. My gcc is
]4.9.1 btw (Ubuntu)
]
]My Jenkins job has a 'git clean -dxf BaseTools/; make -C BaseTools' at
]the beginning so they are up to date, although I think that for GenFw,
]the git clean is not necessary. (Some other tools don't rebuild
]correctly if any of the common C code is modified)

I used rebuilt BaseTools\Bin\Win32 with up to date source code. The SVN
GenFw binary gives the same message. Adding some debug prints gives:

Unsupported section alignment: sh_addr=84a0 addralign=64 mCoffOffset=84c0

Objdump -h gives:
d:\edk2build\edk2\Build\OvmfX64\RELEASE_GCC49\X64\MdeModulePkg\Core\
Pei\PeiMain\DEBUG\PeiCore.dll: file format elf64-x86-64

Sections:
Idx Name  Size  VMA   LMA   File off  Algn
  0 .text 8250  0240  0240  00c0  2**5
  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .data 03b8  84a0  84a0  8320  2**6
  CONTENTS, ALLOC, LOAD, RELOC, DATA

] 2) GCC46 ARM
]unrecognized command line option '-mno-unaligned-access'
]
]
]Could you send me the output of gcc -v for this compiler? Mine is
]Linaro 4.6.3 which supports it fine, but the feature may be a Linaro
]contribution that only made it into 4.7 upstream. In any case, we
]cannot tolerate unaligned accesses so we may need to deprecate 4.6 or
]mandate that the Linaro version be used if older versions emit
]unaligned accesses.

The GCC46 is the Windows hosted build from:
http://sourceforge.net/projects/edk2developertoolsforwindows/

It is built from the latest gcc 4.6 source code:
http://ftpmirror.gnu.org/gcc/gcc-4.6.4/gcc-4.6.4.tar.bz2

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=d:/edk2build/uefitools/gcc464-arm/bin/../lib/gcc/arm-linux-gnueabi/4.6.4/lto-wrapper.exe
Target: arm-linux-gnueabi
Configured with: ../gcc-4.6.4/configure --prefix=/gcc/xgcc 
--libexecdir=/gcc/xgcc/lib --target=arm-linux-gnueabi --disable-werror 
--disable-shared --disable-libssp --disable-bootstrap --disable-nls 
--disable-libquadmath --without-headers --enable-languages=c 
--with-gmp=/gcc/xgcc --with-mpfr=/gcc/xgcc --with-mpc=/gcc/xgcc 
--with-libelf=/gcc/xgcc --with-pkgversion='EDK2 version 1.0' MAKEINFO=missing 
--enable-twoprocess --disable-threads --disable-decimal-float 
--disable-win32-registry --disable-libc --with-windres
Thread model: single
gcc version 4.6.4 (EDK2 version 1.0)

Source code for gcc-linaro-4.6-2012.04 shows what you suspected:
ChangeLog.linaro contains: (insv, extzv): Add unaligned-access support.

Thanks,
Scott


]Regards,
]Ard.

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


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

2015-08-16 Thread Ye, Ting
I checked RFC7230 and agreed we need use the origin-form of URI instead of 
using absolute-form. Thanks for fixing this.

Reviewed-by: Ye Ting ting...@intel.com 

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Gary 
Ching-Pang Lin
Sent: Friday, August 14, 2015 5:04 PM
To: edk2-devel@lists.01.org
Cc: Justen, Jordan L; Fu, Siyuan; Laszlo Ersek
Subject: [edk2] [PATCH 1/2] NetworkPkg: Remove the hostname for 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 g...@suse.com
---
 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] [PATCH] SecurityPkg: Update SignatureSize to comply UEFI spec

2015-08-16 Thread Long, Qin
Looks good.

Reviewed-by: Qin Long  qin.l...@intel.com


Best Regards  Thanks,
LONG, Qin

 -Original Message-
 From: Zhang, Chao B
 Sent: Monday, August 17, 2015 10:01 AM
 To: edk2-devel@lists.01.org
 Cc: Long, Qin; Zhang, Chao B
 Subject: [PATCH] SecurityPkg: Update SignatureSize to comply UEFI spec
 
 Update SignatureSize to include SignatureOwner GUID. This behavior is
 defined by UEFI spec
 
 Contributed-under: TianoCore Contribution Agreement 1.0
 Signed-off-by: Chao Zhang chao.b.zh...@intel.com
 ---
  SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c | 2
 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git
 a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
 b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
 index ca1bdc0..5cb9f81 100644
 --- a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
 +++
 b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
 @@ -1860,7 +1860,7 @@ DxeImageVerificationHandler (
}
SignatureList-SignatureHeaderSize  = 0;
SignatureList-SignatureListSize= (UINT32) SignatureListSize;
 -  SignatureList-SignatureSize= (UINT32) mImageDigestSize;
 +  SignatureList-SignatureSize= (UINT32) (sizeof
 (EFI_SIGNATURE_DATA) - 1 + mImageDigestSize);
CopyMem (SignatureList-SignatureType, mCertType, sizeof
 (EFI_GUID));
Signature = (EFI_SIGNATURE_DATA *) ((UINT8 *) SignatureList + sizeof
 (EFI_SIGNATURE_LIST));
CopyMem (Signature-SignatureData, mImageDigest, mImageDigestSize);
 --
 1.9.5.msysgit.1

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


[edk2] [PATCH v2] MdeModulePkg: IP4 should re-initiate a DHCP while network reconnection

2015-08-16 Thread Jiaxin Wu
v2:
* Update the MediaPresent detect declaring.

IP4 driver should re-initiate a DHCP if it detects that there is a network 
reconnection.
To fix this issue, we can implement the DHCP re-initiate policy while the media
change detected. The Ip4 driver should set a timer to signal the Ip4 to run the
DHCP configuration again(D.O.R.A). IP4 driver should free old IP address related
resource, then initiate a DHCP process to acquire new IP.

Cc: Ye Ting ting...@intel.com
Cc: Zhang Lubo lubo.zh...@intel.com
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu jiaxin...@intel.com
---
 .../Universal/Network/Ip4Dxe/Ip4Config2Impl.c  |   1 +
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c  |  10 ++
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c| 121 -
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h|   7 ++
 4 files changed, 133 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
index fcb2bdd..caf84fb 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
@@ -490,10 +490,11 @@ Ip4Config2SetDefaultAddr (
   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.
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
index 101390c..4d3ccec 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
@@ -208,10 +208,14 @@ Ip4CreateService (
 
   ZeroMem (IpSb-SnpMode, sizeof (EFI_SIMPLE_NETWORK_MODE));
 
   IpSb-Timer = NULL;
 
+  IpSb-ReconfigEvent = NULL;
+  
+  IpSb-MediaPresent = TRUE;
+
   //
   // Create various resources. First create the route table, timer
   // event and MNP child. IGMP, interface's initialization depend
   // on the MNP child.
   //
@@ -384,10 +388,16 @@ Ip4CleanService (
 gBS-CloseEvent (IpSb-Timer);
 
 IpSb-Timer = NULL;
   }
 
+  if (IpSb-ReconfigEvent != NULL) {
+gBS-CloseEvent (IpSb-ReconfigEvent);
+
+IpSb-ReconfigEvent = NULL;
+  }
+
   if (IpSb-MacString != NULL) {
 FreePool (IpSb-MacString);
   }
 
   Ip4Config2CleanInstance (IpSb-Ip4Config2Instance);
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
index 2fb4f4c..ac8fb1a 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
@@ -561,10 +561,58 @@ Ip4InitProtocol (
 
   EfiInitializeLock (IpInstance-RecycleLock, TPL_NOTIFY);
 }
 
 
+/**
+  The event handle for IP4 auto reconfiguration. The original default
+  interface and route table will be removed as the default.
+
+  @param[in]  ContextThe IP4 service binding instance.
+
+**/
+VOID
+EFIAPI
+Ip4AutoReconfigCallBackDpc (
+  IN VOID   *Context
+  )
+{
+  IP4_SERVICE   *IpSb;
+
+  IpSb  = (IP4_SERVICE *) Context;
+  NET_CHECK_SIGNATURE (IpSb, IP4_SERVICE_SIGNATURE);
+
+  if (IpSb-State  IP4_SERVICE_UNSTARTED) {
+IpSb-State = IP4_SERVICE_UNSTARTED;
+  }
+
+  Ip4StartAutoConfig (IpSb-Ip4Config2Instance);
+
+  return ;
+}
+
+
+/**
+  Request Ip4AutoReconfigCallBackDpc as a DPC at TPL_CALLBACK.
+
+  @param Event The event that is signalled.
+  @param Context   The IP4 service binding instance.
+
+**/
+VOID
+EFIAPI
+Ip4AutoReconfigCallBack (
+  IN EFI_EVENT  Event,
+  IN VOID   *Context
+  )
+{
+  //
+  // Request Ip4AutoReconfigCallBackDpc as a DPC at TPL_CALLBACK
+  //
+  QueueDpc (TPL_CALLBACK, Ip4AutoReconfigCallBackDpc, Context);
+}
+
 
 /**
   Configure the IP4 child. If the child is already configured,
   change the configuration parameter. Otherwise configure it
   for the first time. The caller should validate the configuration
@@ -676,14 +724,31 @@ Ip4ConfigProtocol (
 //
 // Use the default address. If the default configuration hasn't
 // been started, start it.
 //
 if (IpSb-State == IP4_SERVICE_UNSTARTED) {
+  //
+  // Create the ReconfigEvent to start the new configuration.
+  //
+  if (IpSb-ReconfigEvent == NULL) {
+Status = gBS-CreateEvent (
+EVT_NOTIFY_SIGNAL,
+TPL_NOTIFY,
+Ip4AutoReconfigCallBack,
+IpSb,
+IpSb-ReconfigEvent
+);
+
+if (EFI_ERROR (Status)) {
+  goto ON_ERROR;
+}
+  }
+  
   Status = Ip4StartAutoConfig (IpSb-Ip4Config2Instance);
 
   if (EFI_ERROR (Status)) {
-goto