Re: [edk2] [Patch 1/2] MdeModulePkg/Network: Add 32bit subnet mask support for IP4 PXE boot.

2018-08-27 Thread Wu, Jiaxin
Hi Siyuan,

In Ip4SendFrameToDefaultRoute(), you tried to find the default gateway IP 
address by using the found RtCacheEntry->Tag, I'm confused why it's the default 
gateway? In my understanding, tag is the cache's corresponding route entry.  
Besides, why we must send the frame to "DefaultRouter", should be the instance 
router first, then default router? If so, I suggest to rename the function to 
Ip4SendFrameToRoute(). Then, the logic in the function to retrieve the gateway 
should be: 
{
if (IpInstance == NULL) {
  CacheEntry = Ip4Route (IpSb->DefaultRouteTable, Head->Dst, Head->Src, 
IpIf->SubnetMask);
} else {
  CacheEntry = Ip4Route (IpInstance->RouteTable, Head->Dst, Head->Src, 
IpIf->SubnetMask);
  if (CacheEntry == NULL) {
CacheEntry = Ip4Route (IpSb->DefaultRouteTable, Head->Dst, Head->Src, 
IpIf->SubnetMask);
  }
}

if (CacheEntry == NULL) {
  return EFI_NOT_FOUND;
}
GateWay = CacheEntry->NextHop;
Ip4FreeRouteCacheEntry (CacheEntry);
}

What do you think?

Thanks,
Jiaxin








> -Original Message-
> From: Fu, Siyuan
> Sent: Tuesday, August 28, 2018 9:53 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting ; Wu, Jiaxin 
> Subject: [Patch 1/2] MdeModulePkg/Network: Add 32bit subnet mask
> support for IP4 PXE boot.
> 
> This patch updates IP4 stack to support 32bit subnet mask in PXE boot
> process.
> When 32bit subnet mask is used, the IP4 driver couldn't use the subnet mask
> to determine
> whether destination IP address is on-link or not, so it will always try to 
> send
> all the
> packets to the destination IP address directly first, if failed it will 
> continue
> to try the default gateway.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Fu Siyuan 
> Cc: Ye Ting 
> Cc: Wu Jiaxin 
> ---
>  MdeModulePkg/Include/Library/NetLib.h |   5 +-
>  MdeModulePkg/Library/DxeNetLib/DxeNetLib.c|  13 +-
>  .../Universal/Network/Ip4Dxe/Ip4Common.h  |   2 +-
>  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c | 117
> --
>  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h |   5 +-
>  .../Universal/Network/Ip4Dxe/Ip4Impl.c|   2 +-
>  .../Universal/Network/Ip4Dxe/Ip4Output.c  |  11 +-
>  .../Universal/Network/Ip4Dxe/Ip4Route.c   |  21 +++-
>  .../Universal/Network/Ip4Dxe/Ip4Route.h   |   5 +-
>  .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c  |   6 +-
>  10 files changed, 154 insertions(+), 33 deletions(-)
> 
> diff --git a/MdeModulePkg/Include/Library/NetLib.h
> b/MdeModulePkg/Include/Library/NetLib.h
> index ef7bc429c1..b7ef99c7b5 100644
> --- a/MdeModulePkg/Include/Library/NetLib.h
> +++ b/MdeModulePkg/Include/Library/NetLib.h
> @@ -422,8 +422,9 @@ NetGetIpClass (
> 
>If all bits of the host address of IP are 0 or 1, IP is also not a valid 
> unicast
> address,
>except when the originator is one of the endpoints of a point-to-point link
> with a 31-bit
> -  mask (RFC3021).
> -
> +  mask (RFC3021), or a 32bit NetMask (all 0xFF) is used for special network
> environment (e.g.
> +  PPP link).
> +
>@param[in]  IpThe IP to check against.
>@param[in]  NetMask   The mask of the IP.
> 
> diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
> b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
> index bf8f5523e6..63f4724062 100644
> --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
> +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
> @@ -654,8 +654,9 @@ NetGetIpClass (
> 
>If all bits of the host address of IP are 0 or 1, IP is also not a valid 
> unicast
> address,
>except when the originator is one of the endpoints of a point-to-point link
> with a 31-bit
> -  mask (RFC3021).
> -
> +  mask (RFC3021), or a 32bit NetMask (all 0xFF) is used for special network
> environment (e.g.
> +  PPP link).
> +
>@param[in]  IpThe IP to check against.
>@param[in]  NetMask   The mask of the IP.
> 
> @@ -669,18 +670,20 @@ NetIp4IsUnicast (
>IN IP4_ADDR   NetMask
>)
>  {
> +  INTN   MaskLength;
> +
>ASSERT (NetMask != 0);
> 
>if (Ip == 0 || IP4_IS_LOCAL_BROADCAST (Ip)) {
>  return FALSE;
>}
> 
> -  if (NetGetMaskLength (NetMask) != 31) {
> +  MaskLength = NetGetMaskLength (NetMask);
> +  ASSERT ((MaskLength >= 0) && (MaskLength <= IP4_MASK_NUM));
> +  if (MaskLength < 31) {
>  if (((Ip &~NetMask) == ~NetMask) || ((Ip &~NetMask) == 0)) {
>return FALSE;
>  }
> -  } else {
> -return TRUE;
>}
> 
>return TRUE;
> diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
> b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
> index e0fffc9d0d..994a81f4de 100644
> --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
> +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
> @@ -55,7 +55,7 @@ typedef struct _IP4_SERVICEIP4_SERVICE;
>  /// Compose the fragment field to be used in the IP4 header.
>  ///
>  #define IP4_HEAD_FRAGMENT_FIELD(Df, Mf,

Re: [edk2] [PATCH v1 1/1] BaseTools: AutoGen.py remove unused import

2018-08-27 Thread Zhu, Yonghong
Reviewed-by: Yonghong Zhu  

Best Regards,
Zhu Yonghong

-Original Message-
From: Carsey, Jaben 
Sent: Tuesday, August 28, 2018 6:08 AM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong ; Gao, Liming 
Subject: [PATCH v1 1/1] BaseTools: AutoGen.py remove unused import

AutoGen does not use anything defined in BuildClassObject

Cc: Yonghong Zhu 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index eb1b28388967..314a321e95c6 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -39,7 +39,6 @@ from Common.StringUtils import *  import Common.GlobalData as 
GlobalData  from GenFds.FdfParser import *  from CommonDataClass.CommonClass 
import SkuInfoClass -from Workspace.BuildClassObject import *  from 
GenPatchPcdTable.GenPatchPcdTable import parsePcdInfoFromMapFile  import 
Common.VpdInfoFile as VpdInfoFile  from .GenPcdDb import CreatePcdDatabaseCode
--
2.16.2.windows.1

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


[edk2] [V2 patch] ShellPkg/SmbiosView: Update SmbiosView for SMBIOS3.2.0

2018-08-27 Thread Dandan Bi
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1099

Update SmbiosView to parse the new definitions which
are introduced in SMBIOS3.2.0

V2:
1. Add structure length check before dump the fileds in
Type 9 and Type 17 in case some fileds are not organized
and reported by drivers.
2. Dump the InterfaceTypeSpecificData in Type 42.

Cc: Jaben Carsey 
Cc: Ruiyu Ni 
Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi 
---
 .../SmbiosView/PrintInfo.c |  88 +++---
 .../SmbiosView/QueryTable.c| 135 -
 .../SmbiosView/QueryTable.h|  26 +++-
 .../SmbiosView/SmbiosViewStrings.uni   |   9 +-
 4 files changed, 239 insertions(+), 19 deletions(-)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index 93c6094df1..a91677e670 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -541,26 +541,51 @@ SmbiosPrintStructure (
 
   //
   // System Slots (Type 9)
   //
   case 9:
-PRINT_PENDING_STRING (Struct, Type9, SlotDesignation);
-DisplaySystemSlotType (Struct->Type9->SlotType, Option);
-DisplaySystemSlotDataBusWidth (Struct->Type9->SlotDataBusWidth, Option);
-DisplaySystemSlotCurrentUsage (Struct->Type9->CurrentUsage, Option);
-DisplaySystemSlotLength (Struct->Type9->SlotLength, Option);
-DisplaySystemSlotId (
-  Struct->Type9->SlotID,
-  Struct->Type9->SlotType,
-  Option
- );
-DisplaySlotCharacteristics1 (*(UINT8 *) 
&(Struct->Type9->SlotCharacteristics1), Option);
-DisplaySlotCharacteristics2 (*(UINT8 *) 
&(Struct->Type9->SlotCharacteristics2), Option);
-if (AE_SMBIOS_VERSION (0x2, 0x6) && (Struct->Hdr->Length > 0xD)) {
-  PRINT_STRUCT_VALUE_H (Struct, Type9, SegmentGroupNum);
-  PRINT_STRUCT_VALUE_H (Struct, Type9, BusNum);
-  PRINT_STRUCT_VALUE_H (Struct, Type9, DevFuncNum);
+{
+  MISC_SLOT_PEER_GROUP  *PeerGroupPtr;
+  UINT8 PeerGroupCount;
+
+  PRINT_PENDING_STRING (Struct, Type9, SlotDesignation);
+  DisplaySystemSlotType (Struct->Type9->SlotType, Option);
+  DisplaySystemSlotDataBusWidth (Struct->Type9->SlotDataBusWidth, Option);
+  DisplaySystemSlotCurrentUsage (Struct->Type9->CurrentUsage, Option);
+  DisplaySystemSlotLength (Struct->Type9->SlotLength, Option);
+  DisplaySystemSlotId (
+Struct->Type9->SlotID,
+Struct->Type9->SlotType,
+Option
+   );
+  DisplaySlotCharacteristics1 (*(UINT8 *) 
&(Struct->Type9->SlotCharacteristics1), Option);
+  DisplaySlotCharacteristics2 (*(UINT8 *) 
&(Struct->Type9->SlotCharacteristics2), Option);
+  if (AE_SMBIOS_VERSION (0x2, 0x6) && (Struct->Hdr->Length > 0xD)) {
+PRINT_STRUCT_VALUE_H (Struct, Type9, SegmentGroupNum);
+PRINT_STRUCT_VALUE_H (Struct, Type9, BusNum);
+PRINT_STRUCT_VALUE_H (Struct, Type9, DevFuncNum);
+  }
+  if (AE_SMBIOS_VERSION (0x3, 0x2)) {
+if (Struct->Hdr->Length > 0x11) {
+  PRINT_STRUCT_VALUE (Struct, Type9, DataBusWidth);
+}
+if (Struct->Hdr->Length > 0x12) {
+  PRINT_STRUCT_VALUE (Struct, Type9, PeerGroupingCount);
+
+  PeerGroupCount = Struct->Type9->PeerGroupingCount;
+  if (PeerGroupCount > 0) {
+PeerGroupPtr   = Struct->Type9->PeerGroups;
+for (Index = 0; Index < PeerGroupCount; Index++) {
+  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN 
(STR_SMBIOSVIEW_PRINTINFO_SLOT_PEER_GROUPS), gShellDebug1HiiHandle, Index + 1);
+  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN 
(STR_SMBIOSVIEW_PRINTINFO_SEGMENT_GROUP_NUM), gShellDebug1HiiHandle, 
PeerGroupPtr[Index].SegmentGroupNum);
+  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN 
(STR_SMBIOSVIEW_PRINTINFO_BUS_NUM), gShellDebug1HiiHandle, 
PeerGroupPtr[Index].BusNum);
+  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN 
(STR_SMBIOSVIEW_PRINTINFO_DEV_FUNC_NUM), gShellDebug1HiiHandle, 
PeerGroupPtr[Index].DevFuncNum);
+  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN 
(STR_SMBIOSVIEW_PRINTINFO_DATA_BUS_WIDTH), gShellDebug1HiiHandle, 
PeerGroupPtr[Index].DataBusWidth);
+}
+  }
+}
+  }
 }
 break;
 
   //
   // On Board Devices Information (Type 10)
@@ -753,10 +778,33 @@ SmbiosPrintStructure (
 if (AE_SMBIOS_VERSION (0x2, 0x8) && (Struct->Hdr->Length > 0x22)) {
   PRINT_STRUCT_VALUE (Struct, Type17, MinimumVoltage);
   PRINT_STRUCT_VALUE (Struct, Type17, MaximumVoltage);
   PRINT_STRUCT_VALUE (Struct, Type17, ConfiguredVoltage);
 }
+if (AE_SMBIOS_VERSION (0x3, 0x2)) {
+  if (Struct->Hdr->Length > 0x28) {
+DisplayMemoryDeviceMemoryTechnology (Struct->Type17->MemoryTechnology, 
Option);
+Disp

Re: [edk2] [Patch] BaseTools: Fix one expression bug to support ~ operate

2018-08-27 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
> Yonghong Zhu
> Sent: Wednesday, August 22, 2018 3:17 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [Patch] BaseTools: Fix one expression bug to support ~ operate
> 
> current use (0x41>=~0x0&0x41|0x0) as Pcd value cause build failure
> because the ~ is not correctly recognized.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu 
> ---
>  BaseTools/Source/Python/Common/Expression.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/Common/Expression.py 
> b/BaseTools/Source/Python/Common/Expression.py
> index 0091e47..78c69fa 100644
> --- a/BaseTools/Source/Python/Common/Expression.py
> +++ b/BaseTools/Source/Python/Common/Expression.py
> @@ -786,11 +786,11 @@ class ValueExpression(BaseExpression):
>  return ''
> 
>  OpToken = ''
>  for Ch in Expr:
>  if Ch in self.NonLetterOpLst:
> -if '!' == Ch and OpToken:
> +if Ch in ['!', '~'] and OpToken:
>  break
>  self._Idx += 1
>  OpToken += Ch
>  else:
>  break
> --
> 2.6.1.windows.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] Maintainers.txt: Update maintainer of MdeModulePkg

2018-08-27 Thread Dong, Eric
Reviewed-by: Eric Dong 

> -Original Message-
> From: Zeng, Star
> Sent: Tuesday, August 28, 2018 1:36 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star ; Wang, Jian J ;
> Dong, Eric ; Kinney, Michael D
> ; Laszlo Ersek ; Andrew
> Fish ; Leif Lindholm 
> Subject: [PATCH] Maintainers.txt: Update maintainer of MdeModulePkg
> 
> Add Jian J Wang  and remove Eric Dong
> .
> Eric is focusing on UefiCpuPkg.
> 
> Cc: Jian J Wang 
> Cc: Eric Dong 
> Cc: Michael D Kinney 
> Cc: Laszlo Ersek 
> Cc: Andrew Fish 
> Cc: Leif Lindholm 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng 
> ---
>  Maintainers.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt index
> df7dc48f75b5..61df6e198b79 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -172,7 +172,7 @@ M: Rangasai V Chaganty
>   MdeModulePkg
>  W: https://github.com/tianocore/tianocore.github.io/wiki/MdeModulePkg
>  M: Star Zeng 
> -M: Eric Dong 
> +M: Jian J Wang 
>  M: NetworkPkg maintainers
>(Universal/Network and related libraries, header files)
>  R: Ruiyu Ni 
> --
> 2.7.0.windows.1

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


Re: [edk2] [PATCH] Maintainers.txt: Update maintainer of MdeModulePkg

2018-08-27 Thread Wang, Jian J
Reviewed-by: Jian J Wang 

> -Original Message-
> From: Zeng, Star
> Sent: Tuesday, August 28, 2018 1:36 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star ; Wang, Jian J ;
> Dong, Eric ; Kinney, Michael D
> ; Laszlo Ersek ; Andrew Fish
> ; Leif Lindholm 
> Subject: [PATCH] Maintainers.txt: Update maintainer of MdeModulePkg
> 
> Add Jian J Wang  and
> remove Eric Dong .
> Eric is focusing on UefiCpuPkg.
> 
> Cc: Jian J Wang 
> Cc: Eric Dong 
> Cc: Michael D Kinney 
> Cc: Laszlo Ersek 
> Cc: Andrew Fish 
> Cc: Leif Lindholm 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng 
> ---
>  Maintainers.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index df7dc48f75b5..61df6e198b79 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -172,7 +172,7 @@ M: Rangasai V Chaganty
> 
>  MdeModulePkg
>  W: https://github.com/tianocore/tianocore.github.io/wiki/MdeModulePkg
>  M: Star Zeng 
> -M: Eric Dong 
> +M: Jian J Wang 
>  M: NetworkPkg maintainers
>(Universal/Network and related libraries, header files)
>  R: Ruiyu Ni 
> --
> 2.7.0.windows.1

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


[edk2] [PATCH] Maintainers.txt: Update maintainer of MdeModulePkg

2018-08-27 Thread Star Zeng
Add Jian J Wang  and
remove Eric Dong .
Eric is focusing on UefiCpuPkg.

Cc: Jian J Wang 
Cc: Eric Dong 
Cc: Michael D Kinney 
Cc: Laszlo Ersek 
Cc: Andrew Fish 
Cc: Leif Lindholm 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng 
---
 Maintainers.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index df7dc48f75b5..61df6e198b79 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -172,7 +172,7 @@ M: Rangasai V Chaganty 
 MdeModulePkg
 W: https://github.com/tianocore/tianocore.github.io/wiki/MdeModulePkg
 M: Star Zeng 
-M: Eric Dong 
+M: Jian J Wang 
 M: NetworkPkg maintainers
   (Universal/Network and related libraries, header files)
 R: Ruiyu Ni 
-- 
2.7.0.windows.1

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


Re: [edk2] [PATCH v3 06/16] IntelFsp2WrapperPkg/BaseFspWrapperPlatformLibSample: Remove PCDs

2018-08-27 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

-Original Message-
From: Zhang, Shenglei 
Sent: Tuesday, August 28, 2018 11:43 AM
To: edk2-devel@lists.01.org
Cc: Yao, Jiewen ; Chiu, Chasel ; 
Laszlo Ersek 
Subject: [PATCH v3 06/16] IntelFsp2WrapperPkg/BaseFspWrapperPlatformLibSample: 
Remove PCDs

The PCDs below are unused, so they have been removed from inf.
gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase
gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize

Cc: Jiewen Yao 
Cc: Chasel Chiu 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 .../BaseFspWrapperPlatformLibSample.inf| 3 ---
 1 file changed, 3 deletions(-)

diff --git 
a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
 
b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
index f9581e8456..3bc024459f 100644
--- 
a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
+++ 
b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
@@ -55,6 +55,3 @@
 
 [LibraryClasses]
 
-[Pcd]
-  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase  ## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize  ## CONSUMES
-- 
2.18.0.windows.1

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


Re: [edk2] [PATCH v3 05/16] IntelFsp2WrapperPkg/FspWrapperNotifyDxe: Remove an unused PCD

2018-08-27 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

-Original Message-
From: Zhang, Shenglei 
Sent: Tuesday, August 28, 2018 11:43 AM
To: edk2-devel@lists.01.org
Cc: Yao, Jiewen ; Chiu, Chasel ; 
Laszlo Ersek 
Subject: [PATCH v3 05/16] IntelFsp2WrapperPkg/FspWrapperNotifyDxe: Remove an 
unused PCD

The PCD below is unused, so it has been removed from inf.
gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress

Cc: Jiewen Yao 
Cc: Chasel Chiu 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf 
b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
index ce3bfa0c75..011cf89d3f 100644
--- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
+++ b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
@@ -61,7 +61,6 @@
   gFspHobGuid   ## CONSUMES ## HOB
 
 [Pcd]
-  gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress  ## CONSUMES
   gIntelFsp2WrapperTokenSpaceGuid.PcdSkipFspApi   ## CONSUMES
 
 [Depex]
-- 
2.18.0.windows.1

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


Re: [edk2] [PATCH v3 11/16] MdeModulePkg/DxeCapsuleLibFmp: Remove unused PCDs

2018-08-27 Thread Zeng, Star
Shenglei,

The library Pcdlib is not linked, so "#include "
is deleted.


There is massy code, please correct it before it can be pushed.


Thanks,
Star

-Original Message-
From: Zhang, Shenglei 
Sent: Tuesday, August 28, 2018 11:43 AM
To: edk2-devel@lists.01.org
Cc: Zeng, Star ; Dong, Eric ; Laszlo 
Ersek 
Subject: [PATCH v3 11/16] MdeModulePkg/DxeCapsuleLibFmp: Remove unused PCDs

The PCDs below are unused, so they have been removed from inf.
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleMax
gEfiMdeModulePkgTokenSpaceGuid.PcdSystemRebootAfterCapsuleProcessFlag
gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeSubClassCapsule
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesBegin
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesEnd
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdatingFirmware
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareSuccess
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareFailed
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeResettingSystem
The library Pcdlib is not linked, so "#include "
is deleted.

Cc: Star Zeng 
Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Star Zeng 
---
 MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c |  1 -  
.../Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf | 11 ---
 2 files changed, 12 deletions(-)

diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c 
b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
index 91c6849a46..fe3ee93523 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
@@ -39,7 +39,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf 
b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf
index 342df9e99c..d5e87cb97b 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf
@@ -56,17 +56,6 @@
   HobLib
   BmpSupportLib
 
-[Pcd]
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleMax   
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSystemRebootAfterCapsuleProcessFlag  
## CONSUMES
-
-  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeSubClassCapsule
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesBegin
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesEnd  
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdatingFirmware
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareSuccess   
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareFailed
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeResettingSystem 
## CONSUMES
 
 [Protocols]
   gEsrtManagementProtocolGuid   ## CONSUMES
--
2.18.0.windows.1

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


[edk2] [PATCH v3 09/16] UefiCpuPkg/CpuCommonFeaturesLib: Remove an unused PCD

2018-08-27 Thread shenglei
The PCD below is unused, so it has been removed from inf.
gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSupport

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Eric Dong 
---
 UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.inf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.inf 
b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.inf
index 8bc8979de0..cb7f227f6c 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.inf
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.inf
@@ -64,7 +64,6 @@
   LocalApicLib
 
 [Pcd]
-  gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSupport## CONSUMES
   gUefiCpuPkgTokenSpaceGuid.PcdCpuClockModulationDutyCycle   ## 
SOMETIMES_CONSUMES
   gUefiCpuPkgTokenSpaceGuid.PcdIsPowerOnReset## 
SOMETIMES_CONSUMES
   gUefiCpuPkgTokenSpaceGuid.PcdCpuProcTraceOutputScheme  ## 
SOMETIMES_CONSUMES
-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 15/16] ShellPkg/UefiHandleParsingLib: Remove an unused PCD

2018-08-27 Thread shenglei
The PCD below is unused, so it has been removed from inf.
gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize

Cc: Jaben Carsey 
Cc: Ruiyu Ni 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Ruiyu Ni 
---
 ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
index e5e007bef3..a795fb92de 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
@@ -353,5 +353,4 @@
   gEfiAdapterInfoUndiIpv6SupportGuid  ## 
SOMETIMES_CONSUMES ## GUID
 
 [Pcd.common]
-  gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize  ## CONSUMES
   gEfiShellPkgTokenSpaceGuid.PcdShellIncludeNtGuids   ## CONSUMES
-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 14/16] ShellPkg/DpDynamicCommand: Remove unused PCDs

2018-08-27 Thread shenglei
The PCDs below are unused, so they have been removed from inf.
gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize in DpApp.inf
gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize in
DpDynamicCommand.inf

Cc: Jaben Carsey 
Cc: Ruiyu Ni 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Ruiyu Ni 
---
 ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf| 2 --
 ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf | 3 ---
 2 files changed, 5 deletions(-)

diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf 
b/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf
index cedb333b28..c35a3087cf 100644
--- a/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf
+++ b/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf
@@ -69,5 +69,3 @@
   gEfiLoadedImageDevicePathProtocolGuid   ## SOMETIMES_CONSUMES
   gEfiHiiPackageListProtocolGuid  ## CONSUMES
 
-[Pcd]
-  gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize   ## CONSUMES
diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf 
b/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf
index 8fd3bbd5df..2d07b32266 100644
--- a/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf
+++ b/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf
@@ -71,8 +71,5 @@
   gEfiHiiPackageListProtocolGuid  ## CONSUMES
   gEfiShellDynamicCommandProtocolGuid ## PRODUCES
 
-[Pcd]
-  gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize   ## CONSUMES
-
 [DEPEX]
   TRUE
-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 12/16] MdeModulePkg/FirmwarePerformanceDataTableDxe: Remove an unused PCD

2018-08-27 Thread shenglei
The PCD below is unused, so it has been removed from inf.
gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize

Cc: Star Zeng 
Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Star Zeng 
---
 .../FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf   | 1 -
 1 file changed, 1 deletion(-)

diff --git 
a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
 
b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
index 983ce41b48..023ab00c7c 100644
--- 
a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
+++ 
b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
@@ -73,7 +73,6 @@
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderLoad## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderStart   ## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId   ## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision  ## CONSUMES
-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 13/16] ShellPkg/Shell: Remove unused PCDs

2018-08-27 Thread shenglei
The PCDs below are unused, so they have been removed from inf.
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize
gEfiShellPkgTokenSpaceGuid.PcdShellMapNameLength

Cc: Jaben Carsey 
Cc: Ruiyu Ni 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Ruiyu Ni 
---
 ShellPkg/Application/Shell/Shell.inf | 2 --
 1 file changed, 2 deletions(-)

diff --git a/ShellPkg/Application/Shell/Shell.inf 
b/ShellPkg/Application/Shell/Shell.inf
index d89f85bb76..83049844d6 100644
--- a/ShellPkg/Application/Shell/Shell.inf
+++ b/ShellPkg/Application/Shell/Shell.inf
@@ -102,10 +102,8 @@
   gEfiShellPkgTokenSpaceGuid.PcdShellRequireHiiPlatform ## CONSUMES
   gEfiShellPkgTokenSpaceGuid.PcdShellSupportFrameworkHii## CONSUMES
   gEfiShellPkgTokenSpaceGuid.PcdShellPageBreakDefault   ## CONSUMES
-  gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize  ## CONSUMES
   gEfiShellPkgTokenSpaceGuid.PcdShellInsertModeDefault  ## CONSUMES
   gEfiShellPkgTokenSpaceGuid.PcdShellScreenLogCount ## CONSUMES
-  gEfiShellPkgTokenSpaceGuid.PcdShellMapNameLength  ## CONSUMES
   gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize## CONSUMES
   gEfiShellPkgTokenSpaceGuid.PcdShellForceConsole   ## CONSUMES
   gEfiShellPkgTokenSpaceGuid.PcdShellSupplier   ## CONSUMES
-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 10/16] MdePkg/BaseLib: Remove an unused PCD

2018-08-27 Thread shenglei
The PCD below is unused, so it has been removed from inf.
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Laszlo Ersek 
---
 MdePkg/Library/BaseLib/BaseLib.inf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/MdePkg/Library/BaseLib/BaseLib.inf 
b/MdePkg/Library/BaseLib/BaseLib.inf
index a1b5ec4b75..4ae8a0b05a 100644
--- a/MdePkg/Library/BaseLib/BaseLib.inf
+++ b/MdePkg/Library/BaseLib/BaseLib.inf
@@ -643,7 +643,6 @@
   gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength  ## 
SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength ## 
SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength   ## 
SOMETIMES_CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask## 
SOMETIMES_CONSUMES
 
 [FeaturePcd]
   gEfiMdePkgTokenSpaceGuid.PcdVerifyNodeInList  ## CONSUMES
-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 16/16] ShellPkg/UefiShellDebug1CommandsLib: Remove unused PCDs

2018-08-27 Thread shenglei
The PCDs below are unused, so they have been removed from inf.
gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength

Cc: Jaben Carsey 
Cc: Ruiyu Ni 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Ruiyu Ni 
---
 .../UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf   | 2 --
 1 file changed, 2 deletions(-)

diff --git 
a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
index 3ea51ec082..ec1f87ae19 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
@@ -119,8 +119,6 @@
 
 [Pcd]
   gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask  ## CONSUMES
-  gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength  ## CONSUMES
 
 [Protocols]
   gEfiPciRootBridgeIoProtocolGuid ## SOMETIMES_CONSUMES
-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 07/16] SecurityPkg/Tcg2ConfigPei: Remove an unused PCD

2018-08-27 Thread shenglei
The PCD below is unused, so it has been removed from inf.
gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress

Cc: Jiewen Yao 
Cc: Chao Zhang 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Chao Zhang 
---
 SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf 
b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
index a0136bc0c5..581669a277 100644
--- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
+++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
@@ -67,7 +67,6 @@
   gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid ## PRODUCES
   gEfiSecurityPkgTokenSpaceGuid.PcdTpmInitializationPolicy ## PRODUCES
   gEfiSecurityPkgTokenSpaceGuid.PcdTpmAutoDetection## CONSUMES
-  gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress  ## 
SOMETIMES_CONSUMES
 
 [Depex]
   gEfiPeiMasterBootModePpiGuid AND
-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 11/16] MdeModulePkg/DxeCapsuleLibFmp: Remove unused PCDs

2018-08-27 Thread shenglei
The PCDs below are unused, so they have been removed from inf.
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleMax
gEfiMdeModulePkgTokenSpaceGuid.PcdSystemRebootAfterCapsuleProcessFlag
gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeSubClassCapsule
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesBegin
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesEnd
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdatingFirmware
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareSuccess
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareFailed
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeResettingSystem
The library Pcdlib is not linked??? so "#include "
is deleted.

Cc: Star Zeng 
Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Star Zeng 
---
 MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c |  1 -
 .../Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf | 11 ---
 2 files changed, 12 deletions(-)

diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c 
b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
index 91c6849a46..fe3ee93523 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
@@ -39,7 +39,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf 
b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf
index 342df9e99c..d5e87cb97b 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf
@@ -56,17 +56,6 @@
   HobLib
   BmpSupportLib
 
-[Pcd]
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleMax   
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSystemRebootAfterCapsuleProcessFlag  
## CONSUMES
-
-  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeSubClassCapsule
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesBegin
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesEnd  
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdatingFirmware
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareSuccess   
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareFailed
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeResettingSystem 
## CONSUMES
 
 [Protocols]
   gEsrtManagementProtocolGuid   ## CONSUMES
-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 05/16] IntelFsp2WrapperPkg/FspWrapperNotifyDxe: Remove an unused PCD

2018-08-27 Thread shenglei
The PCD below is unused, so it has been removed from inf.
gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress

Cc: Jiewen Yao 
Cc: Chasel Chiu 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf 
b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
index ce3bfa0c75..011cf89d3f 100644
--- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
+++ b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
@@ -61,7 +61,6 @@
   gFspHobGuid   ## CONSUMES ## HOB
 
 [Pcd]
-  gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress  ## CONSUMES
   gIntelFsp2WrapperTokenSpaceGuid.PcdSkipFspApi   ## CONSUMES
 
 [Depex]
-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 08/16] SecurityPkg/Tcg2Dxe: Remove unused PCDs

2018-08-27 Thread shenglei
The PCDs below are unused, so they have been removed from inf.
gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision

Cc: Jiewen Yao 
Cc: Chao Zhang 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Chao Zhang 
---
 SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf | 6 --
 1 file changed, 6 deletions(-)

diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf 
b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf
index b875ab7e01..2b89869ef1 100644
--- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf
+++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf
@@ -101,12 +101,6 @@
   gEfiSecurityPkgTokenSpaceGuid.PcdTpmPlatformClass ## 
SOMETIMES_CONSUMES
   gEfiSecurityPkgTokenSpaceGuid.PcdFirmwareDebuggerInitialized  ## 
SOMETIMES_CONSUMES
   gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid  ## 
CONSUMES
-  gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress   ## 
SOMETIMES_CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId## 
SOMETIMES_CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId   ## 
SOMETIMES_CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision  ## 
SOMETIMES_CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId## 
SOMETIMES_CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision  ## 
SOMETIMES_CONSUMES
   gEfiSecurityPkgTokenSpaceGuid.PcdStatusCodeSubClassTpmDevice  ## 
SOMETIMES_CONSUMES
   gEfiSecurityPkgTokenSpaceGuid.PcdTcg2HashAlgorithmBitmap  ## 
CONSUMES
   gEfiSecurityPkgTokenSpaceGuid.PcdTcg2NumberOfPCRBanks ## 
CONSUMES
-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 00/16] Removed unused PCDs

2018-08-27 Thread shenglei
A lot of unused PCDs are removed from inf.
All packages are built and the results are "pass".

v2:
1.Split MdeModulePkg into separated patches.
2.Split IntelFsp2Pkg into separated patches.

v3:
1.Split ShellPkg into separated patches.
2.Split SecurityPkg into separated patches.
3.Split IntelFsp2WrapperPkg into separated patches.
4.Split IntelFspPkg into separated patches.
5.Update the message in the cover letter.

shenglei (16):
  IntelFsp2Pkg FspSecCore: Remove unused PCDs
  IntelFsp2Pkg/BaseFspCommonLib: Remove unused PCDs
  IntelFsp2Pkg/BaseFspPlatformLib: Remove unused PCDs
  IntelFsp2Pkg/BaseFspSwitchStackLib: Remove unused PCDs
  IntelFsp2WrapperPkg/FspWrapperNotifyDxe: Remove an unused PCD
  IntelFsp2WrapperPkg/BaseFspWrapperPlatformLibSample: Remove PCDs
  SecurityPkg/Tcg2ConfigPei: Remove an unused PCD
  SecurityPkg/Tcg2Dxe: Remove unused PCDs
  UefiCpuPkg/CpuCommonFeaturesLib: Remove an unused PCD
  MdePkg/BaseLib: Remove an unused PCD
  MdeModulePkg/DxeCapsuleLibFmp: Remove unused PCDs
  MdeModulePkg/FirmwarePerformanceDataTableDxe: Remove an unused PCD
  ShellPkg/Shell: Remove unused PCDs
  ShellPkg/DpDynamicCommand: Remove unused PCDs
  ShellPkg/UefiHandleParsingLib: Remove an unused PCD
  ShellPkg/UefiShellDebug1CommandsLib: Remove unused PCDs

 IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf   |  6 --
 IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf   | 11 ---
 IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf   |  5 -
 .../Library/BaseFspCommonLib/BaseFspCommonLib.inf |  5 -
 .../Library/BaseFspPlatformLib/BaseFspPlatformLib.inf |  9 -
 .../BaseFspSwitchStackLib/BaseFspSwitchStackLib.inf   |  4 
 .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf   |  1 -
 .../BaseFspWrapperPlatformLibSample.inf   |  3 ---
 MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c |  1 -
 .../Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf | 11 ---
 .../FirmwarePerformanceDxe.inf|  1 -
 MdePkg/Library/BaseLib/BaseLib.inf|  1 -
 SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf  |  1 -
 SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf   |  6 --
 ShellPkg/Application/Shell/Shell.inf  |  2 --
 ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf|  2 --
 .../DpDynamicCommand/DpDynamicCommand.inf |  3 ---
 .../UefiHandleParsingLib/UefiHandleParsingLib.inf |  1 -
 .../UefiShellDebug1CommandsLib.inf|  2 --
 .../CpuCommonFeaturesLib/CpuCommonFeaturesLib.inf |  1 -
 20 files changed, 76 deletions(-)

-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 01/16] IntelFsp2Pkg/FspSecCore: Remove unused PCDs

2018-08-27 Thread shenglei
The PCDs below are unused, so they have been removed from inf.
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress
gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry
gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress
gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase
gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize
gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry
gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry

Cc: Jiewen Yao 
Cc: Chasel Chiu 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Chasel Chiu 
---
 IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf |  6 --
 IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf | 11 ---
 IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf |  5 -
 3 files changed, 22 deletions(-)

diff --git a/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf 
b/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
index 0500a197f8..c657862deb 100644
--- a/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
+++ b/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
@@ -58,17 +58,11 @@
   FspSecPlatformLib
 
 [Pcd]
-  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress   ## UNDEFINED
-  gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress  ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase  ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize  ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize   ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdFspHeapSizePercentage ## CONSUMES
 
-[FixedPcd]
-  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry  ## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry   ## CONSUMES
-
 [Ppis]
   gEfiTemporaryRamSupportPpiGuid  ## PRODUCES
 
diff --git a/IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf 
b/IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf
index a3563dd8cf..dd3f8e56a0 100644
--- a/IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf
+++ b/IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf
@@ -52,17 +52,6 @@
   FspCommonLib
   FspSecPlatformLib
 
-[Pcd]
-  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress   ## UNDEFINED
-  gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress  ## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase  ## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize  ## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize   ## CONSUMES
-
-[FixedPcd]
-  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry  ## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry   ## CONSUMES
-
 [Ppis]
   gEfiTemporaryRamSupportPpiGuid  ## PRODUCES
 
diff --git a/IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf 
b/IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf
index cf6a1918a3..aff4b23f88 100644
--- a/IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf
+++ b/IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf
@@ -53,14 +53,9 @@
   FspSecPlatformLib
 
 [Pcd]
-  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress   ## UNDEFINED
   gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase  ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize  ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdFspReservedBufferSize ## CONSUMES
 
-[FixedPcd]
-  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry  ## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry   ## CONSUMES
-
 [Ppis]
   gEfiTemporaryRamSupportPpiGuid  ## PRODUCES
-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 02/16] IntelFsp2Pkg/BaseFspCommonLib: Remove unused PCDs

2018-08-27 Thread shenglei
The PCDs below are unused, so they have been removed from inf.
gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry
gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry
gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase
gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize

Cc: Jiewen Yao 
Cc: Chasel Chiu 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Chasel Chiu 
---
 IntelFsp2Pkg/Library/BaseFspCommonLib/BaseFspCommonLib.inf | 5 -
 1 file changed, 5 deletions(-)

diff --git a/IntelFsp2Pkg/Library/BaseFspCommonLib/BaseFspCommonLib.inf 
b/IntelFsp2Pkg/Library/BaseFspCommonLib/BaseFspCommonLib.inf
index c9d98357e2..ff82f8040b 100644
--- a/IntelFsp2Pkg/Library/BaseFspCommonLib/BaseFspCommonLib.inf
+++ b/IntelFsp2Pkg/Library/BaseFspCommonLib/BaseFspCommonLib.inf
@@ -33,8 +33,3 @@
 [Pcd]
   gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress  ## CONSUMES
 
-[FixedPcd]
-  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry  ## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry   ## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase  ## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize  ## CONSUMES
-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 03/16] IntelFsp2Pkg/BaseFspPlatformLib: Remove unused PCDs

2018-08-27 Thread shenglei
The PCDs below are unused, so they have been removed from inf.
gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress
gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase
gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize
gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize
gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry
gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry

Cc: Jiewen Yao 
Cc: Chasel Chiu 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Chasel Chiu 
---
 .../Library/BaseFspPlatformLib/BaseFspPlatformLib.inf| 9 -
 1 file changed, 9 deletions(-)

diff --git a/IntelFsp2Pkg/Library/BaseFspPlatformLib/BaseFspPlatformLib.inf 
b/IntelFsp2Pkg/Library/BaseFspPlatformLib/BaseFspPlatformLib.inf
index 907482daed..b9e8a61809 100644
--- a/IntelFsp2Pkg/Library/BaseFspPlatformLib/BaseFspPlatformLib.inf
+++ b/IntelFsp2Pkg/Library/BaseFspPlatformLib/BaseFspPlatformLib.inf
@@ -35,12 +35,6 @@
   PerformanceLib
   ReportStatusCodeLib
 
-[Pcd]
-  gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize ## CONSUMES
-
 [Guids]
   gFspPerformanceDataGuid   ## CONSUMES ## GUID
   gFspEventEndOfFirmwareGuid## PRODUCES ## GUID
@@ -49,6 +43,3 @@
 [Protocols]
   gEfiPciEnumerationCompleteProtocolGuid## CONSUMES
 
-[FixedPcd]
-  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry ## CONSUMES
-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 04/16] IntelFsp2Pkg/BaseFspSwitchStackLib: Remove unused PCDs

2018-08-27 Thread shenglei
The PCDs below are unused, so they have been removed from inf.
gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry
gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry

Cc: Jiewen Yao 
Cc: Chasel Chiu 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Chasel Chiu 
---
 .../Library/BaseFspSwitchStackLib/BaseFspSwitchStackLib.inf   | 4 
 1 file changed, 4 deletions(-)

diff --git 
a/IntelFsp2Pkg/Library/BaseFspSwitchStackLib/BaseFspSwitchStackLib.inf 
b/IntelFsp2Pkg/Library/BaseFspSwitchStackLib/BaseFspSwitchStackLib.inf
index b3c673a0ac..97cf3caa6a 100644
--- a/IntelFsp2Pkg/Library/BaseFspSwitchStackLib/BaseFspSwitchStackLib.inf
+++ b/IntelFsp2Pkg/Library/BaseFspSwitchStackLib/BaseFspSwitchStackLib.inf
@@ -34,9 +34,5 @@
   BaseLib
   IoLib
 
-[FixedPcd]
-  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPatchEntry  ## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxPerfEntry   ## CONSUMES
-
 
 
-- 
2.18.0.windows.1

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


[edk2] [PATCH v3 06/16] IntelFsp2WrapperPkg/BaseFspWrapperPlatformLibSample: Remove PCDs

2018-08-27 Thread shenglei
The PCDs below are unused, so they have been removed from inf.
gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase
gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize

Cc: Jiewen Yao 
Cc: Chasel Chiu 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 .../BaseFspWrapperPlatformLibSample.inf| 3 ---
 1 file changed, 3 deletions(-)

diff --git 
a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
 
b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
index f9581e8456..3bc024459f 100644
--- 
a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
+++ 
b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
@@ -55,6 +55,3 @@
 
 [LibraryClasses]
 
-[Pcd]
-  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase  ## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize  ## CONSUMES
-- 
2.18.0.windows.1

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


Re: [edk2] [PATCH v2 2/4] UefiCpuPkg/CpuExceptionHandlerLib: Setup single step in #PF handler

2018-08-27 Thread Wang, Jian J
Thanks. Since there're just some minor changes, I'll not provide v3 patches
and push the changes to master soon.

Regards,
Jian

From: Dong, Eric
Sent: Tuesday, August 28, 2018 9:15 AM
To: Wang, Jian J ; edk2-devel@lists.01.org
Cc: Laszlo Ersek ; Ni, Ruiyu 
Subject: RE: [PATCH v2 2/4] UefiCpuPkg/CpuExceptionHandlerLib: Setup single 
step in #PF handler

Reviewed-by: Eric Dong mailto:eric.d...@intel.com>>

> -Original Message-
> From: Wang, Jian J
> Sent: Tuesday, August 21, 2018 11:05 AM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric mailto:eric.d...@intel.com>>; Laszlo 
> Ersek mailto:ler...@redhat.com>>; Ni,
> Ruiyu mailto:ruiyu...@intel.com>>
> Subject: [PATCH v2 2/4] UefiCpuPkg/CpuExceptionHandlerLib: Setup single
> step in #PF handler
>
> > v2 changes:
> >n/a
>
> Once the #PF handler has set the page to be 'present', there should be a way
> to reset it to 'not-present'. 'TF' bit in EFLAGS can be used for this 
> purpose. 'TF'
> bit will be set in interrupted function context so that it can be triggered 
> once
> the cpu control returns back to the instruction causing #PF and re-execute it.
>
> This is an necessary step to implement non-stop mode for Heap Guard and
> NULL Pointer Detection feature.
>
> Cc: Eric Dong mailto:eric.d...@intel.com>>
> Cc: Laszlo Ersek mailto:ler...@redhat.com>>
> Cc: Ruiyu Ni mailto:ruiyu...@intel.com>>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jian J Wang 
> mailto:jian.j.w...@intel.com>>
> ---
>  .../Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.nasm   | 7
> +++
>  .../Library/CpuExceptionHandlerLib/Ia32/ExceptionTssEntryAsm.nasm  | 4 +--
> -
>  .../Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm| 4
> 
>  3 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.na
> sm
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.na
> sm
> index 45d6474091..6fcf5fb23f 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.na
> sm
> +++
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm
> +++ .nasm
> @@ -383,6 +383,13 @@ ErrorCodeAndVectorOnStack:
>  pop dword [ebp - 4]
>  mov esp, ebp
>  pop ebp
> +
> +; Enable TF bit after page fault handler runs
> +cmp dword [esp], 14   ; #PF?
> +jne .5
> +bts dword [esp + 16], 8   ; EFLAGS
> +
> +.5:
>  add esp, 8
>  cmp dword [esp - 16], 0   ; check
> EXCEPTION_HANDLER_CONTEXT.OldIdtHandler
>  jz  DoReturn
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionTssEntryAsm.n
> asm
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionTssEntryAsm.n
> asm
> index 62bcedea1a..7aac29c7e7 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionTssEntryAsm.n
> asm
> +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionTssEntryAs
> +++ m.nasm
> @@ -355,10 +355,8 @@ o16 mov [ecx + IA32_TSS._SS], ax
>  movzx  ebx, word [ecx + IA32_TSS._CS]
>  mov[eax - 0x8], ebx  ; create CS in old stack
>  movebx, dword [ecx + IA32_TSS.EFLAGS]
> -btsebx, 8
> +btsebx, 8; Set TF
>  mov[eax - 0x4], ebx  ; create eflags in old stack
> -movdword [ecx + IA32_TSS.EFLAGS], ebx; update eflags in old TSS
> -moveax, dword [ecx + IA32_TSS._ESP]  ; Get old stack pointer
>  subeax, 0xc  ; minus 12 byte
>  movdword [ecx + IA32_TSS._ESP], eax  ; Set new stack pointer
>
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.na
> sm
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.na
> sm
> index 7b97810d10..f842af2336 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.na
> sm
> +++
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.
> +++ nasm
> @@ -336,6 +336,10 @@ HasErrorCode:
>  pop r15
>
>  mov rsp, rbp
> +cmp qword [rbp + 8], 14 ; #PF?
> +jne .1
> +bts qword [rsp + 40], 8 ; RFLAGS.TF
> +.1:
>  pop rbp
>  add rsp, 16
>  cmp qword [rsp - 32], 0  ; check
> EXCEPTION_HANDLER_CONTEXT.OldIdtHandler
> --
> 2.16.2.windows.1
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [edk2-wiki PATCH] release planning: Add "SMBIOS 3.2.0 support" in Proposed Features

2018-08-27 Thread Zeng, Star
Pushed the patch at 5ec70b030eb623f0e5dfc66eeabbae513235d238.

Thanks very much.
Star
-Original Message-
From: Zeng, Star 
Sent: Friday, August 24, 2018 5:16 PM
To: Laszlo Ersek ; edk2-devel@lists.01.org
Cc: Kinney, Michael D ; Andrew Fish 
; Leif Lindholm ; Bi, Dandan 
; Zeng, Star 
Subject: RE: [edk2-wiki PATCH] release planning: Add "SMBIOS 3.2.0 support" in 
Proposed Features

Thanks. Agree and I will follow your preference to push it next week if no 
concern from others. :)

Star
-Original Message-
From: Laszlo Ersek [mailto:ler...@redhat.com]
Sent: Friday, August 24, 2018 3:10 PM
To: Zeng, Star ; edk2-devel@lists.01.org
Cc: Kinney, Michael D ; Andrew Fish 
; Leif Lindholm ; Bi, Dandan 

Subject: Re: [edk2-wiki PATCH] release planning: Add "SMBIOS 3.2.0 support" in 
Proposed Features

On 08/24/18 03:18, Zeng, Star wrote:
> I tried both at 
> https://github.com/lzeng14/tianocore/wiki/EDK-II-Release-Planning.

Thanks!

> In fact, I am ok with either one. :)

I like the version more where the URL is not human-readable (in the rendered 
article). If we introduce, say, 5 features until the next stable tag, those 
URLs will get pretty tiresome to look at.

For the version that's currently visible in your clone:

Acked-by: Laszlo Ersek 

Thanks!
Laszlo

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Thursday, August 23, 2018 7:20 PM
> To: Zeng, Star ; edk2-devel@lists.01.org
> Cc: Kinney, Michael D ; Andrew Fish 
> ; Leif Lindholm ; Bi, 
> Dandan 
> Subject: Re: [edk2-wiki PATCH] release planning: Add "SMBIOS 3.2.0 
> support" in Proposed Features
> 
> On 08/23/18 08:40, Star Zeng wrote:
>> Cc: Michael D Kinney 
>> Cc: Laszlo Ersek 
>> Cc: Andrew Fish 
>> Cc: Leif Lindholm 
>> Cc: Dandan Bi 
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Star Zeng 
>> ---
>>  EDK-II-Release-Planning.md | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/EDK-II-Release-Planning.md b/EDK-II-Release-Planning.md 
>> index 744770521cca..f2afde72796f 100644
>> --- a/EDK-II-Release-Planning.md
>> +++ b/EDK-II-Release-Planning.md
>> @@ -11,6 +11,8 @@
>>  
>>  ## Proposed Features
>>  
>> +* SMBIOS 3.2.0 support: 
>> +https://bugzilla.tianocore.org/show_bug.cgi?id=1099
>> +
>>  TBD Bugzilla List
>>  
>>  ---
>>
> 
> If you insert
> 
>   [SMBIOS 3.2.0
> support](https://bugzilla.tianocore.org/show_bug.cgi?id=1099)
> 
> instead, do you like the rendered view better?
> 
> (If you don't, then I'm fine with this patch too, of course.)
> 
> Thanks!
> Laszlo
> 

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


[edk2] [patch] MdeModulePkg/Setup: Fix incorrect size used in AllocateCopyPool

2018-08-27 Thread Dandan Bi
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1115

When the type of HiiValue is EFI_IFR_TYPE_BUFFER,
its question type is EFI_IFR_ORDERED_LIST_OP.
And the buffer size allocated for Statement->BufferValue
of orderedList is "Statement->StorageWidth"
in IfrParse.c.

So here when backup the buffer value and copy the size of
"Statement->StorageWidth + sizeof(CHAR16)" is incorrect.

This patch is to fix this issue.

Cc: Eric Dong 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi 
---
 MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c 
b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index ded1c7ad11..58daaab404 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -2002,11 +2002,11 @@ ProcessCallBackFunction (
 //
 // If EFI_BROWSER_ACTION_CHANGING type, back up the new question value.
 //
 if (Action == EFI_BROWSER_ACTION_CHANGING) {
   if (HiiValue->Type == EFI_IFR_TYPE_BUFFER) {
-BackUpBuffer = AllocateCopyPool(Statement->StorageWidth + 
sizeof(CHAR16), Statement->BufferValue);
+BackUpBuffer = AllocateCopyPool(Statement->StorageWidth, 
Statement->BufferValue);
 ASSERT (BackUpBuffer != NULL);
   } else {
 CopyMem (&BackUpValue, &HiiValue->Value, sizeof (EFI_IFR_TYPE_VALUE));
   }
 }
@@ -2128,11 +2128,11 @@ ProcessCallBackFunction (
   // then the browser will use the value passed to Callback() and ignore 
the
   // value returned by Callback().
   //
   if (Action  == EFI_BROWSER_ACTION_CHANGING && Status == EFI_UNSUPPORTED) 
{
 if (HiiValue->Type == EFI_IFR_TYPE_BUFFER) {
-  CopyMem (Statement->BufferValue, BackUpBuffer, 
Statement->StorageWidth + sizeof(CHAR16));
+  CopyMem (Statement->BufferValue, BackUpBuffer, 
Statement->StorageWidth);
 } else {
   CopyMem (&HiiValue->Value, &BackUpValue, sizeof 
(EFI_IFR_TYPE_VALUE));
 }
 
 //
-- 
2.14.3.windows.1

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


Re: [edk2] [PATCH V2 1/2] MdePkg SmBios.h: Add SMBIOS 3.2.0 definitions

2018-08-27 Thread Gao, Liming
I have no other comments. Reviewed-by: Liming Gao 

>-Original Message-
>From: Zeng, Star
>Sent: Monday, August 27, 2018 9:07 AM
>To: Bi, Dandan ; edk2-devel@lists.01.org
>Cc: Gao, Liming ; Kinney, Michael D
>; Zeng, Star 
>Subject: RE: [PATCH V2 1/2] MdePkg SmBios.h: Add SMBIOS 3.2.0 definitions
>
>Agree and thanks.
>
>Star
>-Original Message-
>From: Bi, Dandan
>Sent: Monday, August 27, 2018 9:00 AM
>To: Zeng, Star ; edk2-devel@lists.01.org
>Cc: Gao, Liming ; Kinney, Michael D
>
>Subject: RE: [PATCH V2 1/2] MdePkg SmBios.h: Add SMBIOS 3.2.0 definitions
>
>Hi Star,
>
>One minor comment:
>How about update
>+  UINT8 MemoryTechnology;   ///<
>MEMORY_DEVICE_TECHNOLOGY
>To
>+  UINT8 MemoryTechnology;   ///< The 
>enumeration value
>from MEMORY_DEVICE_TECHNOLOGY.
>In order to keep consistent with current comments style.
>
>With this update, Reviewed-by: Dandan Bi 
>
>
>Thanks,
>Dandan
>
>-Original Message-
>From: Zeng, Star
>Sent: Thursday, August 23, 2018 11:36 AM
>To: edk2-devel@lists.01.org
>Cc: Zeng, Star ; Gao, Liming ; Bi,
>Dandan ; Kinney, Michael D
>
>Subject: [PATCH V2 1/2] MdePkg SmBios.h: Add SMBIOS 3.2.0 definitions
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1099
>
>Add SMBIOS 3.2.0 definitions according to
>www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.2.0.pdf.
>
>Processor Information (Type 4):
>- SMBIOSCR00163: add socket LGA2066
>- SMBIOSCR00173: add Intel Core i9
>- SMBIOSCR00176: add new processor sockets Port Connector Information
>(Type 8):
>- SMBIOSCR00168: add USB Type-C
>System Slots (Type 9):
>- SMBIOSCR00164: add "unavailable" to current usage field
>- SMBIOSCR00167: add support for PCIe bifurcation Memory Device (Type 17):
>- SMBIOSCR00162: add support for NVDIMMs
>- SMBIOSCR00166: extend support for NVDIMMs and add support for logical
>memory type
>- SMBIOSCR00172: rename "Configured Memory Clock Speed" to "Configured
>Memory Speed"
>- SMBIOSCR00174: add new memory technology value (Intel Persistent
>Memory, 3D XPoint) IPMI Device Information (Type 38):
>- SMBIOSCR00171: add SSIF
>Management Controller Host Interface (Type 42)
>- SMBIOSCR00175: fix structure data parsing issue
>
>V2: Add missing update to MISC_PORT_TYPE and SMBIOS_TABLE_TYPE9.
>
>Cc: Liming Gao 
>Cc: Dandan Bi 
>Cc: Michael D Kinney 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Star Zeng 
>---
> MdePkg/Include/IndustryStandard/SmBios.h | 155
>---
> 1 file changed, 120 insertions(+), 35 deletions(-)
>
>diff --git a/MdePkg/Include/IndustryStandard/SmBios.h
>b/MdePkg/Include/IndustryStandard/SmBios.h
>index 5d0442873dfc..61e2f9421f97 100644
>--- a/MdePkg/Include/IndustryStandard/SmBios.h
>+++ b/MdePkg/Include/IndustryStandard/SmBios.h
>@@ -1,5 +1,5 @@
> /** @file
>-  Industry Standard Definitions of SMBIOS Table Specification v3.1.1.
>+  Industry Standard Definitions of SMBIOS Table Specification v3.2.0.
>
> Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
>@@ -685,6 +685,7 @@ typedef enum {
>   ProcessorFamilyzArchitecture  = 0xCC,
>   ProcessorFamilyIntelCoreI5= 0xCD,
>   ProcessorFamilyIntelCoreI3= 0xCE,
>+  ProcessorFamilyIntelCoreI9= 0xCF,
>   ProcessorFamilyViaC7M = 0xD2,
>   ProcessorFamilyViaC7D = 0xD3,
>   ProcessorFamilyViaC7  = 0xD4,
>@@ -806,7 +807,11 @@ typedef enum {
>   ProcessorUpgradeSocketBGA1515   = 0x35,
>   ProcessorUpgradeSocketLGA3647_1 = 0x36,
>   ProcessorUpgradeSocketSP3   = 0x37,
>-  ProcessorUpgradeSocketSP3r2 = 0x38
>+  ProcessorUpgradeSocketSP3r2 = 0x38,
>+  ProcessorUpgradeSocketLGA2066   = 0x39,
>+  ProcessorUpgradeSocketBGA1392   = 0x3A,
>+  ProcessorUpgradeSocketBGA1510   = 0x3B,
>+  ProcessorUpgradeSocketBGA1528   = 0x3C
> } PROCESSOR_UPGRADE;
>
> ///
>@@ -1159,6 +1164,7 @@ typedef enum {
>   PortConnectorTypeBNC= 0x20,
>   PortConnectorType1394   = 0x21,
>   PortConnectorTypeSasSata= 0x22,
>+  PortConnectorTypeUsbTypeC   = 0x23,
>   PortConnectorTypePC98   = 0xA0,
>   PortConnectorTypePC98Hireso = 0xA1,
>   PortConnectorTypePCH98  = 0xA2,
>@@ -1205,6 +1211,8 @@ typedef enum {
>   PortTypeNetworkPort   = 0x1F,
>   PortTypeSata  = 0x20,
>   PortTypeSas   = 0x21,
>+  PortTypeMfdp  = 0x22, ///< Multi-Function Display Port
>+  PortTypeThunderbolt   = 0x23,
>   PortType8251Compatible= 0xA0,
>   PortType8251FifoCompatible= 0xA1,
>   PortTypeOther = 0xFF
>@@ -1314,10 +1322,11 @@ typedef enum {
> /// System Slots - Current Usage.
> ///
> typedef enum {
>-  SlotUsageOther = 0x01,
>-  SlotUsageUnknown 

[edk2] [Patch 1/2] MdeModulePkg/Network: Add 32bit subnet mask support for IP4 PXE boot.

2018-08-27 Thread Fu Siyuan
This patch updates IP4 stack to support 32bit subnet mask in PXE boot process.
When 32bit subnet mask is used, the IP4 driver couldn't use the subnet mask to 
determine
whether destination IP address is on-link or not, so it will always try to send 
all the
packets to the destination IP address directly first, if failed it will continue
to try the default gateway.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
Cc: Ye Ting 
Cc: Wu Jiaxin 
---
 MdeModulePkg/Include/Library/NetLib.h |   5 +-
 MdeModulePkg/Library/DxeNetLib/DxeNetLib.c|  13 +-
 .../Universal/Network/Ip4Dxe/Ip4Common.h  |   2 +-
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c | 117 --
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h |   5 +-
 .../Universal/Network/Ip4Dxe/Ip4Impl.c|   2 +-
 .../Universal/Network/Ip4Dxe/Ip4Output.c  |  11 +-
 .../Universal/Network/Ip4Dxe/Ip4Route.c   |  21 +++-
 .../Universal/Network/Ip4Dxe/Ip4Route.h   |   5 +-
 .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c  |   6 +-
 10 files changed, 154 insertions(+), 33 deletions(-)

diff --git a/MdeModulePkg/Include/Library/NetLib.h 
b/MdeModulePkg/Include/Library/NetLib.h
index ef7bc429c1..b7ef99c7b5 100644
--- a/MdeModulePkg/Include/Library/NetLib.h
+++ b/MdeModulePkg/Include/Library/NetLib.h
@@ -422,8 +422,9 @@ NetGetIpClass (
 
   If all bits of the host address of IP are 0 or 1, IP is also not a valid 
unicast address,
   except when the originator is one of the endpoints of a point-to-point link 
with a 31-bit
-  mask (RFC3021).
-
+  mask (RFC3021), or a 32bit NetMask (all 0xFF) is used for special network 
environment (e.g.
+  PPP link).
+  
   @param[in]  IpThe IP to check against.
   @param[in]  NetMask   The mask of the IP.
 
diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c 
b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
index bf8f5523e6..63f4724062 100644
--- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
+++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
@@ -654,8 +654,9 @@ NetGetIpClass (
 
   If all bits of the host address of IP are 0 or 1, IP is also not a valid 
unicast address,
   except when the originator is one of the endpoints of a point-to-point link 
with a 31-bit
-  mask (RFC3021).
-
+  mask (RFC3021), or a 32bit NetMask (all 0xFF) is used for special network 
environment (e.g.
+  PPP link).
+  
   @param[in]  IpThe IP to check against.
   @param[in]  NetMask   The mask of the IP.
 
@@ -669,18 +670,20 @@ NetIp4IsUnicast (
   IN IP4_ADDR   NetMask
   )
 {
+  INTN   MaskLength;
+  
   ASSERT (NetMask != 0);
 
   if (Ip == 0 || IP4_IS_LOCAL_BROADCAST (Ip)) {
 return FALSE;
   }
 
-  if (NetGetMaskLength (NetMask) != 31) {
+  MaskLength = NetGetMaskLength (NetMask);
+  ASSERT ((MaskLength >= 0) && (MaskLength <= IP4_MASK_NUM));
+  if (MaskLength < 31) {
 if (((Ip &~NetMask) == ~NetMask) || ((Ip &~NetMask) == 0)) {
   return FALSE;
 }
-  } else {
-return TRUE;
   }
 
   return TRUE;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
index e0fffc9d0d..994a81f4de 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
@@ -55,7 +55,7 @@ typedef struct _IP4_SERVICEIP4_SERVICE;
 /// Compose the fragment field to be used in the IP4 header.
 ///
 #define IP4_HEAD_FRAGMENT_FIELD(Df, Mf, Offset) \
-((UINT16)(((Df) ? 0x4000 : 0) | ((Mf) ? 0x2000 : 0) | (((Offset) >> 3) & 
0x1fff)))
+((UINT16)(((Df) ? IP4_HEAD_DF_MASK : 0) | ((Mf) ? IP4_HEAD_MF_MASK : 0) | 
(((Offset) >> 3) & IP4_HEAD_OFFSET_MASK)))
 
 #define IP4_LAST_FRAGMENT(FragmentField)  \
   (((FragmentField) & IP4_HEAD_MF_MASK) == 0)
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
index 6e0e3290c7..b0172283b7 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
@@ -138,6 +138,7 @@ Ip4CancelFrameArp (
   @param[in]  CallBack  Call back function to execute if transmission
 finished.
   @param[in]  Context   Opaque parameter to the call back.
+  @param[in]  IpSb  The pointer to the IP4 service binding 
instance.
 
   @retval   Token   The wrapped token if succeed
   @retval   NULLThe wrapped token if NULL
@@ -149,7 +150,8 @@ Ip4WrapLinkTxToken (
   IN IP4_PROTOCOL   *IpInstance OPTIONAL,
   IN NET_BUF*Packet,
   IN IP4_FRAME_CALLBACK CallBack,
-  IN VOID   *Context
+  IN VOID   *Context,
+  IN IP4_SERVICE*IpSb
   )
 {
   EFI_MANAGED_NETWORK_COMPLETION_TOKEN  *MnpToken;
@@ -170,6 +172,7 @@ Ip4WrapLinkTxToken (
 
   Token->Interface  = Interface;
   Token->IpInstance = IpInstance;
+  Token->IpSb   = IpSb;
   

[edk2] [Patch 2/2] ShellPkg: Update Ifconfig command to accept 32bit subnet mask.

2018-08-27 Thread Fu Siyuan
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
Cc: Ruiyu Ni 
Cc: Ye Ting 
Cc: Wu Jiaxin 
---
 ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c 
b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
index 52415e0ad0..e9f644c739 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
@@ -1032,6 +1032,7 @@ IfConfigSetInterfaceInfo (
   SubnetMask  = NTOHL (SubnetMask);
   TempGateway = NTOHL (TempGateway);
   if ((SubnetMask != 0) &&
+  (SubnetMask != 0xu) && 
   !NetIp4IsUnicast (TempGateway, SubnetMask)) {
 ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN 
(STR_IFCONFIG_INVALID_GATEWAY), gShellNetwork1HiiHandle, VarArg->Arg);
 ShellStatus = SHELL_INVALID_PARAMETER;
-- 
2.18.0.windows.1

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


[edk2] [Patch 0/2] Add 32bit subnet mask support for IP4 PXE

2018-08-27 Thread Fu Siyuan
Fu Siyuan (2):
  MdeModulePkg/Network: Add 32bit subnet mask support for IP4 PXE boot.
  ShellPkg: Update Ifconfig command to accept 32bit subnet mask.

 MdeModulePkg/Include/Library/NetLib.h |   5 +-
 MdeModulePkg/Library/DxeNetLib/DxeNetLib.c|  13 +-
 .../Universal/Network/Ip4Dxe/Ip4Common.h  |   2 +-
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c | 117 --
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h |   5 +-
 .../Universal/Network/Ip4Dxe/Ip4Impl.c|   2 +-
 .../Universal/Network/Ip4Dxe/Ip4Output.c  |  11 +-
 .../Universal/Network/Ip4Dxe/Ip4Route.c   |  21 +++-
 .../Universal/Network/Ip4Dxe/Ip4Route.h   |   5 +-
 .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c  |   6 +-
 .../UefiShellNetwork1CommandsLib/Ifconfig.c   |   1 +
 11 files changed, 155 insertions(+), 33 deletions(-)

-- 
2.18.0.windows.1

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


Re: [edk2] [PATCH v2 2/4] UefiCpuPkg/CpuExceptionHandlerLib: Setup single step in #PF handler

2018-08-27 Thread Dong, Eric
Reviewed-by: Eric Dong 

> -Original Message-
> From: Wang, Jian J
> Sent: Tuesday, August 21, 2018 11:05 AM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric ; Laszlo Ersek ; Ni,
> Ruiyu 
> Subject: [PATCH v2 2/4] UefiCpuPkg/CpuExceptionHandlerLib: Setup single
> step in #PF handler
> 
> > v2 changes:
> >n/a
> 
> Once the #PF handler has set the page to be 'present', there should be a way
> to reset it to 'not-present'. 'TF' bit in EFLAGS can be used for this 
> purpose. 'TF'
> bit will be set in interrupted function context so that it can be triggered 
> once
> the cpu control returns back to the instruction causing #PF and re-execute it.
> 
> This is an necessary step to implement non-stop mode for Heap Guard and
> NULL Pointer Detection feature.
> 
> Cc: Eric Dong 
> Cc: Laszlo Ersek 
> Cc: Ruiyu Ni 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jian J Wang 
> ---
>  .../Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.nasm   | 7
> +++
>  .../Library/CpuExceptionHandlerLib/Ia32/ExceptionTssEntryAsm.nasm  | 4 +--
> -
>  .../Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm| 4
> 
>  3 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.na
> sm
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.na
> sm
> index 45d6474091..6fcf5fb23f 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.na
> sm
> +++
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm
> +++ .nasm
> @@ -383,6 +383,13 @@ ErrorCodeAndVectorOnStack:
>  pop dword [ebp - 4]
>  mov esp, ebp
>  pop ebp
> +
> +; Enable TF bit after page fault handler runs
> +cmp dword [esp], 14   ; #PF?
> +jne .5
> +bts dword [esp + 16], 8   ; EFLAGS
> +
> +.5:
>  add esp, 8
>  cmp dword [esp - 16], 0   ; check
> EXCEPTION_HANDLER_CONTEXT.OldIdtHandler
>  jz  DoReturn
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionTssEntryAsm.n
> asm
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionTssEntryAsm.n
> asm
> index 62bcedea1a..7aac29c7e7 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionTssEntryAsm.n
> asm
> +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionTssEntryAs
> +++ m.nasm
> @@ -355,10 +355,8 @@ o16 mov [ecx + IA32_TSS._SS], ax
>  movzx  ebx, word [ecx + IA32_TSS._CS]
>  mov[eax - 0x8], ebx  ; create CS in old stack
>  movebx, dword [ecx + IA32_TSS.EFLAGS]
> -btsebx, 8
> +btsebx, 8; Set TF
>  mov[eax - 0x4], ebx  ; create eflags in old stack
> -movdword [ecx + IA32_TSS.EFLAGS], ebx; update eflags in old TSS
> -moveax, dword [ecx + IA32_TSS._ESP]  ; Get old stack pointer
>  subeax, 0xc  ; minus 12 byte
>  movdword [ecx + IA32_TSS._ESP], eax  ; Set new stack pointer
> 
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.na
> sm
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.na
> sm
> index 7b97810d10..f842af2336 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.na
> sm
> +++
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.
> +++ nasm
> @@ -336,6 +336,10 @@ HasErrorCode:
>  pop r15
> 
>  mov rsp, rbp
> +cmp qword [rbp + 8], 14 ; #PF?
> +jne .1
> +bts qword [rsp + 40], 8 ; RFLAGS.TF
> +.1:
>  pop rbp
>  add rsp, 16
>  cmp qword [rsp - 32], 0  ; check
> EXCEPTION_HANDLER_CONTEXT.OldIdtHandler
> --
> 2.16.2.windows.1

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


Re: [edk2] Can we use python 3 to build edk2?

2018-08-27 Thread heyi . guo
That's really good news; thank you all!

Heyi


On Mon, Aug 27, 2018 at 05:58:35PM +0200, Laszlo Ersek wrote:
> On 08/27/18 15:31, Zhu, Yonghong wrote:
> > We have a bugzilla. https://bugzilla.tianocore.org/show_bug.cgi?id=55 
> > Current I am working on it. And planned to finish to migrate to Python 3 
> > before end of October.
> 
> Thank you!
> Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] BaseTools: Add check only VOID* type Pcd need the maxsize info

2018-08-27 Thread Zhu, Yonghong
Reviewed-by: Yonghong Zhu  

Best Regards,
Zhu Yonghong

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Yonghong 
Zhu
Sent: Monday, August 27, 2018 10:03 AM
To: edk2-devel@lists.01.org
Cc: Fan, ZhijuX ; Gao, Liming 
Subject: [edk2] [PATCH] BaseTools: Add check only VOID* type Pcd need the 
maxsize info

From: zhijufan 

Add check for the datum type keyword "VOID*", only the VOID* type Pcd need the 
additional maxsize info.

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan 
---
 BaseTools/Source/Python/Common/Misc.py| 53 +++
 .../Source/Python/Workspace/DscBuildData.py   |  2 +-
 .../Source/Python/Workspace/MetaFileParser.py |  4 ++
 3 files changed, 23 insertions(+), 36 deletions(-)

diff --git a/BaseTools/Source/Python/Common/Misc.py 
b/BaseTools/Source/Python/Common/Misc.py
index 74a5f0bca5..5a63c83a2a 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -1432,9 +1432,9 @@ def ParseFieldValue (Value):
 ## AnalyzeDscPcd
 #
 #  Analyze DSC PCD value, since there is no data type info in DSC -#  This 
fuction is used to match functions (AnalyzePcdData) used for retrieving PCD 
value from database
+#  This function is used to match functions (AnalyzePcdData) used for 
+retrieving PCD value from database
 #  1. Feature flag: TokenSpace.PcdCName|PcdValue -#  2. Fix and 
Patch:TokenSpace.PcdCName|PcdValue[|MaxSize]
+#  2. Fix and Patch:TokenSpace.PcdCName|PcdValue[|VOID*[|MaxSize]]
 #  3. Dynamic default:
 # TokenSpace.PcdCName|PcdValue[|VOID*[|MaxSize]]
 # TokenSpace.PcdCName|PcdValue
@@ -1442,7 +1442,7 @@ def ParseFieldValue (Value):
 # TokenSpace.PcdCName|VpdOffset[|VpdValue]
 # TokenSpace.PcdCName|VpdOffset[|MaxSize[|VpdValue]]
 #  5. Dynamic HII:
-# TokenSpace.PcdCName|HiiString|VaiableGuid|VariableOffset[|HiiValue]
+# TokenSpace.PcdCName|HiiString|VariableGuid|VariableOffset[|HiiValue]
 #  PCD value needs to be located in such kind of string, and the PCD value 
might be an expression in which
 #there might have "|" operator, also in string value.
 #
@@ -1458,42 +1458,20 @@ def AnalyzeDscPcd(Setting, PcdType, DataType=''):
 FieldList = AnalyzePcdExpression(Setting)
 
 IsValid = True
-if PcdType in (MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_PATCHABLE_IN_MODULE, 
MODEL_PCD_FEATURE_FLAG):
+if PcdType in (MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_PATCHABLE_IN_MODULE, 
MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_EX_DEFAULT):
 Value = FieldList[0]
 Size = ''
-if len(FieldList) > 1:
-if FieldList[1].upper().startswith("0X") or FieldList[1].isdigit():
-Size = FieldList[1]
-else:
-DataType = FieldList[1]
-
-if len(FieldList) > 2:
-Size = FieldList[2]
-if DataType == "":
-IsValid = (len(FieldList) <= 1)
-else:
-IsValid = (len(FieldList) <= 3)
-# Value, Size = ParseFieldValue(Value)
-if Size:
-try:
-int(Size, 16) if Size.upper().startswith("0X") else int(Size)
-except:
+if len(FieldList) > 1 and FieldList[1]:
+DataType = FieldList[1]
+if FieldList[1] != TAB_VOID:
 IsValid = False
-Size = -1
-return [str(Value), '', str(Size)], IsValid, 0
-elif PcdType in (MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_EX_DEFAULT):
-Value = FieldList[0]
-Size = Type = ''
-if len(FieldList) > 1:
-Type = FieldList[1]
-else:
-Type = DataType
 if len(FieldList) > 2:
 Size = FieldList[2]
-if DataType == "":
-IsValid = (len(FieldList) <= 1)
-else:
-IsValid = (len(FieldList) <= 3)
+if IsValid:
+if DataType == "":
+IsValid = (len(FieldList) <= 1)
+else:
+IsValid = (len(FieldList) <= 3)
 
 if Size:
 try:
@@ -1501,7 +1479,12 @@ def AnalyzeDscPcd(Setting, PcdType, DataType=''):
 except:
 IsValid = False
 Size = -1
-return [Value, Type, str(Size)], IsValid, 0
+return [str(Value), DataType, str(Size)], IsValid, 0
+elif PcdType == MODEL_PCD_FEATURE_FLAG:
+Value = FieldList[0]
+Size = ''
+IsValid = (len(FieldList) <= 1)
+return [Value, DataType, str(Size)], IsValid, 0
 elif PcdType in (MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_VPD):
 VpdOffset = FieldList[0]
 Value = Size = ''
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index a4ad53ee15..748452623f 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -897,7 +897,7 @@ c

[edk2] [PATCH v1 1/1] BaseTools: AutoGen.py remove unused import

2018-08-27 Thread Jaben Carsey
AutoGen does not use anything defined in BuildClassObject

Cc: Yonghong Zhu 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index eb1b28388967..314a321e95c6 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -39,7 +39,6 @@ from Common.StringUtils import *
 import Common.GlobalData as GlobalData
 from GenFds.FdfParser import *
 from CommonDataClass.CommonClass import SkuInfoClass
-from Workspace.BuildClassObject import *
 from GenPatchPcdTable.GenPatchPcdTable import parsePcdInfoFromMapFile
 import Common.VpdInfoFile as VpdInfoFile
 from .GenPcdDb import CreatePcdDatabaseCode
-- 
2.16.2.windows.1

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


Re: [edk2] Can we use python 3 to build edk2?

2018-08-27 Thread Laszlo Ersek
On 08/27/18 15:31, Zhu, Yonghong wrote:
> We have a bugzilla. https://bugzilla.tianocore.org/show_bug.cgi?id=55 
> Current I am working on it. And planned to finish to migrate to Python 3 
> before end of October.

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


Re: [edk2] Can we use python 3 to build edk2?

2018-08-27 Thread Zhu, Yonghong
We have a bugzilla. https://bugzilla.tianocore.org/show_bug.cgi?id=55 
Current I am working on it. And planned to finish to migrate to Python 3 before 
end of October.

Best Regards,
Zhu Yonghong


-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo 
Ersek
Sent: Monday, August 27, 2018 9:27 PM
To: heyi@linaro.org
Cc: Kinney, Michael D ; edk2-devel@lists.01.org; 
Gary Ching-Pang Lin ; Gao, Liming 
Subject: Re: [edk2] Can we use python 3 to build edk2?

On 08/27/18 13:53, heyi@linaro.org wrote:
> It is said that python3 is not compatible with python2.

Did you mean s/said/sad/? :)

> Can we use python3 to build edk2?

Gary and Mike wrote several BaseTools patches for python3 compatibility; I'm 
unsure if we have a high-level tracker BZ for that. I don't know the current 
status. Adding Mike and Gary.

Thanks
Laszlo
___
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] Can we use python 3 to build edk2?

2018-08-27 Thread Laszlo Ersek
On 08/27/18 13:53, heyi@linaro.org wrote:
> It is said that python3 is not compatible with python2.

Did you mean s/said/sad/? :)

> Can we use python3 to build edk2?

Gary and Mike wrote several BaseTools patches for python3 compatibility;
I'm unsure if we have a high-level tracker BZ for that. I don't know the
current status. Adding Mike and Gary.

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


Re: [edk2] Can we use python 3 to build edk2?

2018-08-27 Thread Zhu, Yonghong
We are in migrating BaseTools to Python3.

Best Regards,
Zhu Yonghong

-Original Message-
From: heyi@linaro.org [mailto:heyi@linaro.org] 
Sent: Monday, August 27, 2018 7:53 PM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong ; Gao, Liming 
Subject: Can we use python 3 to build edk2?

It is said that python3 is not compatible with python2. Can we use python3 to 
build edk2?

Thanks,

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


[edk2] Can we use python 3 to build edk2?

2018-08-27 Thread heyi . guo
It is said that python3 is not compatible with python2. Can we use python3 to
build edk2?

Thanks,

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


[edk2] [PATCH v2 2/2] ArmPkg/OpteeLib: Add APIs to communicate with OP-TEE

2018-08-27 Thread Sumit Garg
Add following APIs to communicate with OP-TEE pseudo/early TAs:
1. OpteeInit
2. OpteeOpenSession
3. OpteeCloseSession
4. OpteeInvokeFunc

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sumit Garg 
---
 ArmPkg/Include/Library/OpteeLib.h|  87 +
 ArmPkg/Library/OpteeLib/Optee.c  | 358 +++
 ArmPkg/Library/OpteeLib/OpteeLib.inf |   2 +
 ArmPkg/Library/OpteeLib/OpteeSmc.h   |  43 +
 4 files changed, 490 insertions(+)
 create mode 100644 ArmPkg/Library/OpteeLib/OpteeSmc.h

diff --git a/ArmPkg/Include/Library/OpteeLib.h 
b/ArmPkg/Include/Library/OpteeLib.h
index f65d8674d9b8..89d6b5a7b34f 100644
--- a/ArmPkg/Include/Library/OpteeLib.h
+++ b/ArmPkg/Include/Library/OpteeLib.h
@@ -25,10 +25,97 @@
 #define OPTEE_OS_UID2  0xaf630002
 #define OPTEE_OS_UID3  0xa5d5c51b
 
+#define OPTEE_MSG_ATTR_TYPE_NONE0x0
+#define OPTEE_MSG_ATTR_TYPE_VALUE_INPUT 0x1
+#define OPTEE_MSG_ATTR_TYPE_VALUE_OUTPUT0x2
+#define OPTEE_MSG_ATTR_TYPE_VALUE_INOUT 0x3
+#define OPTEE_MSG_ATTR_TYPE_MEM_INPUT   0x9
+#define OPTEE_MSG_ATTR_TYPE_MEM_OUTPUT  0xa
+#define OPTEE_MSG_ATTR_TYPE_MEM_INOUT   0xb
+
+#define OPTEE_MSG_ATTR_TYPE_MASK0xff
+
+typedef struct {
+  UINT64BufPtr;
+  UINT64Size;
+  UINT64ShmRef;
+} OPTEE_MSG_PARAM_MEM;
+
+typedef struct {
+  UINT64A;
+  UINT64B;
+  UINT64C;
+} OPTEE_MSG_PARAM_VALUE;
+
+typedef struct {
+  UINT64 Attr;
+  union {
+OPTEE_MSG_PARAM_MEM  Mem;
+OPTEE_MSG_PARAM_VALUEValue;
+  } U;
+} OPTEE_MSG_PARAM;
+
+#define MAX_PARAMS   4
+
+typedef struct {
+UINT32 Cmd;
+UINT32 Func;
+UINT32 Session;
+UINT32 CancelId;
+UINT32 Pad;
+UINT32 Ret;
+UINT32 RetOrigin;
+UINT32 NumParams;
+
+// NumParams tells the actual number of element in Params
+OPTEE_MSG_PARAMParams[MAX_PARAMS];
+} OPTEE_MSG_ARG;
+
+#define OPTEE_UUID_LEN   16
+
+typedef struct {
+UINT8 Uuid[OPTEE_UUID_LEN]; // [in] UUID of the Trusted Application
+UINT32Session;  // [out] Session id
+UINT32Ret;  // [out] Return value
+UINT32RetOrigin;// [out] Origin of the return value
+} OPTEE_OPEN_SESSION_ARG;
+
+typedef struct {
+UINT32 Func;// [in] Trusted App func, specific to the 
TA
+UINT32 Session; // [in] Session id
+UINT32 Ret; // [out] Return value
+UINT32 RetOrigin; // [out] Origin of the return value
+OPTEE_MSG_PARAMParams[MAX_PARAMS]; // Params for func to be invoked
+} OPTEE_INVOKE_FUNC_ARG;
+
 BOOLEAN
 EFIAPI
 IsOpteePresent (
   VOID
   );
 
+EFI_STATUS
+EFIAPI
+OpteeInit (
+  VOID
+  );
+
+EFI_STATUS
+EFIAPI
+OpteeOpenSession (
+  IN OUT OPTEE_OPEN_SESSION_ARG  *OpenSessionArg
+  );
+
+EFI_STATUS
+EFIAPI
+OpteeCloseSession (
+  IN UINT32  Session
+  );
+
+EFI_STATUS
+EFIAPI
+OpteeInvokeFunc (
+  IN OUT OPTEE_INVOKE_FUNC_ARG   *InvokeFuncArg
+  );
+
 #endif
diff --git a/ArmPkg/Library/OpteeLib/Optee.c b/ArmPkg/Library/OpteeLib/Optee.c
index 574527f8b5ea..2111022d3662 100644
--- a/ArmPkg/Library/OpteeLib/Optee.c
+++ b/ArmPkg/Library/OpteeLib/Optee.c
@@ -14,11 +14,19 @@
 
 **/
 
+#include 
 #include 
+#include 
 #include 
+#include 
 #include 
 
 #include 
+#include 
+#include 
+#include 
+
+STATIC OPTEE_SHARED_MEMORY_INFO OpteeShmInfo = { 0 };
 
 /**
   Check for OP-TEE presence.
@@ -31,6 +39,7 @@ IsOpteePresent (
 {
   ARM_SMC_ARGS ArmSmcArgs;
 
+  ZeroMem (&ArmSmcArgs, sizeof (ARM_SMC_ARGS));
   // Send a Trusted OS Calls UID command
   ArmSmcArgs.Arg0 = ARM_SMC_ID_TOS_UID;
   ArmCallSmc (&ArmSmcArgs);
@@ -44,3 +53,352 @@ IsOpteePresent (
 return FALSE;
   }
 }
+
+STATIC
+EFI_STATUS
+OpteeShmMemRemap (
+  VOID
+  )
+{
+  ARM_SMC_ARGS ArmSmcArgs;
+  EFI_PHYSICAL_ADDRESS Paddr;
+  EFI_PHYSICAL_ADDRESS Start;
+  EFI_PHYSICAL_ADDRESS End;
+  EFI_STATUS   Status;
+  UINTNSize;
+
+  ZeroMem (&ArmSmcArgs, sizeof (ARM_SMC_ARGS));
+  ArmSmcArgs.Arg0 = OPTEE_SMC_GET_SHM_CONFIG;
+
+  ArmCallSmc (&ArmSmcArgs);
+  if (ArmSmcArgs.Arg0 != OPTEE_SMC_RETURN_OK) {
+DEBUG ((DEBUG_WARN, "OP-TEE shared memory not supported\n"));
+return EFI_UNSUPPORTED;
+  }
+
+  if (ArmSmcArgs.Arg3 != OPTEE_SMC_SHM_CACHED) {
+DEBUG ((DEBUG_WARN, "OP-TEE: Only normal cached shared memory 
supported\n"));
+return EFI_UNSUPPORTED;
+  }
+
+  Start = (ArmSmcArgs.Arg1 + SIZE_4KB - 1) & ~(SIZE_4KB - 1);
+  End = (ArmSmcArgs.Arg1 + ArmSmcArgs.Arg2) & ~(SIZE_4KB - 1);
+  Paddr = Start;
+  Size = End - Start;
+
+  if (Size < SIZE_4KB) {
+DEBUG ((DEBUG_WA

[edk2] [PATCH v2 1/2] MdePkg/IndustryStandard: Add Global Plaform header file

2018-08-27 Thread Sumit Garg
Add Global Plaform header file specific to TEE Client API Specification v1
.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sumit Garg 
---
 MdePkg/Include/IndustryStandard/GlobalPlatform.h | 27 
 1 file changed, 27 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/GlobalPlatform.h

diff --git a/MdePkg/Include/IndustryStandard/GlobalPlatform.h 
b/MdePkg/Include/IndustryStandard/GlobalPlatform.h
new file mode 100644
index ..72c5af4ef588
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/GlobalPlatform.h
@@ -0,0 +1,27 @@
+/** @file
+  Standardized Global Platform header file. GlobalPlatform TEE Client API
+  Specification v1.0: 
+
+  Copyright (c) 2018, Linaro Ltd. 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.
+
+**/
+
+#ifndef _GLOBAL_PLATFORM_H_
+#define _GLOBAL_PLATFORM_H_
+
+#define TEEC_ORIGIN_COMMS   0x0002
+
+#define TEEC_SUCCESS0x
+#define TEEC_ERROR_BAD_PARAMETERS   0x0006
+#define TEEC_ERROR_OUT_OF_MEMORY0x000C
+#define TEEC_ERROR_COMMUNICATION0x000E
+
+#endif
-- 
2.7.4

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


[edk2] [PATCH v2 0/2] Add ArmPkg/Optee library APIs

2018-08-27 Thread Sumit Garg
Changes in v2:
1. Separate patch for MdePkg/Include/IndustryStandard/GlobalPlatform.h.
2. Correct comments style for struct members.
3. Update commit message.

Sumit Garg (2):
  MdePkg/IndustryStandard: Add Global Plaform header file
  ArmPkg/OpteeLib: Add APIs to communicate with OP-TEE

 ArmPkg/Include/Library/OpteeLib.h|  87 ++
 ArmPkg/Library/OpteeLib/Optee.c  | 358 +++
 ArmPkg/Library/OpteeLib/OpteeLib.inf |   2 +
 ArmPkg/Library/OpteeLib/OpteeSmc.h   |  43 +++
 MdePkg/Include/IndustryStandard/GlobalPlatform.h |  27 ++
 5 files changed, 517 insertions(+)
 create mode 100644 ArmPkg/Library/OpteeLib/OpteeSmc.h
 create mode 100644 MdePkg/Include/IndustryStandard/GlobalPlatform.h

-- 
2.7.4

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


Re: [edk2] [PATCH 1/1] ArmPkg/OpteeLib: Add APIs to communicate with OP-TEE

2018-08-27 Thread Sumit Garg
On Fri, 24 Aug 2018 at 23:33, Matteo Carlini  wrote:
>
> +Achin
>
> SPD (for OP-TEE and other Trusted-OSes payloads running at S-EL1) and SPM 
> (for Secure Partitions at S-EL0) are currently mutually exclusive into 
> Trusted Firmware-A codebase.
>
> In other words, you cannot turn them on in parallel and execute both a S-EL1 
> Trusted OS AND (one or many) S-EL0 Secure Partitions in the Secure World with 
> the current Software Architecture.
>

IIUC, currently BL32 image is common in Trusted Firmware-A code-base.
If we turn on SPD then BL32= else if we turn on SPM
then BL32=, correct?

But I think SMC calling conventions (SMC Calling Convention [1] and
Management Mode Interface Specification [2]) doesn't put any such
restrictions as SMC function IDs are totally separate.

> Achin and other Arm architects are trying to figure out a way for solving 
> this problem without the need for a v8.4 Secure-EL2 Hypervisor, obviously 
> without leveraging the isolation benefits of it (see also [1]).
>

Agree we won't be having isolation benefits which provides added level
of Security.

> But Ard is right: there could be use-cases to ship UEFI systems with OP-TEE 
> and TAs on top...and this should still be currently possible using the SPD 
> dispatcher into TF-A. I've not looked deeply into this patch, but it doesn’t 
> seem to contradict the above Sw architecture.
>
> The question would be: would you foresee the need for running one (or many) 
> other (UEFI/EDK2-based) Secure Services in the Secure World into a Secure 
> Partition (using the StandaloneMmPkg) *together* with OP-TEE?
>

As per following quote from Management Mode Interface Specification [2]:

"Management Mode (MM) provides an environment for implementing OS
agnostic services (MM services) like RAS error handling, secure
variable storage, and firmware updates in system firmware. The
services can be invoked synchronously and asynchronously."

It seems that MM mode is designed for more robust and platform
specific services whereas OP-TEE (or any trusted OS) use-cases seem to
be more complex like Entropy pool (RNG as in our case), DRM (could be
valid use-case for Android TV or Chromebook), keymaster or keystore
(for Edge devices) etc.

So it looks like they complement each other and we will have more
robustness once we migrate to v8.4 Secure-EL2 Hypervisor for isolation
support.

Please feel free to correct me if I missed something.

Regards,
Sumit

[1] 
http://infocenter.arm.com/help/topic/com.arm.doc.den0028b/ARM_DEN0028B_SMC_Calling_Convention.pdf
[2] 
http://infocenter.arm.com/help/topic/com.arm.doc.den0060a/DEN0060A_ARM_MM_Interface_Specification.pdf

> Thanks
> Matteo
>
> [1]: 
> https://community.arm.com/processors/b/blog/posts/architecting-more-secure-world-with-isolation-and-virtualization
>
> > -Original Message-
> > From: Udit Kumar 
> > Sent: 24 August 2018 18:46
> > To: Ard Biesheuvel ; Matteo Carlini
> > 
> > Cc: Sumit Garg ; edk2-devel@lists.01.org; tee-
> > d...@lists.linaro.org; daniel.thomp...@linaro.org; 
> > jens.wiklan...@linaro.org;
> > Rod Dorris 
> > Subject: RE: [edk2] [PATCH 1/1] ArmPkg/OpteeLib: Add APIs to communicate
> > with OP-TEE
> >
> > Hi Ard
> >
> > > If MM mode is fundamentally incompatible with OP-TEE, then you cannot
> > > run both at the same time,
> >
> > Both cannot coexist unless you have v8.4 CPU
> >
> > Regards
> > Udit
> >
> > >
> > >
> > > >> -Original Message-
> > > >> From: edk2-devel  On Behalf Of
> > > >> Sumit Garg
> > > >> Sent: Friday, August 24, 2018 2:51 PM
> > > >> To: edk2-devel@lists.01.org
> > > >> Cc: daniel.thomp...@linaro.org; tee-...@lists.linaro.org;
> > > >> jens.wiklan...@linaro.org
> > > >> Subject: [edk2] [PATCH 1/1] ArmPkg/OpteeLib: Add APIs to
> > > >> communicate with OP-TEE
> > > >>
> > > >> Add following APIs to communicate with OP-TEE static TA:
> > > >> 1. OpteeInit
> > > >> 2. OpteeOpenSession
> > > >> 3. OpteeCloseSession
> > > >> 4. OpteeInvokeFunc
> > > >>
> > > >> Cc: Ard Biesheuvel 
> > > >> Cc: Leif Lindholm 
> > > >> Contributed-under: TianoCore Contribution Agreement 1.1
> > > >> Signed-off-by: Sumit Garg 
> > > >> ---
> > > >>  ArmPkg/Include/Library/OpteeLib.h  | 102 ++
> > > >>  ArmPkg/Library/OpteeLib/Optee.c| 358
> > > >> +
> > > >>  ArmPkg/Library/OpteeLib/OpteeLib.inf   |   2 +
> > > >>  ArmPkg/Library/OpteeLib/OpteeSmc.h |  43 +++
> > > >>  .../Include/IndustryStandard/GlobalPlatform.h  |  60 ++--
> > > >>  5 files changed, 531 insertions(+), 34 deletions(-)  create mode
> > > >> 100644 ArmPkg/Library/OpteeLib/OpteeSmc.h
> > > >>  copy ArmPkg/Include/Library/OpteeLib.h =>
> > > >> MdePkg/Include/IndustryStandard/GlobalPlatform.h (53%)
> > > >>
> > > >> diff --git a/ArmPkg/Include/Library/OpteeLib.h
> > > >> b/ArmPkg/Include/Library/OpteeLib.h
> > > >> index f65d8674d9b8..c323f49072f8 100644
> > > >> --- a/ArmPkg/Include/Library/OpteeLib.h
> > > >> +++ b/ArmP

[edk2] [PATCH 04/10] EmulatorPkg/Win: ReadKeyStrokeEx() always returns correct KeyState

2018-08-27 Thread Ruiyu Ni
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1118

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Hao Wu 
Cc: Andrew Fish 
---
 EmulatorPkg/Win/Host/WinGopInput.c | 17 +
 1 file changed, 17 insertions(+)

diff --git a/EmulatorPkg/Win/Host/WinGopInput.c 
b/EmulatorPkg/Win/Host/WinGopInput.c
index 6c218ab98a..17d35bb52c 100644
--- a/EmulatorPkg/Win/Host/WinGopInput.c
+++ b/EmulatorPkg/Win/Host/WinGopInput.c
@@ -363,6 +363,23 @@ WinNtWndKeySetState (
   GRAPHICS_PRIVATE_DATA   *Private;
 
   Private = GRAPHICS_PRIVATE_DATA_FROM_THIS (GraphicsIo);
+  Private->ScrollLock = FALSE;
+  Private->NumLock = FALSE;
+  Private->CapsLock = FALSE;
+  Private->IsPartialKeySupport = FALSE;
+
+  if ((*KeyToggleState & EFI_SCROLL_LOCK_ACTIVE) == EFI_SCROLL_LOCK_ACTIVE) {
+Private->ScrollLock = TRUE;
+  }
+  if ((*KeyToggleState & EFI_NUM_LOCK_ACTIVE) == EFI_NUM_LOCK_ACTIVE) {
+Private->NumLock = TRUE;
+  }
+  if ((*KeyToggleState & EFI_CAPS_LOCK_ACTIVE) == EFI_CAPS_LOCK_ACTIVE) {
+Private->CapsLock = TRUE;
+  }
+  if ((*KeyToggleState & EFI_KEY_STATE_EXPOSED) == EFI_KEY_STATE_EXPOSED) {
+Private->IsPartialKeySupport = TRUE;
+  }
   Private->KeyState.KeyToggleState = *KeyToggleState;
   return EFI_SUCCESS;
 }
-- 
2.16.1.windows.1

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


[edk2] [PATCH 05/10] EmulatorPkg/Win: Do not zero out file content

2018-08-27 Thread Ruiyu Ni
The patch changes the behavior to not zero out file content
when the file size is not multiple of block size.
Instead, it just provides access to the contents that are
multiple of block size and leaves the remaining content (less than
block size) untouched.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Hao Wu 
Cc: Andrew Fish 
---
 EmulatorPkg/Win/Host/WinBlockIo.c | 28 +---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/EmulatorPkg/Win/Host/WinBlockIo.c 
b/EmulatorPkg/Win/Host/WinBlockIo.c
index 14491a6e90..7df7d42c7c 100644
--- a/EmulatorPkg/Win/Host/WinBlockIo.c
+++ b/EmulatorPkg/Win/Host/WinBlockIo.c
@@ -90,6 +90,7 @@ WinNtBlockIoOpenDevice (
 {
   EFI_STATUSStatus;
   UINT64FileSize;
+  UINT64EndOfFile;
 
   //
   // If the device is already opened, close it
@@ -112,7 +113,7 @@ WinNtBlockIoOpenDevice (
   );
 
   if (Private->NtHandle == INVALID_HANDLE_VALUE) {
-DEBUG ((EFI_D_INFO, "OpenBlock: Could not open %S, %x\n", 
Private->FileName, GetLastError ()));
+DEBUG ((EFI_D_INFO, "PlOpenBlock: Could not open %S, %x\n", 
Private->FileName, GetLastError ()));
 Media->MediaPresent = FALSE;
 Status = EFI_NO_MEDIA;
 goto Done;
@@ -124,14 +125,35 @@ WinNtBlockIoOpenDevice (
   Status = SetFilePointer64 (Private, 0, &FileSize, FILE_END);
 
   if (EFI_ERROR (Status)) {
-DEBUG ((EFI_D_ERROR, "OpenBlock: Could not get filesize of %s\n", 
Private->FileName));
+DEBUG ((EFI_D_ERROR, "PlOpenBlock: Could not get filesize of %s\n", 
Private->FileName));
 Status = EFI_UNSUPPORTED;
 goto Done;
   }
 
   Media->LastBlock = DivU64x32 (FileSize, (UINT32)Private->BlockSize) - 1;
 
-  DEBUG ((EFI_D_INIT, "OpenBlock: opened %S\n", Private->FileName));
+  EndOfFile = MultU64x32 (Media->LastBlock + 1, (UINT32)Private->BlockSize);
+
+  if (FileSize != EndOfFile) {
+//
+// file is not the proper size, change it
+//
+DEBUG ((EFI_D_INIT, "PlOpenBlock: Initializing block device: %hs\n", 
Private->FileName));
+
+//
+// first set it to 0
+//
+SetFilePointer64 (Private, 0, NULL, FILE_BEGIN);
+SetEndOfFile (Private->NtHandle);
+
+//
+// then set it to the needed file size (OS will zero fill it)
+//
+SetFilePointer64 (Private, EndOfFile, NULL, FILE_BEGIN);
+SetEndOfFile (Private->NtHandle);
+  }
+
+  DEBUG ((EFI_D_INIT, "PlOpenBlock: opened %S\n", Private->FileName));
   Status = EFI_SUCCESS;
 
 Done:
-- 
2.16.1.windows.1

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


[edk2] [PATCH 10/10] EmulatorPkg: IoThunk->Close() is called too early, may causing hang

2018-08-27 Thread Ruiyu Ni
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1121

To produce a EFI_BLOCK_IO_PROTOCOL instance in Emulator platform,
EmulatorPkg defines the EMU_IO_THUNK_PROTOCOL. OS dependent layer
needs to produce this protocol implementation and a generic OS
independent layer consumes this protocol to produce
EFI_BLOCK_IO_PROTOCOL.

EMU_IO_THUNK_PROTOCOL can also be used to abstract the OS dependent
IO operation for other UEFI protocols, e.g.: GOP, SimpleFileSystem
and etc.

It contains two interfaces Open() and Close(). Open() creates the
specific IO instances, e.g. for Block IO access, File System access,
Screen access, etc. Close() destroys the specific IO instances.

Later on the Emulator generic module (e.g.: EmuBlockIoDxe) calls
Open() to create the IO instance in DriverBindingStart() and calls
Close() in DriverBindingStop().
But today's implementation of DriverBindingStop() contains a bug
that it calls Close() before uninstalling the EFI_BLOCK_IO_PROTOCOL.

It's a mistake in code. Take EFI_BLOCK_IO for example,
the uninstallation may cause the upper layer driver that consumes
EFI_BLOCK_IO call BlockIo.Reset(), which consequently calls
EmuBlockIo.Reset(). But the EmuBlockIo instance is already destroyed
by Close() that happens before uninstallation.

So a proper implementation is to call Close() after uninstallation
succeeds.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1121

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Andrew Fish 
Cc: Hao Wu 
---
 EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.c | 14 ++
 .../EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c   | 10 ---
 EmulatorPkg/EmuSnpDxe/EmuSnpDxe.c  | 32 --
 3 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.c 
b/EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.c
index e77de2c7bc..3f62b9fabb 100644
--- a/EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.c
+++ b/EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.c
@@ -1,6 +1,6 @@
 /**@file
 
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2018, 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
@@ -662,7 +662,6 @@ EmuBlockIoDriverBindingStop (
   }
 
   Private = EMU_BLOCK_IO_PRIVATE_DATA_FROM_THIS (BlockIo);
-  Status = Private->IoThunk->Close (Private->IoThunk);
 
   Status = gBS->UninstallMultipleProtocolInterfaces (
   Private->EfiHandle,
@@ -677,14 +676,17 @@ EmuBlockIoDriverBindingStop (
 This->DriverBindingHandle,
 Handle
 );
-  }
-
-  if (!EFI_ERROR (Status)) {
+ASSERT_EFI_ERROR (Status);
+//
+// Destroy the IO interface.
+//
+Status = Private->IoThunk->Close (Private->IoThunk);
+ASSERT_EFI_ERROR (Status);
 //
 // Free our instance data
 //
 FreeUnicodeStringTable (Private->ControllerNameTable);
-gBS->FreePool (Private);
+FreePool (Private);
   }
 
   return Status;
diff --git a/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c 
b/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c
index b5e19bb840..28abfd6bef 100644
--- a/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c
+++ b/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c
@@ -866,7 +866,6 @@ EmuSimpleFileSystemDriverBindingStop (
   }
 
   Private = EMU_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (SimpleFileSystem);
-  Status = Private->IoThunk->Close (Private->IoThunk);
 
   //
   // Uninstall the Simple File System Protocol from ControllerHandle
@@ -883,9 +882,12 @@ EmuSimpleFileSystemDriverBindingStop (
 This->DriverBindingHandle,
 ControllerHandle
 );
-  }
-
-  if (!EFI_ERROR (Status)) {
+ASSERT_EFI_ERROR (Status);
+//
+// Destroy the IO interface.
+//
+Status = Private->IoThunk->Close (Private->IoThunk);
+ASSERT_EFI_ERROR (Status);
 //
 // Free our instance data
 //
diff --git a/EmulatorPkg/EmuSnpDxe/EmuSnpDxe.c 
b/EmulatorPkg/EmuSnpDxe/EmuSnpDxe.c
index 09d16fd8b6..eee9b60437 100644
--- a/EmulatorPkg/EmuSnpDxe/EmuSnpDxe.c
+++ b/EmulatorPkg/EmuSnpDxe/EmuSnpDxe.c
@@ -870,6 +870,7 @@ EmuSnpDriverBindingStop (
   EFI_STATUS  Status;
   EMU_SNP_PRIVATE_DATA*Private = NULL;
   EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
+  VOID*EmuIoThunk;
 
   //
   // Complete all outstanding transactions to Controller.
@@ -914,27 +915,42 @@ EmuSnpDriverBindingStop (
   }
 
   Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (Snp);
-  Status = Private->IoThunk->Close (Private->IoThunk);
+  ASSERT (Private->DeviceHandle == ChildHandleBuffer[0]);
+  ASSERT (Private->EfiHandle== ControllerHandle);
 
   Status = gBS->CloseProtocol(
-

[edk2] [PATCH 08/10] EmulatorPkg/Win: Add VS2017 project file

2018-08-27 Thread Ruiyu Ni
Developer can build the Win Host in VS2017 and launch to debug it.
Platform 'x64' is to build 64bit EmulatorWin.
Platform 'Win32' is to build 32bit EmulatorWin.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Hao Wu 
Cc: Andrew Fish 
---
 EmulatorPkg/Win/VS2017/BuildVS.bat |   3 +
 EmulatorPkg/Win/VS2017/Win.sln |  31 
 EmulatorPkg/Win/VS2017/Win.vcxproj | 120 +
 EmulatorPkg/Win/VS2017/Win.vcxproj.filters |  50 
 EmulatorPkg/Win/VS2017/Win.vcxproj.user|  13 
 5 files changed, 217 insertions(+)
 create mode 100644 EmulatorPkg/Win/VS2017/BuildVS.bat
 create mode 100644 EmulatorPkg/Win/VS2017/Win.sln
 create mode 100644 EmulatorPkg/Win/VS2017/Win.vcxproj
 create mode 100644 EmulatorPkg/Win/VS2017/Win.vcxproj.filters
 create mode 100644 EmulatorPkg/Win/VS2017/Win.vcxproj.user

diff --git a/EmulatorPkg/Win/VS2017/BuildVS.bat 
b/EmulatorPkg/Win/VS2017/BuildVS.bat
new file mode 100644
index 00..a485a3c563
--- /dev/null
+++ b/EmulatorPkg/Win/VS2017/BuildVS.bat
@@ -0,0 +1,3 @@
+cd ../../../
+@call edksetup.bat 
+build -p EmulatorPkg\EmulatorPkg.dsc -t VS2017 -D WIN_SEC_BUILD %*
diff --git a/EmulatorPkg/Win/VS2017/Win.sln b/EmulatorPkg/Win/VS2017/Win.sln
new file mode 100644
index 00..650b404463
--- /dev/null
+++ b/EmulatorPkg/Win/VS2017/Win.sln
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.28010.2003
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Win", "Win.vcxproj", 
"{B4E1783F-FD72-4214-B0F7-69271BAD5DDF}"
+EndProject
+Global
+   GlobalSection(SolutionConfigurationPlatforms) = preSolution
+   Debug|x64 = Debug|x64
+   Debug|Win32 = Debug|Win32
+   Release|x64 = Release|x64
+   Release|Win32 = Release|Win32
+   EndGlobalSection
+   GlobalSection(ProjectConfigurationPlatforms) = postSolution
+   {B4E1783F-FD72-4214-B0F7-69271BAD5DDF}.Debug|x64.ActiveCfg = 
Debug|x64
+   {B4E1783F-FD72-4214-B0F7-69271BAD5DDF}.Debug|x64.Build.0 = 
Debug|x64
+   {B4E1783F-FD72-4214-B0F7-69271BAD5DDF}.Debug|Win32.ActiveCfg = 
Debug|Win32
+   {B4E1783F-FD72-4214-B0F7-69271BAD5DDF}.Debug|Win32.Build.0 = 
Debug|Win32
+   {B4E1783F-FD72-4214-B0F7-69271BAD5DDF}.Release|x64.ActiveCfg = 
Release|x64
+   {B4E1783F-FD72-4214-B0F7-69271BAD5DDF}.Release|x64.Build.0 = 
Release|x64
+   {B4E1783F-FD72-4214-B0F7-69271BAD5DDF}.Release|Win32.ActiveCfg 
= Release|Win32
+   {B4E1783F-FD72-4214-B0F7-69271BAD5DDF}.Release|Win32.Build.0 = 
Release|Win32
+   EndGlobalSection
+   GlobalSection(SolutionProperties) = preSolution
+   HideSolutionNode = FALSE
+   EndGlobalSection
+   GlobalSection(ExtensibilityGlobals) = postSolution
+   SolutionGuid = {870972CA-19D5-4FC0-BF7A-E4C7A46679F0}
+   EndGlobalSection
+EndGlobal
diff --git a/EmulatorPkg/Win/VS2017/Win.vcxproj 
b/EmulatorPkg/Win/VS2017/Win.vcxproj
new file mode 100644
index 00..0f574a8e7f
--- /dev/null
+++ b/EmulatorPkg/Win/VS2017/Win.vcxproj
@@ -0,0 +1,120 @@
+
+http://schemas.microsoft.com/developer/msbuild/2003";>
+  
+
+  Debug
+  Win32
+
+
+  Release
+  Win32
+
+
+  Debug
+  x64
+
+
+  Release
+  x64
+
+  
+  
+15.0
+{B4E1783F-FD72-4214-B0F7-69271BAD5DDF}
+MakeFileProj
+8.1
+  
+  
+  
+Makefile
+true
+v141
+  
+  
+Makefile
+false
+v141
+  
+  
+Makefile
+true
+v141
+  
+  
+Makefile
+true
+v141
+  
+  
+  
+  
+  
+  
+  
+
+  
+  
+
+  
+  
+
+  
+  
+
+  
+  
+  
+BuildVS.bat -a IA32
+BuildVS.bat -a IA32 all
+BuildVS.bat -a IA32 clean
+..\..\..\Build\EmulatorIA32\DEBUG_VS2017\
+..\..\..\Build\EmulatorIA32\DEBUG_VS2017\
+
..\..\..\MdePkg\Include;..\..\..\MdePkg\Include\Ia32;..\..\..\MdeModulePkg\Include;..\..\..\EmulatorPkg\Include;$(IncludePath)
+  
+  
+BuildVS.bat -a IA32 -b 
RELEASE
+
+
+BuildVS.bat -a IA32 -b RELEASE 
all
+BuildVS.bat -a IA32 -b RELEASE 
clean
+..\..\..\Build\EmulatorIA32\DEBUG_VS2017\
+..\..\..\Build\EmulatorIA32\DEBUG_VS2017\
+
..\..\..\MdePkg\Include;..\..\..\MdePkg\Include\Ia32;..\..\..\MdeModulePkg\Include;..\..\..\EmulatorPkg\Include;$(IncludePath)
+  
+  
+BuildVS.bat -a X64
+BuildVS.bat -a X64 all
+BuildVS.bat -a X64 clean
+..\..\..\Build\EmulatorX64\DEBUG_VS2017\
+..\..\..\Build\EmulatorX64\DEBUG_VS2017\
+
..\..\..\MdePkg\Include;..\..\..\MdePkg\Include\X64;..\..\..\MdeModulePkg\Include;..\..\..\EmulatorPkg\Include;$(IncludePath)
+  
+  
+BuildVS.bat -a X64 -b 
RELEASE
+BuildVS.bat -a X64 -b RELEASE 
all
+BuildVS.bat -a X64 -b RELEASE 
clean
+..\..\Build\Emulat

[edk2] [PATCH 01/10] EmulatorPkg/EmuGopDxe: Fix TxtInEx.SetState SCT conformance failure

2018-08-27 Thread Ruiyu Ni
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1118

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Hao Wu 
Cc: Andrew Fish 
---
 EmulatorPkg/EmuGopDxe/GopInput.c | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/EmulatorPkg/EmuGopDxe/GopInput.c b/EmulatorPkg/EmuGopDxe/GopInput.c
index cf37a7bd70..8ac1b996d8 100644
--- a/EmulatorPkg/EmuGopDxe/GopInput.c
+++ b/EmulatorPkg/EmuGopDxe/GopInput.c
@@ -1,6 +1,6 @@
 /*++ @file
 
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
 Portions copyright (c) 2010 0 2011,Apple Inc. All rights reserved.
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
@@ -442,11 +442,20 @@ EmuGopSimpleTextInExSetState (
   EFI_STATUSStatus;
   EFI_TPL   OldTpl;
 
+  if (KeyToggleState == NULL) {
+return EFI_INVALID_PARAMETER;
+  }
+
   Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);
   if (Private->EmuGraphicsWindow == NULL) {
 return EFI_NOT_READY;
   }
 
+  if (((Private->KeyState.KeyToggleState & EFI_TOGGLE_STATE_VALID) != 
EFI_TOGGLE_STATE_VALID) ||
+  ((*KeyToggleState & EFI_TOGGLE_STATE_VALID) != EFI_TOGGLE_STATE_VALID)) {
+return EFI_UNSUPPORTED;
+  }
+
   //
   // Enter critical section
   //
-- 
2.16.1.windows.1

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


[edk2] [PATCH 06/10] EmulatorPkg/Win: Enable 64bit (SEC, PEI, DXE all run at 64bit)

2018-08-27 Thread Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Hao Wu 
Cc: Andrew Fish 
---
 EmulatorPkg/EmulatorPkg.dsc   | 6 +-
 EmulatorPkg/Win/Host/WinBlockIo.c | 2 +-
 EmulatorPkg/Win/Host/WinHost.c| 2 +-
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index ee85c9ef64..72e8aa1788 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -22,11 +22,7 @@ [Defines]
   PLATFORM_GUID  = 05FD064D-1073-E844-936C-A0E16317107D
   PLATFORM_VERSION   = 0.3
   DSC_SPECIFICATION  = 0x00010005
-!if $(BUILD_32)
-  OUTPUT_DIRECTORY   = Build/Emulator32
-!else
-  OUTPUT_DIRECTORY   = Build/Emulator
-!endif
+  OUTPUT_DIRECTORY   = Build/Emulator$(ARCH)
 
   SUPPORTED_ARCHITECTURES= X64|IA32
   BUILD_TARGETS  = DEBUG|RELEASE
diff --git a/EmulatorPkg/Win/Host/WinBlockIo.c 
b/EmulatorPkg/Win/Host/WinBlockIo.c
index 7df7d42c7c..33c1ce21b0 100644
--- a/EmulatorPkg/Win/Host/WinBlockIo.c
+++ b/EmulatorPkg/Win/Host/WinBlockIo.c
@@ -24,7 +24,7 @@ typedef struct {
   BOOLEAN Readonly;
 
   HANDLE  NtHandle;
-  UINTN   BlockSize;
+  UINT32  BlockSize;
 
   EFI_BLOCK_IO_MEDIA  *Media;
   EMU_BLOCK_IO_PROTOCOL   EmuBlockIo;
diff --git a/EmulatorPkg/Win/Host/WinHost.c b/EmulatorPkg/Win/Host/WinHost.c
index 0cf02044c2..9b98d5330f 100644
--- a/EmulatorPkg/Win/Host/WinHost.c
+++ b/EmulatorPkg/Win/Host/WinHost.c
@@ -466,7 +466,7 @@ Returns:
 SecPrint ("ERROR : Can not allocate enough space for SecStack\n");
 exit (1);
   }
-  SetMemN (TemporaryRam, TemporaryRamSize, PcdGet32 (PcdInitValueInTempStack));
+  SetMem32 (TemporaryRam, TemporaryRamSize, PcdGet32 
(PcdInitValueInTempStack));
 
   SecPrint ("  OS Emulator passing in %u KB of temp RAM at 0x%08lx to SEC\n",
 TemporaryRamSize / SIZE_1KB,
-- 
2.16.1.windows.1

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


[edk2] [PATCH 02/10] EmulatorPkg/EmuGopDxe: Clear screen to black in GOP.SetMode

2018-08-27 Thread Ruiyu Ni
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1118

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Hao Wu 
Cc: Andrew Fish 
---
 EmulatorPkg/EmuGopDxe/GopScreen.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/EmulatorPkg/EmuGopDxe/GopScreen.c 
b/EmulatorPkg/EmuGopDxe/GopScreen.c
index aa21fa68de..0ff7005ab6 100644
--- a/EmulatorPkg/EmuGopDxe/GopScreen.c
+++ b/EmulatorPkg/EmuGopDxe/GopScreen.c
@@ -1,6 +1,6 @@
 /*++ @file
 
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
 Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved.
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
@@ -146,9 +146,9 @@ EmuGopSetMode (
 );
 
 
-  Fill.Red  = 0x7f;
-  Fill.Green= 0x7F;
-  Fill.Blue = 0x7f;
+  Fill.Red   = 0;
+  Fill.Green = 0;
+  Fill.Blue  = 0;
   This->Blt (
   This,
   &Fill,
-- 
2.16.1.windows.1

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


[edk2] [PATCH 03/10] EmulatorPkg/Win: Use FrameBufferBltLib for BLT operation

2018-08-27 Thread Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Hao Wu 
Cc: Andrew Fish 
---
 EmulatorPkg/EmulatorPkg.dsc |   1 +
 EmulatorPkg/Win/Host/WinGop.h   |   4 +-
 EmulatorPkg/Win/Host/WinGopScreen.c | 218 
 EmulatorPkg/Win/Host/WinHost.inf|   1 +
 4 files changed, 73 insertions(+), 151 deletions(-)

diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index 9f9f7d318d..ee85c9ef64 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -55,6 +55,7 @@ [LibraryClasses]
   PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
   
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
+  
FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
 
   #
   # UEFI & PI
diff --git a/EmulatorPkg/Win/Host/WinGop.h b/EmulatorPkg/Win/Host/WinGop.h
index de27238342..7843b60b91 100644
--- a/EmulatorPkg/Win/Host/WinGop.h
+++ b/EmulatorPkg/Win/Host/WinGop.h
@@ -31,6 +31,7 @@ Abstract:
 #include 
 #include 
 #include 
+#include 
 
 //
 // WM_SYSKEYDOWN/WM_SYSKEYUP Notification
@@ -86,9 +87,8 @@ typedef struct {
   // updated in the main thread and displayed in the windows thread.
   //
   BITMAPV4HEADER*VirtualScreenInfo;
-  RGBQUAD   *VirtualScreen;
 
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL *FillLine;
+  FRAME_BUFFER_CONFIGURE*FrameBufferConfigure;
 
   //
   // Keyboard Queue used by Simple Text In.
diff --git a/EmulatorPkg/Win/Host/WinGopScreen.c 
b/EmulatorPkg/Win/Host/WinGopScreen.c
index 2ca51d23d0..0e1f1ff205 100644
--- a/EmulatorPkg/Win/Host/WinGopScreen.c
+++ b/EmulatorPkg/Win/Host/WinGopScreen.c
@@ -1,6 +1,6 @@
 /** @file
 
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, 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
@@ -193,64 +193,85 @@ WinNtWndSize (
   IN  UINT32Height
 )
 {
-  UINT32Size;
-  GRAPHICS_PRIVATE_DATA *Private;
-  RECT  Rect;
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL *NewFillLine;
+  RETURN_STATUSRStatus;
+  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION Info;
+  GRAPHICS_PRIVATE_DATA*Private;
+  RECT Rect;
+  BITMAPV4HEADER   *VirtualScreenInfo;
+  FRAME_BUFFER_CONFIGURE   *FrameBufferConfigure;
+  UINTNFrameBufferConfigureSize;
 
   Private = GRAPHICS_PRIVATE_DATA_FROM_THIS (GraphicsIo);
-  Private->Width  = Width;
-  Private->Height = Height;
-
-
-  //
-  // Free the old buffer. We do not save the content of the old buffer since 
the
-  // screen is to be cleared anyway. Clearing the screen is required by the 
EFI spec.
-  // See UEFI spec -EFI_GRAPHICS_OUTPUT_PROTOCOL.SetMode()
-  //
-  if (Private->VirtualScreenInfo != NULL) {
-HeapFree (GetProcessHeap (), 0, Private->VirtualScreenInfo);
-  }
 
   //
   // Allocate DIB frame buffer directly from NT for performance enhancement
-  // This buffer is the virtual screen/frame buffer. This buffer is not the
-  // same a a frame buffer. The first row of this buffer will be the bottom
-  // line of the image. This is an artifact of the way we draw to the screen.
+  // This buffer is the virtual screen/frame buffer.
   //
-  Size = Private->Width * Private->Height * sizeof (RGBQUAD) + sizeof 
(BITMAPV4HEADER);
-  Private->VirtualScreenInfo = HeapAlloc (
+  VirtualScreenInfo = HeapAlloc (
 GetProcessHeap (),
 HEAP_ZERO_MEMORY,
-Size
+Width * Height * sizeof (RGBQUAD) + sizeof (BITMAPV4HEADER)
   );
+  if (VirtualScreenInfo == NULL) {
+return EFI_OUT_OF_RESOURCES;
+  }
 
   //
   // Update the virtual screen info data structure
+  // Use negative Height to make sure screen/buffer are using the same 
coordinate.
   //
-  Private->VirtualScreenInfo->bV4Size = sizeof (BITMAPV4HEADER);
-  Private->VirtualScreenInfo->bV4Width = Private->Width;
-  Private->VirtualScreenInfo->bV4Height = Private->Height;
-  Private->VirtualScreenInfo->bV4Planes = 1;
-  Private->VirtualScreenInfo->bV4BitCount = 32;
+  VirtualScreenInfo->bV4Size = sizeof (BITMAPV4HEADER);
+  VirtualScreenInfo->bV4Width = Width;
+  VirtualScreenInfo->bV4Height = -(LONG)Height;
+  VirtualScreenInfo->bV4Planes = 1;
+  VirtualScreenInfo->bV4BitCount = 32;
   //
   // uncompressed
   //
-  Private->VirtualScreenInfo->bV4V4Compression = BI_RGB;
+  VirtualScreenInfo->bV4V4Compression = BI_RGB;
+
+  Info.HorizontalResolution = Width;
+  Info.VerticalResolution   = Height;
+  Info.PixelFormat  = PixelBlueGreenRedReserved8BitPerCo

[edk2] [PATCH 09/10] EmulatorPkg: Use MdeModulePkg/Bds module

2018-08-27 Thread Ruiyu Ni
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1120

Logo is enabled by adding a separate core driver LogoDxe.
UiApp and BootManagerMenuApp are added to provide two UIs.

LoadFileOnFv2 is added to auto-install LoadFile protocol for
applications in FV so the boot options for applications can be
auto-created from LoadFile.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Hao Wu 
Cc: Andrew Fish 
---
 EmulatorPkg/EmulatorPkg.dsc|  31 +-
 EmulatorPkg/EmulatorPkg.fdf|  21 +-
 EmulatorPkg/Library/EmuBdsLib/BdsPlatform.c| 559 -
 EmulatorPkg/Library/PlatformBmLib/PlatformBm.c | 435 
 .../BdsPlatform.h => PlatformBmLib/PlatformBm.h}   |  57 +--
 .../PlatformBmData.c}  |  13 +-
 .../PlatformBmLib.inf} |  28 +-
 .../Library/PlatformBmLib/PlatformBmMemoryTest.c   | 133 +
 8 files changed, 646 insertions(+), 631 deletions(-)
 delete mode 100644 EmulatorPkg/Library/EmuBdsLib/BdsPlatform.c
 create mode 100644 EmulatorPkg/Library/PlatformBmLib/PlatformBm.c
 rename EmulatorPkg/Library/{EmuBdsLib/BdsPlatform.h => 
PlatformBmLib/PlatformBm.h} (62%)
 rename EmulatorPkg/Library/{EmuBdsLib/PlatformData.c => 
PlatformBmLib/PlatformBmData.c} (77%)
 rename EmulatorPkg/Library/{EmuBdsLib/EmuBdsLib.inf => 
PlatformBmLib/PlatformBmLib.inf} (71%)
 create mode 100644 EmulatorPkg/Library/PlatformBmLib/PlatformBmMemoryTest.c

diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index 72e8aa1788..325d32fa2f 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -79,7 +79,9 @@ [LibraryClasses]
   UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
   DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
   
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
-  GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
+  BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
+  FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
+  
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
   BmpSupportLib|MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf
   SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
   
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
@@ -90,7 +92,7 @@ [LibraryClasses]
   #
   # Platform
   #
-  PlatformBdsLib|EmulatorPkg/Library/EmuBdsLib/EmuBdsLib.inf
+  PlatformBootManagerLib|EmulatorPkg/Library/PlatformBmLib/PlatformBmLib.inf
   KeyMapLib|EmulatorPkg/Library/KeyMapLibNull/KeyMapLibNull.inf
 
   #
@@ -107,7 +109,6 @@ [LibraryClasses]
   
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
   SortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
-  
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
   ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
   FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
 
@@ -171,13 +172,6 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER, 
LibraryClasses.common.UEFI_DRIVER, Li
   
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
   TimerLib|EmulatorPkg/Library/DxeTimerLib/DxeTimerLib.inf
 
-[LibraryClasses.common.UEFI_DRIVER]
-  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
-
-[LibraryClasses.common.UEFI_APPLICATION]
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-
-
 [PcdsFeatureFlag]
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|TRUE
@@ -198,6 +192,9 @@ [PcdsFixedAtBuild]
 
   gEmulatorPkgTokenSpaceGuid.PcdEmuMemorySize|L"64!64"
 
+  # Change PcdBootManagerMenuFile to UiApp
+  gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 
0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 }
+
 !ifndef $(USE_OLD_SHELL)
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 
0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }
 !endif
@@ -238,7 +235,7 @@ [PcdsDynamicDefault.common.DEFAULT]
 [PcdsDynamicHii.common.DEFAULT]
   
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|L"Setup"|gEmuSystemConfigGuid|0x0|80
   
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|L"Setup"|gEmuSystemConfigGuid|0x4|25
-
+  
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|10
 
 [Components]
 !ifdef $(UNIX_SEC_BUILD)
@@ -337,7 +334,17 @@ [Components]
   }
 
   MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
-  IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
+  MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.inf
+  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
+  MdeModulePkg/Logo/LogoDxe.i

[edk2] [PATCH 07/10] EmulatorPkg/AutoScanPei: Report the correct CPU address size

2018-08-27 Thread Ruiyu Ni
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1119

Today's implementation unconditionally reports CPU address size
as 36 through CPU HOB. But when WinHost is running at 64bit,
the system memory might be allocated above 2^36.

It causes system asserts when DxeCore code tries to find the
corresponding GCD entry for a given valid address.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Hao Wu 
Cc: Andrew Fish 
---
 EmulatorPkg/AutoScanPei/AutoScanPei.c | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/EmulatorPkg/AutoScanPei/AutoScanPei.c 
b/EmulatorPkg/AutoScanPei/AutoScanPei.c
index 78a40db3a2..bf9958a4a9 100644
--- a/EmulatorPkg/AutoScanPei/AutoScanPei.c
+++ b/EmulatorPkg/AutoScanPei/AutoScanPei.c
@@ -1,6 +1,6 @@
 /*++ @file
 
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
 Portions copyright (c) 2011, Apple Inc. All rights reserved.
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
@@ -51,7 +51,8 @@ Returns:
   EFI_PHYSICAL_ADDRESSMemoryBase;
   UINTN   Index;
   EFI_RESOURCE_ATTRIBUTE_TYPE Attributes;
-
+  UINTN   HighBitSet;
+  UINT8   SizeOfMemorySpace;
 
   DEBUG ((EFI_D_ERROR, "Emu Autoscan PEIM Loaded\n"));
 
@@ -66,7 +67,8 @@ Returns:
  );
   ASSERT_EFI_ERROR (Status);
 
-  Index = 0;
+  SizeOfMemorySpace = 0;
+  Index = 0;
   do {
 Status = Thunk->MemoryAutoScan (Index, &MemoryBase, &MemorySize);
 if (!EFI_ERROR (Status)) {
@@ -96,6 +98,12 @@ Returns:
 MemoryBase,
 MemorySize
 );
+  HighBitSet= HighBitSet64 (MemoryBase + MemorySize);
+  SizeOfMemorySpace = MAX (SizeOfMemorySpace, (UINT8)HighBitSet + 1);
+  DEBUG ((
+DEBUG_INFO, "Emu Memory Discoverred[%d]: Base = %016lx / Size = 
%016x\n",
+Index, MemoryBase, MemorySize
+));
 }
 Index++;
   } while (!EFI_ERROR (Status));
@@ -103,7 +111,8 @@ Returns:
   //
   // Build the CPU hob with 36-bit addressing and 16-bits of IO space.
   //
-  BuildCpuHob (36, 16);
+  DEBUG ((DEBUG_INFO, "Emu SizeOfMemorySpace = %d\n", SizeOfMemorySpace));
+  BuildCpuHob (SizeOfMemorySpace, 16);
 
   return Status;
 }
-- 
2.16.1.windows.1

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


[edk2] [PATCH 00/10] Quality improvement for EmulatorPkg Win Host

2018-08-27 Thread Ruiyu Ni
The patch sets make Win Host boot in 64 bit, fix all SCT issues
regarding to console input/output, switch to use MdeModulePkg/Bds.

Ruiyu Ni (10):
  EmulatorPkg/EmuGopDxe: Fix TxtInEx.SetState SCT conformance failure
  EmulatorPkg/EmuGopDxe: Clear screen to black in GOP.SetMode
  EmulatorPkg/Win: Use FrameBufferBltLib for BLT operation
  EmulatorPkg/Win: ReadKeyStrokeEx() always returns correct KeyState
  EmulatorPkg/Win: Do not zero out file content
  EmulatorPkg/Win: Enable 64bit (SEC,PEI,DXE all run at 64bit)
  EmulatorPkg/AutoScanPei: Report the correct CPU address size
  EmulatorPkg/Win: Add VS2017 project file
  EmulatorPkg: Use MdeModulePkg/Bds module
  EmulatorPkg: IoThunk->Close() is called too early, may causing hang

 EmulatorPkg/AutoScanPei/AutoScanPei.c  |  17 +-
 EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.c |  14 +-
 EmulatorPkg/EmuGopDxe/GopInput.c   |  11 +-
 EmulatorPkg/EmuGopDxe/GopScreen.c  |   8 +-
 .../EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c   |  10 +-
 EmulatorPkg/EmuSnpDxe/EmuSnpDxe.c  |  32 +-
 EmulatorPkg/EmulatorPkg.dsc|  38 +-
 EmulatorPkg/EmulatorPkg.fdf|  21 +-
 EmulatorPkg/Library/EmuBdsLib/BdsPlatform.c| 559 -
 EmulatorPkg/Library/PlatformBmLib/PlatformBm.c | 435 
 .../BdsPlatform.h => PlatformBmLib/PlatformBm.h}   |  57 +--
 .../PlatformBmData.c}  |  13 +-
 .../PlatformBmLib.inf} |  28 +-
 .../Library/PlatformBmLib/PlatformBmMemoryTest.c   | 133 +
 EmulatorPkg/Win/Host/WinBlockIo.c  |  30 +-
 EmulatorPkg/Win/Host/WinGop.h  |   4 +-
 EmulatorPkg/Win/Host/WinGopInput.c |  17 +
 EmulatorPkg/Win/Host/WinGopScreen.c| 218 +++-
 EmulatorPkg/Win/Host/WinHost.c |   2 +-
 EmulatorPkg/Win/Host/WinHost.inf   |   1 +
 EmulatorPkg/Win/VS2017/BuildVS.bat |   3 +
 EmulatorPkg/Win/VS2017/Win.sln |  31 ++
 EmulatorPkg/Win/VS2017/Win.vcxproj | 120 +
 EmulatorPkg/Win/VS2017/Win.vcxproj.filters |  50 ++
 EmulatorPkg/Win/VS2017/Win.vcxproj.user|  13 +
 25 files changed, 1046 insertions(+), 819 deletions(-)
 delete mode 100644 EmulatorPkg/Library/EmuBdsLib/BdsPlatform.c
 create mode 100644 EmulatorPkg/Library/PlatformBmLib/PlatformBm.c
 rename EmulatorPkg/Library/{EmuBdsLib/BdsPlatform.h => 
PlatformBmLib/PlatformBm.h} (62%)
 rename EmulatorPkg/Library/{EmuBdsLib/PlatformData.c => 
PlatformBmLib/PlatformBmData.c} (77%)
 rename EmulatorPkg/Library/{EmuBdsLib/EmuBdsLib.inf => 
PlatformBmLib/PlatformBmLib.inf} (71%)
 create mode 100644 EmulatorPkg/Library/PlatformBmLib/PlatformBmMemoryTest.c
 create mode 100644 EmulatorPkg/Win/VS2017/BuildVS.bat
 create mode 100644 EmulatorPkg/Win/VS2017/Win.sln
 create mode 100644 EmulatorPkg/Win/VS2017/Win.vcxproj
 create mode 100644 EmulatorPkg/Win/VS2017/Win.vcxproj.filters
 create mode 100644 EmulatorPkg/Win/VS2017/Win.vcxproj.user

-- 
2.16.1.windows.1

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