[edk2] [PATCH] uefi-sct/SctPkg: Fix the BlueTooth Guid and Enable BLE test

2018-10-13 Thread Eric Jin
Correct the guid of EFI_GUID gEfiBlueToothIoProtocolGuid and 
gEfiBlueToothConfigProtocolGuid
Add BlueToothLE support test in the EfiCompliant part

Cc: Supreeth Venkatesh 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin 
---
 .../Dependency/Config/EfiCompliant.ini|   9 +-
 .../EfiCompliantBBTestPlatform_uefi.c | 127 --
 .../EfiCompliant/BlackBoxTest/Guid_uefi.c |   4 +-
 .../EfiCompliant/BlackBoxTest/Guid_uefi.h |   7 +-
 4 files changed, 132 insertions(+), 15 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Dependency/Config/EfiCompliant.ini
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Dependency/Config/EfiCompliant.ini
index 78b5f7b5..7c0bdcd6 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Dependency/Config/EfiCompliant.ini
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Dependency/Config/EfiCompliant.ini
@@ -1,7 +1,7 @@
 ## @file
 #
 #  Copyright 2006 - 2016 Unified EFI, Inc.
-#  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+#  Copyright (c) 2010 - 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
@@ -84,7 +84,9 @@
 #
 #   EAPSupport= 
 #
-#   BlueToothSupport  = 
+#   BlueToothClassicSupport   = 
+#
+#   BlueToothLESupport= 
 #
 #   IPSecSupport  = 
 #
@@ -120,6 +122,7 @@ DNS6Support   = yes
 TLSSupport= yes
 HTTPSupport   = yes
 EAPSupport= yes
-BlueToothSupport  = yes
+BlueToothClassicSupport   = yes
+BlueToothLESupport= yes
 IPSecSupport  = yes
 
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestPlatform_uefi.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestPlatform_uefi.c
index 17df564b..2d45a7c0 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestPlatform_uefi.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestPlatform_uefi.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2016 Unified EFI, Inc.
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -152,9 +152,9 @@ EFI_GUID gEfiBlueToothHcProtocolGuid = { 0xb3930571, 
0xbeba, 0x4fc5, {0x92, 0x3,
 
 EFI_GUID gEfiBlueToothServiceBindingProtocolGuid = { 0x388278d3, 0x7b85, 
0x42f0, {0xab, 0xa9, 0xfb, 0x4b, 0xfd, 0x69, 0xf5, 0xab }};
 
-EFI_GUID gEfiBlueToothIoProtocolGuid = { 0x388278d3, 0x7b85, 0x42f0, {0xab, 
0xa9, 0xfb, 0x4b, 0xfd, 0x69, 0xf5, 0xab }};
+EFI_GUID gEfiBlueToothIoProtocolGuid = { 0x467313de, 0x4e30, 0x43f1,{ 0x94, 
0x3e, 0x32, 0x3f, 0x89, 0x84, 0x5d, 0xb5 }};
 
-EFI_GUID gEfiBlueToothConfigProtocolGuid = { 0xb3930571, 0xbeba, 0x4fc5, 
{0x92, 0x3, 0x94, 0x27, 0x24, 0x2e, 0x6a, 0x43 }};
+EFI_GUID gEfiBlueToothConfigProtocolGuid = { 0x62960cf3, 0x40ff, 0x4263,{0xa7, 
0x7c, 0xdf, 0xde, 0xbd, 0x19, 0x1b, 0x4b }};
 
 EFI_GUID gEfiEapProtocolGuid = { 0x5d9f96db, 0xe731, 0x4caa, {0xa0, 0x0d, 
0x72, 0xe1, 0x87, 0xcd, 0x77, 0x62 }};
 
@@ -166,6 +166,10 @@ EFI_GUID gEfiIPSecConfigProtocolGuid = { 0xce5e5929, 
0xc7a3, 0x4602, {0xad, 0x9e
 
 EFI_GUID gEfiIPSec2ProtocolGuid = { 0xa3979e64, 0xace8, 0x4ddc, {0xbc, 0x07, 
0x4d, 0x66, 0xb8, 0xfd, 0x09, 0x77 }};
 
+EFI_GUID gEfiBlueToothAttributeProtocolGuid = { 0x898890e9, 0x84b2, 0x4f3a, { 
0x8c, 0x58, 0xd8, 0x57, 0x78, 0x13, 0xe0, 0xac }};
+
+EFI_GUID gEfiBlueToothLEConfigProtocolGuid = { 0x8f76da58, 0x1f99, 0x4275, { 
0xa4, 0xec, 0x47, 0x56, 0x51, 0x5b, 0x1c, 0xe8 }};
+
 //
 // Internal functions declarations
 //
@@ -353,7 +357,13 @@ CheckEAPProtocols (
   );
 
 EFI_STATUS
-CheckBlueToothProtocols (
+CheckBlueToothClassicProtocols (
+  IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL   *StandardLib,
+  IN EFI_INI_FILE_HANDLE  IniFile
+  );
+
+EFI_STATUS
+CheckBlueToothLEProtocols (
   IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL   *StandardLib,
   IN EFI_INI_FILE_HANDLE  IniFile
   );
@@ -564,7 +574,8 @@ Routine Description:
   //
   // Check the BlueTooth protocols
   //
-  CheckBlueToothProtocols (StandardLib, IniFile);
+  CheckBlueToothClassicProtocols (StandardLib, IniFile);
+  CheckBlueToothLEProtocols (StandardLib, IniFile);
 
   //
   // Check the IPSec protocols
@@ -3534,7 +3545,7 @@ CheckEAPProtocols (
 }
 
 EFI_STATUS
-CheckBlueToothProtocols (
+CheckBlueToothClassicProtocols (
   IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL   *StandardLib,
   IN EFI_INI_FILE_HANDLE

[edk2] [PATCH] uefi-sct/SctPkg:Implement the iSCSI devicepath to text

2018-10-13 Thread Eric Jin
Cc: Supreeth Venkatesh 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin 
---
 .../DevicePathToTextBBTestCoverage.c  | 43 ++-
 .../BlackBoxTest/DevicePathToTextBBTestMain.c | 26 +--
 .../DevicePathToText/BlackBoxTest/Guid.c  |  1 +
 .../DevicePathToText/BlackBoxTest/Guid.h  |  7 +++
 4 files changed, 73 insertions(+), 4 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestCoverage.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestCoverage.c
index c30af434..14c4c460 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestCoverage.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestCoverage.c
@@ -2202,7 +2202,48 @@ DevicePathToTextConvertDeviceNodeToTextCoverageTest (
 SctFreePool (Text);
   }
 
-  
+  //
+  // iSCSI(Name,0x12AB,0x00567800,CRC32C,None,CHAP_BI,TCP)
+  //
+  pDeviceNode1 = DevicePathUtilities->CreateDeviceNode (0x3, 0x13, sizeof 
(ISCSI_DEVICE_PATH_WITH_NAME) + 4);  
+  ((ISCSI_DEVICE_PATH_WITH_NAME *)pDeviceNode1)->NetworkProtocol = 0x0;  //TCP
+  ((ISCSI_DEVICE_PATH_WITH_NAME *)pDeviceNode1)->LoginOption = 0x0002;
+  ((ISCSI_DEVICE_PATH_WITH_NAME *)pDeviceNode1)->Lun = 0x00785600;
+  ((ISCSI_DEVICE_PATH_WITH_NAME *)pDeviceNode1)->TargetPortalGroupTag = 0x12AB;
+  ((ISCSI_DEVICE_PATH_WITH_NAME *)pDeviceNode1)->iSCSITargetName[0] = 'N';
+  ((ISCSI_DEVICE_PATH_WITH_NAME *)pDeviceNode1)->iSCSITargetName[1] = 'a';
+  ((ISCSI_DEVICE_PATH_WITH_NAME *)pDeviceNode1)->iSCSITargetName[2] = 'm';
+  ((ISCSI_DEVICE_PATH_WITH_NAME *)pDeviceNode1)->iSCSITargetName[3] = 'e';
+
+  Text = DevicePathToText->ConvertDeviceNodeToText (pDeviceNode1, FALSE, 
FALSE);
+  pDeviceNode2 = SctConvertTextToDeviceNode(Text);
+
+  if ((pDeviceNode2 != NULL) && (SctCompareMem (pDeviceNode2, pDeviceNode1, 
SctDevicePathNodeLength(pDeviceNode1)) == 0)) {
+AssertionType = EFI_TEST_ASSERTION_PASSED;
+  } else {
+AssertionType = EFI_TEST_ASSERTION_FAILED;
+  }
+
+  StandardLib->RecordAssertion (
+StandardLib,
+AssertionType,
+gDevicePathToTextBBTestFunctionAssertionGuid135,
+L"EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL - ConvertDeviceNodeToText 
must correctly recover the converting ConvertTextToDeviceNode has acted on the 
device node string",
+L"%a:%d: Convert result: %s - 
Expected:iSCSI(MyTargetName,0x12AB,0x00567800,CRC32C,None,CHAP_BI,TCP)",
+__FILE__,
+(UINTN)__LINE__,
+Text
+);
+  if (pDeviceNode1 != NULL) {
+SctFreePool (pDeviceNode1);
+  }
+  if (pDeviceNode2 != NULL) {
+SctFreePool (pDeviceNode2);
+  }
+  if (Text != NULL) {
+SctFreePool (Text);
+  }
+
   return EFI_SUCCESS;
 }
 
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestMain.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestMain.c
index 41cf217b..d755227c 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestMain.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestMain.c
@@ -2437,6 +2437,7 @@ BuildiSCSIDeviceNode (
   CHAR16 *LunStr;
   UINT16 Options;
   UINT64 LunNum;
+  UINT64 TempLunNum;
 
   Status = GetNextRequiredParam(, L"TargetName", 
, );
   if ((!EFI_ERROR(Status)) && (ParamIdentifierVal != NULL)) {
@@ -2459,7 +2460,7 @@ BuildiSCSIDeviceNode (
return NULL;
   }
 
-  Length = sizeof (ISCSI_DEVICE_PATH_WITH_NAME) + (UINT16) (SctStrLen 
(NameStr) * 2 + 2);
+  Length = sizeof (ISCSI_DEVICE_PATH_WITH_NAME) + (UINT16) (SctStrLen 
(NameStr));
   iSCSI = (ISCSI_DEVICE_PATH_WITH_NAME *) CreateDeviceNode (0x3, 0x13, Length);
   if (iSCSI == NULL) {
return NULL;
@@ -2499,7 +2500,7 @@ BuildiSCSIDeviceNode (
 if (SctStrCmp (ParamIdentifierVal, L"CRC32C") == 0) {
   Options |= 0x0002;
 }
-   break;
+break;
 
   case 1:  // DataDigest
 if (SctStrCmp (ParamIdentifierVal, L"CRC32C") == 0) {
@@ -2514,6 +2515,9 @@ BuildiSCSIDeviceNode (
 if (SctStrCmp (ParamIdentifierVal, L"CHAP_UNI") == 0) {
   Options |= 0x1000;
 }
+if (SctStrCmp (ParamIdentifierVal, L"CHAP_BI") == 0) {
+  Options |= 0x;
+}  
 break;
 
   case 3:  // Protocol
@@ -2533,8 +2537,24 @@ BuildiSCSIDeviceNode (
 
   SctUnicodeToAscii (iSCSI->iSCSITargetName, NameStr, SctStrLen (NameStr));
   iSCSI->TargetPortalGroupTag = (UINT16) SctStrToUInt (PortalGroupStr);
-  SctStrToUInt64 

[edk2] [PATCH] uefi-sct/SctPkg:Enhance the SimpleNetwork Test

2018-10-13 Thread Eric Jin
Add the EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST bit in the Enable parameter
Add one checkpoint to MCastFilterCount is zero

Cc: Supreeth Venkatesh 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin 
---
 .../SimpleNetwork/BlackBoxTest/Guid.c |  4 +-
 .../SimpleNetwork/BlackBoxTest/Guid.h |  7 +-
 .../SimpleNetworkBBTestConformance.c  | 66 +--
 .../SimpleNetwork/BlackBoxTest/Guid.c |  4 +-
 .../SimpleNetwork/BlackBoxTest/Guid.h |  7 +-
 .../SimpleNetworkBBTestConformance.c  | 66 +--
 6 files changed, 110 insertions(+), 44 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.c 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.c
index 6ea6c4cb..72343236 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2016 Unified EFI, Inc.
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -112,6 +112,8 @@ EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid041 = 
EFI_TEST_SIMPLENETWOR
 
 EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid042 = 
EFI_TEST_SIMPLENETWORKBBTESTCONFORMANCE_ASSERTION_042_GUID;
 
+EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid043 = 
EFI_TEST_SIMPLENETWORKBBTESTCONFORMANCE_ASSERTION_043_GUID;
+
 EFI_GUID gSimpleNetworkBBTestFunctionAssertionGuid001 = 
EFI_TEST_SIMPLENETWORKBBTESTFUNCTION_ASSERTION_001_GUID;
 
 EFI_GUID gSimpleNetworkBBTestFunctionAssertionGuid002 = 
EFI_TEST_SIMPLENETWORKBBTESTFUNCTION_ASSERTION_002_GUID;
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.h 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.h
index 281d893a..bf909d1c 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.h
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Guid.h
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2016 Unified EFI, Inc.
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -235,6 +235,11 @@ extern EFI_GUID 
gSimpleNetworkBBTestConformanceAssertionGuid041;
 
 extern EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid042;
 
+#define EFI_TEST_SIMPLENETWORKBBTESTCONFORMANCE_ASSERTION_043_GUID \
+{ 0x8cec0b86, 0x7773, 0x4d3c, {0x84, 0x13, 0x26, 0x37, 0xfb, 0xd0, 0x8e, 0x1b 
}}
+
+extern EFI_GUID gSimpleNetworkBBTestConformanceAssertionGuid043;
+
 #define EFI_TEST_SIMPLENETWORKBBTESTFUNCTION_ASSERTION_001_GUID \
 { 0xf58651fe, 0x0538, 0x4407, {0x88, 0xe0, 0x88, 0xb8, 0xda, 0x18, 0x38, 0x3a 
}}
 
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c
index ccbbad08..b65d7d3b 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2016 Unified EFI, Inc.
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -581,11 +581,12 @@ BBTestReceiveFilterConformanceTest (
 {
   EFI_STANDARD_TEST_LIBRARY_PROTOCOL*StandardLib;
   EFI_STATUSStatus;
-  EFI_STATUSStatusBuf[5];
-  EFI_TEST_ASSERTIONAssertionType[5];
+  EFI_STATUSStatusBuf[6];
+  EFI_TEST_ASSERTIONAssertionType[6];
   EFI_SIMPLE_NETWORK_PROTOCOL   *SnpInterface;
   EFI_SIMPLE_NETWORK_STATE  State1, State2;
-
+  EFI_MAC_ADDRESS   MAC;
+  
   //
   // Get the Standard Library Interface
   //
@@ -673,23 +674,37 @@ BBTestReceiveFilterConformanceTest (
   //
   //  Call ReceiveFilters with invalide MCastFilterCnt
   //
-  StatusBuf[3] = SnpInterface->ReceiveFilters (SnpInterface, 0, 0, FALSE, 
SnpInterface->Mode->MaxMCastFilterCount + 1, NULL);
-  if (StatusBuf[3] == EFI_INVALID_PARAMETER) {
-AssertionType[3] = 

[edk2] [PATCH] uefi-sct/SctPkg:Fix the incorrect buffer free in SctAPrint()

2018-10-13 Thread Eric Jin
Cc: Supreeth Venkatesh 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin 
---
 uefi-sct/SctPkg/Library/SctLib/Print.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/uefi-sct/SctPkg/Library/SctLib/Print.c 
b/uefi-sct/SctPkg/Library/SctLib/Print.c
index c25aff11..e523073a 100644
--- a/uefi-sct/SctPkg/Library/SctLib/Print.c
+++ b/uefi-sct/SctPkg/Library/SctLib/Print.c
@@ -2,7 +2,7 @@
 
   Copyright 2006 - 2015 Unified EFI, Inc.
   Copyright (c) 2013 - 2014, ARM Ltd. All rights reserved.
-  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.   
+  Copyright (c) 2014 - 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
@@ -676,7 +676,9 @@ _IPrint (
   }
 
   ret = _Print ();
-  SctFreePool(ps.fmt.u.pw);
+  if (fmt) {
+SctFreePool(ps.fmt.u.pw);
+  }
   return ret;
 }
 
-- 
2.18.0.windows.1

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


[edk2] [PATCH] uefi-sct/SctPkg:Assign 0 to the tail of HwErrRecVariableName

2018-10-13 Thread Eric Jin
Ensure the HwErrRecVariable could be deleted before the test exit.

Cc: Supreeth Venkatesh 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin 
---
 .../BlackBoxTest/VariableServicesBBTestFunction.c  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTestFunction.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTestFunction.c
index d1064cec..1be1720a 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTestFunction.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTestFunction.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2012 Unified EFI, Inc.
-  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -3052,6 +3052,7 @@ HardwareErrorRecordFuncTest (
   //
 step2:
   DataSize = 255;
+  HwErrRecVariableName[12] = L'\0';
   SctStrnCpy ( HwErrRecVariableName, (CHAR16*)(RecoveryData+2), 12 );
   Status = RT->GetVariable (
 HwErrRecVariableName,
-- 
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 v1 6/6] ArmVirtPkg: Support for kvmtool emulated platform

2018-10-13 Thread Laszlo Ersek
On 10/12/18 16:40, Sami Mujawar wrote:
> Kvmtool is a virtual machine manager that enables hosting
> KVM guests. Kvmtool emulates certain devices like serial
> port, RTC, etc. essentially providing an emulated platform.
> 
> This patch adds support for kvmtool emulated platform.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Sami Mujawar 
> ---
> The changes can be seen at 
> https://github.com/samimujawar/edk2/commit/f13ce7024f7216e4036459bab6ce4b1d700f6050
> 
> Notes:
> v1:
> - Add support for Kvmtool emulated platform   [SAMI]
> 
>  ArmVirtPkg/ArmVirtKvmTool.dsc | 390 
>  ArmVirtPkg/ArmVirtKvmTool.fdf | 297 +++
>  2 files changed, 687 insertions(+)

I'd like to see more justification for this platform (see my questions
under 0/6), and once those are provided, I would like the maintainership
of this new platform to be captured formally in Maintainers.txt.

(There is a community topic at

about this in general, "Adding more detail to Maintainers.txt". The idea
is to adopt the pathname/pattern-based maintainer association from other
projects, like Linux and QEMU.)

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


Re: [edk2] [PATCH v1 5/6] ArmVirtPkg: Add kvmtool platform driver

2018-10-13 Thread Laszlo Ersek
On 10/12/18 16:40, Sami Mujawar wrote:
> The KvmtoolPlatformDxe performs the platform specific
> initialization like:
>   - It parses the kvmtool DT for Non-Volatile memory
> range to use for runtime variable storage and
> initialises the PcdEmuVariableNvStoreReserved.
>   - It decides if the firmware should expose ACPI or
> Device Tree-based hardware description to the
> operating system.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Sami Mujawar 
> ---
> The changes can be seen at 
> https://github.com/samimujawar/edk2/commit/57ffa0da043fd73907b24a6833d2797ea3dae564
> 
> Notes:
> v1:
> - Add kvmtool platform driver to support loading platform [SAMI]
>   specific information.
> 
>  ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.c   | 211 
> 
>  ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf |  60 ++
>  2 files changed, 271 insertions(+)
> 
> diff --git a/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.c 
> b/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.c
> new file mode 100644
> index 
> ..c8c1d50882bb9205194214217d17ed5f3644cc98
> --- /dev/null
> +++ b/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.c
> @@ -0,0 +1,211 @@
> +/** @file
> +
> +  The KvmtoolPlatformDxe performs the platform specific initialization like:
> +  - It parses the kvmtool DT for Non-Volatile memory range to use for runtime
> +variable storage and initialises the PcdEmuVariableNvStoreReserved.
> +  - It decides if the firmware should expose ACPI or Device Tree-based
> +hardware description to the operating system.
> +
> +  Copyright (c) 2018, ARM Limited. All rights reserved.
> +
> +  This program and the accompanying materials are licensed and made available
> +  under the terms and conditions of the BSD License which accompanies this
> +  distribution.  The full text of the license may be found at
> +  http://opensource.org/licenses/bsd-license.php
> +
> +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +
> +**/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/** Parse the kvmtool DT for Non-Volatile Memory range and initialize
> +PcdEmuVariableNvStoreReserved.
> +
> +  @retval EFI_SUCCESS   Success.
> +  @retval EFI_ACCESS_DENIED Failed to update Pcd.
> +  @retval EFI_BUFFER_TOO_SMALL  Non-Volatile memory region less than storage
> +required for runtime variable storage.
> +**/
> +STATIC
> +EFI_STATUS
> +InitializeNvStorageBase (
> +  VOID
> +)
> +{
> +  EFI_STATUS Status;
> +  FDT_CLIENT_PROTOCOL  * FdtClient;
> +  INT32  Node;
> +  CONST UINT64 * Reg;
> +  UINT32 Len;
> +  UINT64 RegSize;
> +  UINT64 RegBase;
> +  RETURN_STATUS  PcdStatus;
> +
> +  Status = gBS->LocateProtocol (
> +  ,
> +  NULL,
> +  (VOID **)
> +  );
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((
> +  DEBUG_ERROR,
> +  "Failed to locate Fdt Client Protocol. Status = %r\n",
> +  Status
> +  ));
> +ASSERT_EFI_ERROR (Status);
> +return Status;
> +  }
> +
> +  Status = FdtClient->FindNextCompatibleNode (
> +FdtClient,
> +"kvmtool,NVMem",
> +Node,
> +
> +);
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((
> +  DEBUG_ERROR,
> +  "%a: Cannot find NV memory DT node to use for Runtime variable 
> storage."
> +  " Expected node in DT is \'compatible = \"kvmtool,NVMem\"\'."
> +  " Status = %r\n",
> +   __FUNCTION__,
> +   Status
> +   ));
> +ASSERT_EFI_ERROR (Status);
> +return Status;
> +  }
> +
> +  Status = FdtClient->GetNodeProperty (
> +FdtClient,
> +Node,
> +"reg",
> +(CONST VOID **),
> +
> +);
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((
> +  DEBUG_ERROR,
> +  "%a: GetNodeProperty () failed. Status = %r\n",
> +  __FUNCTION__,
> +  Status
> +  ));
> +  return Status;
> +  }
> +
> +  if (Len != (2 * sizeof (UINT64))) {
> +Status = EFI_INVALID_PARAMETER;
> +DEBUG ((
> +  DEBUG_ERROR,
> +  "%a: Invalid DT Node data. Status = %r\n",
> +  __FUNCTION__,
> +  Status
> +  ));
> +  return Status;
> +  }
> +
> +  RegBase = SwapBytes64 (((CONST UINT64 *)Reg)[0]);
> +  RegSize = SwapBytes64 (((CONST UINT64 *)Reg)[1]);
> +  DEBUG ((DEBUG_INFO, "RegBase = 0x%lx, RegSize = 0x%lx\n", RegBase, 
> RegSize));
> +
> +  if (RegSize < PcdGet32 

Re: [edk2] [PATCH 0/6] Add kvmtool emulated platform support for ARM

2018-10-13 Thread Laszlo Ersek
On 10/12/18 16:40, Sami Mujawar wrote:
> Kvmtool is a virtual machine manager that enables hosting KVM
> guests. ARM is working to enhance kvmtool support to enable 
> launching of KVM guest with UEFI support.

Why is QEMU not good enough? (With or without KVM.)

Another platform I've recently learned about (for QEMU) is the SBSA
reference machine type. I'm concerned that this kind of divergence will
be hard to maintain in a common firmware package. Here's my understanding:

- ArmVirtQemu: supposed to run data center / cloud workloads
- SBSA reference machine: supposed to emulate physical machines as
  closely as possible; primarily intended as a development environment
  for physical machines
- firmware for the kvmtool platform: ?

> This patch series enables UEFI support for kvmtool's emulated ARM
> platform and is required to allow testing of kvmtool enhancements.
> 
> Note: 
> 1. These kvmtool platform support patches currently expose
>the kvmtool provided DT to the OS. Support for ACPI is
>planned, using Dynamic Tables Framework and should be
>available in the near future.

The Dynamic ACPI Tables Framework is not useful under QEMU, because QEMU
generates its own set of tables.

The framework would be very useful (I think) on the SBSA reference
machine, given that the framework would be shipped (presumably) on
physical machines as well. Why is it useful for kvmtool?

> 2. This new platform port can only be used with the updated
>kvmtool that is currently under development review.
> 
> The changes can be seen at 
> https://github.com/samimujawar/edk2/tree/299_kvmtool_plat_support_v1

I think it's valid to develop and review both streams of patches in
parallel. Usually firmware maintainers ask for the hardware emulation
bits to be pushed first.

Thanks
Laszlo

> 
> Sami Mujawar (6):
>   PcAtChipsetPkg: Add MMIO Support to SerialIo Lib
>   PcAtChipsetPkg: Add MMIO Support to RTC driver
>   MdeModulePkg: Map persistent (NV) memory
>   ArmVirtPkg: Save DT base address from X0 in PCD
>   ArmVirtPkg: Add kvmtool platform driver
>   ArmVirtPkg: Support for kvmtool emulated platform
> 
>  ArmVirtPkg/ArmVirtKvmTool.dsc  | 
> 390 
>  ArmVirtPkg/ArmVirtKvmTool.fdf  | 
> 297 +++
>  ArmVirtPkg/ArmVirtPkg.dec  | 
>  12 +-
>  ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.c | 
> 211 +++
>  ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf   | 
>  60 +++
>  ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S| 
>   9 +-
>  MdeModulePkg/MdeModulePkg.dec  | 
>   9 +
>  MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c| 
>  77 +++-
>  MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf| 
>   6 +
>  PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf | 
>   4 +
>  PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c | 
>  98 -
>  PcAtChipsetPkg/PcAtChipsetPkg.dec  | 
>   8 +
>  PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c | 
>  38 +-
>  PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c| 
> 112 +-
>  PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf | 
>   8 +
>  15 files changed, 1309 insertions(+), 30 deletions(-)
>  create mode 100644 ArmVirtPkg/ArmVirtKvmTool.dsc
>  create mode 100644 ArmVirtPkg/ArmVirtKvmTool.fdf
>  create mode 100644 ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.c
>  create mode 100644 ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
> 

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


Re: [edk2] [PATCH v1 4/6] ArmVirtPkg: Save DT base address from X0 in PCD

2018-10-13 Thread Laszlo Ersek
On 10/12/18 16:40, Sami Mujawar wrote:
> Some virtual machine managers provide the base address of the DT
> in memory in the X0 register. Save the DT Base address in the
> PcdDeviceTreeInitialBaseAddress so that the firmware can use the
> PCD to parse the DT and obtain the platform information subsequently.
> 
> This change also requires that the PcdDeviceTreeInitialBaseAddress
> be a Dynamic PCD.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Sami Mujawar 
> ---
> The changes can be seen at 
> https://github.com/samimujawar/edk2/commit/57ffa0da043fd73907b24a6833d2797ea3dae564
> 
> Notes:
> v1:
> - Enable loading of DT from base address passed in X0.[SAMI]
> 
>  ArmVirtPkg/ArmVirtPkg.dec   | 12 
>  ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S |  9 +++--
>  2 files changed, 15 insertions(+), 6 deletions(-)

This patch seems to overlap with a feature that (I think) Ard, Drew and
Eric have discussed earlier, for QEMU (floating RAM base). I suggest
coordinating as early as possible.

Thanks
Laszlo

> diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec
> index 
> 8f656fd2739dd1460891029f53953c765396f8fb..9d4b782a43e505079263ded2347dff2304c2a75c
>  100644
> --- a/ArmVirtPkg/ArmVirtPkg.dec
> +++ b/ArmVirtPkg/ArmVirtPkg.dec
> @@ -42,15 +42,19 @@ [Guids.common]
>  [Protocols]
>gFdtClientProtocolGuid = { 0xE11FACA0, 0x4710, 0x4C8E, { 0xA7, 0xA2, 0x01, 
> 0xBA, 0xA2, 0x59, 0x1B, 0x4C } }
>  
> -[PcdsFixedAtBuild, PcdsPatchableInModule]
> +[PcdsFixedAtBuild.common, PcdsDynamic.common, PcdsPatchableInModule.common]
>#
># This is the physical address where the device tree is expected to be 
> stored
> -  # upon first entry into UEFI. This needs to be a FixedAtBuild PCD, so that 
> we
> -  # can do a first pass over the device tree in the SEC phase to discover the
> -  # UART base address.
> +  # upon first entry into UEFI. In some cases this needs to be a FixedAtBuild
> +  # PCD, so that we can do a first pass over the device tree in the SEC phase
> +  # to discover the UART base address. In other cases where the base address
> +  # for the DT is passed in X0 (by an earlier firmware stage or by a virtual
> +  # machine manager), this needs to be a PcdsDynamic so that the value can be
> +  # updated.
>#
>
> gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x0|UINT64|0x0001
>  
> +[PcdsFixedAtBuild]
>#
># Padding in bytes to add to the device tree allocation, so that the DTB 
> can
># be modified in place (default: 256 bytes)
> diff --git a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S 
> b/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S
> index 
> 891cf1fcab400c0842035be6a2fb003bafd63040..b5f8c9dd3c6a2bd2c937ff3891b2f51be65094d4
>  100644
> --- a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S
> +++ b/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S
> @@ -1,5 +1,5 @@
>  //
> -//  Copyright (c) 2011-2013, ARM Limited. All rights reserved.
> +//  Copyright (c) 2011-2018, ARM Limited. All rights reserved.
>  //  Copyright (c) 2015-2016, Linaro Limited. All rights reserved.
>  //
>  //  This program and the accompanying materials
> @@ -143,8 +143,13 @@ ASM_PFX(DiscoverDramFromDt):
>//
>cbnz  x0, 0f
>ldr   x0, PcdGet64 (PcdDeviceTreeInitialBaseAddress)
> +  b 1f
>  
> -0:mov   x29, x30// preserve LR
> +  // Store the device tree base address.
> +0:adr   x8, PcdGet64 (PcdDeviceTreeInitialBaseAddress)
> +  str   x0, [x8]
> +
> +1:mov   x29, x30// preserve LR
>mov   x28, x0 // preserve DTB pointer
>mov   x27, x1 // preserve base of image pointer
>  
> 

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


Re: [edk2] Does edk2 still support python 2?

2018-10-13 Thread Laszlo Ersek
On 10/13/18 15:17, Chen, Farrah wrote:
> Hello,
> 
> When we make edk2 "OvmfPkg/build.sh -a X64 -n 16", we met below error:
> 
> [vmm@vmm-build edk2]$ OvmfPkg/build.sh -a X64 -n 16
> Initializing workspace
> /home/fan/edk2/BaseTools
> Loading previous configuration from /home/fan/edk2/Conf/BuildEnv.sh
> WORKSPACE: /home/fan/edk2
> EDK_TOOLS_PATH: /home/fan/edk2/BaseTools
> CONF_PATH: /home/fan/edk2/Conf
> 
> ERROR!!!, python version should greater than or equal to version 3.6.
> 
> Does edk2 still support python 2? How can we make edk2 with python 2? Or we 
> must update the python version to python 3.6?

[edk2] [Patch] BaseTools Python: Migrate Python27 to Python36
B9726D6DCCFB8B4CA276A9169B02216D52123AAB@SHSMSX103.ccr.corp.intel.com">http://mid.mail-archive.com/B9726D6DCCFB8B4CA276A9169B02216D52123AAB@SHSMSX103.ccr.corp.intel.com

[edk2] BaseTools/ build broken due to unreviewed patch - PLEASE FIX
https://lists.01.org/pipermail/edk2-devel/2018-October/030723.html
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v1 3/6] MdeModulePkg: Map persistent (NV) memory

2018-10-13 Thread Laszlo Ersek
(+Grant)

On 10/12/18 16:40, Sami Mujawar wrote:
> Some platforms are able to preserve a memory range across
> system resets. This memory can be used for the Non-Volatile
> variables storage. The PcdEmuVariableNvStoreReserved is
> used to specify this option.

This is the wrong approach, for two reasons.

(1) At a technical level, suck hacks are usually implemented by provding
a platform-specific FVB (firmware volume block) protocol / driver,
underneath the normal FTW and Variable drivers. The FVB implementation
can (technically) fake a "persistent" flash device in RAM that is
actually volatile.

(2) At a design level, this is an extremely bad idea though. Such
variables are only halfway non-volatile, and that fact always comes back
to bite users, sooner or later. I speak from experience with OVMF, but
more recently, there has been discussion on the USWG list too, about
platforms that can only fake non-volatility. I can't provide more
details on this open list about that, so I'll just give you a
Message-Id, and a Mantis ticket.



https://mantis.uefi.org/mantis/view.php?id=1961

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


[edk2] [PATCH v1] BaseTools: Remove sitecustomize module

2018-10-13 Thread Alex James
The sitecustomize module in BaseTools was used to set the default text
encoding on macOS systems. Setting the default system encoding is
unsupported in Python 3, so remove the sitecustomize module.

Cc: Yonghong Zhu 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Alex James 
---
 BaseTools/Source/Python/sitecustomize.py | 21 
 1 file changed, 21 deletions(-)

diff --git a/BaseTools/Source/Python/sitecustomize.py 
b/BaseTools/Source/Python/sitecustomize.py
deleted file mode 100644
index 3afa90700e..00
--- a/BaseTools/Source/Python/sitecustomize.py
+++ /dev/null
@@ -1,21 +0,0 @@
-## @file
-#
-#
-# Copyright (c) 2009 - 2014, 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
-# 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.
-import sys
-import locale
-
-if sys.platform == "darwin":
-  DefaultLocal = locale.getdefaultlocale()[1]
-  if DefaultLocal is None:
-DefaultLocal = 'UTF8'
-  sys.setdefaultencoding(DefaultLocal)
-
-- 
2.19.1

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


Re: [edk2] [Patch] BaseTools/Tests: Update GNUmakefile to use python3 variable

2018-10-13 Thread Leif Lindholm
Hi Yonghong,

Please revert this patch. The broken state of the master branch must
be undone, not hacked on until individual bits seem to work.

Plese do no further work on the master branch until the contents of
the tree is identical to what it was at
301402fa4797ac3a141e575329ca2ea91756414c. (I am not talking about a
git push -f, I am talking about a git revert.)

Best Regards,

Leif

On Sat, Oct 13, 2018 at 04:53:21PM +, Zhu, Yonghong wrote:
> Hi Ard,
> 
> Thanks. I pushed this patch since it is critical block issue.
> Version SHA-1: 678f85131238622e576705117e299d81cff755c9
> 
> Best Regards,
> Zhu Yonghong
> 
> -Original Message-
> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] 
> Sent: Sunday, October 14, 2018 12:44 AM
> To: Zhu, Yonghong 
> Cc: edk2-devel@lists.01.org; Leif Lindholm 
> Subject: Re: [Patch] BaseTools/Tests: Update GNUmakefile to use python3 
> variable
> 
> On 13 October 2018 at 18:40, Yonghong Zhu  wrote:
> > Cover the case use do make -C BaseTools before run the .edksetup.sh 
> > file.
> >
> > Cc: Ard Biesheuvel 
> > Cc: Leif Lindholm 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Yonghong Zhu 
> 
> Reviewed-by: Ard Biesheuvel 
> Tested-by: Ard Biesheuvel 
> 
> > ---
> >  BaseTools/Tests/GNUmakefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/BaseTools/Tests/GNUmakefile b/BaseTools/Tests/GNUmakefile 
> > index af334a8a..536f0b7 100644
> > --- a/BaseTools/Tests/GNUmakefile
> > +++ b/BaseTools/Tests/GNUmakefile
> > @@ -12,10 +12,10 @@
> >  #
> >
> >  all: test
> >
> >  test:
> > -   @if command -v $(PYTHON3) >/dev/null 2>&1; then $(PYTHON3) 
> > RunTests.py; else python RunTests.py; fi
> > +   @if command -v python3 >/dev/null 2>&1; then python3 
> > + RunTests.py; else echo "Error: Please install a python 3 tool!"; fi
> >
> >  clean:
> > find . -name '*.pyc' -exec rm '{}' ';'
> >
> > --
> > 2.6.1.windows.1
> >
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] BaseTools: Remove the logic that check Python3 version larger than 3.6

2018-10-13 Thread Ard Biesheuvel
On 13 October 2018 at 19:12, Gao, Liming  wrote:
> Ard:
>   So, could I add this version in the commit message? Python3.5.3 has been 
> tested.
>

Yes.

>   And, with this patch, your CI environment can work? Do you find any other 
> issue?
>

I can build locally on Debian Stretch so the CI environment should work as well.



>> -Original Message-
>> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
>> Sent: Sunday, October 14, 2018 1:05 AM
>> To: Gao, Liming 
>> Cc: Zhu, Yonghong ; Andrew Fish ; 
>> edk2-devel@lists.01.org
>> Subject: Re: [edk2] [Patch] BaseTools: Remove the logic that check Python3 
>> version larger than 3.6
>>
>> On 13 October 2018 at 19:03, Gao, Liming  wrote:
>> > Ard:
>> >   Do you verify BaseTools with Python35 or Python36?
>> >
>>
>> Python 3.5.3 (default, Sep 27 2018, 17:25:39)
>> [GCC 6.3.0 20170516] on linux
>>
>>
>> >> -Original Message-
>> >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
>> >> Ard Biesheuvel
>> >> Sent: Sunday, October 14, 2018 12:52 AM
>> >> To: Zhu, Yonghong ; Andrew Fish 
>> >> Cc: edk2-devel@lists.01.org
>> >> Subject: Re: [edk2] [Patch] BaseTools: Remove the logic that check 
>> >> Python3 version larger than 3.6
>> >>
>> >> On 13 October 2018 at 18:39, Yonghong Zhu  wrote:
>> >> > Remove the logic that the Python3 version must larger than 3.6.
>> >> > We verified Python3 migration patches on version 3.6 and 3.7.
>> >> > for other version we not verified it.
>> >> >
>> >> > Cc: Ard Biesheuvel 
>> >> > Cc: Leif Lindholm 
>> >> > Contributed-under: TianoCore Contribution Agreement 1.1
>> >> > Signed-off-by: Yonghong Zhu 
>> >>
>> >> I will note that this does not solve Andrew's problem, but nonetheless:
>> >>
>> >> Reviewed-by: Ard Biesheuvel 
>> >> Tested-by: Ard Biesheuvel 
>> >>
>> >> > ---
>> >> >  BaseTools/toolsetup.bat | 7 ---
>> >> >  edksetup.sh | 4 ++--
>> >> >  2 files changed, 2 insertions(+), 9 deletions(-)
>> >> >
>> >> > diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
>> >> > index 0d4028d..d585431 100755
>> >> > --- a/BaseTools/toolsetup.bat
>> >> > +++ b/BaseTools/toolsetup.bat
>> >> > @@ -314,17 +314,10 @@ set PYTHON3=py -3
>> >> >   echo.
>> >> >   echo !!! ERROR !!!  %PYTHON3% not install.
>> >> >   echo.
>> >> >   goto end
>> >> > )
>> >> > -  FOR /F "TOKENS=1,2" %%i IN ('%PYTHON3% --version') DO set VERSION=%%j
>> >> > -  if /I "%VERSION%" LSS "3.6" (
>> >> > - echo.
>> >> > - echo !!! ERROR !!!  python version should greater than or equal 
>> >> > to version 3.6.
>> >> > - echo.
>> >> > - goto end
>> >> > -  )
>> >> >
>> >> >  :check_freezer_path
>> >> >@REM We have Python, now test for FreezePython application
>> >> >if not defined PYTHON_FREEZER_PATH (
>> >> >  echo.
>> >> > diff --git a/edksetup.sh b/edksetup.sh
>> >> > index d4e577e..84b3e63 100755
>> >> > --- a/edksetup.sh
>> >> > +++ b/edksetup.sh
>> >> > @@ -129,13 +129,13 @@ function SetupPython3()
>> >> >  if [ "$ret" -eq 1 ]; then
>> >> >origin_version=$python_version
>> >> >export PYTHON3=$python
>> >> >  fi
>> >> >done
>> >> > -  if [ -z "$origin_version" ] || [ `echo "$origin_version < 3.6" |bc` 
>> >> > -eq 1 ]; then
>> >> > +  if [ -z "$origin_version" ]; then
>> >> >  echo
>> >> > -echo ERROR!!!, python version should greater than or equal to 
>> >> > version 3.6.
>> >> > +echo ERROR!!!, Please install a Python 3 Tool.
>> >> >  echo
>> >> >  return 1
>> >> >fi
>> >> >
>> >> >
>> >> > --
>> >> > 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] BaseTools: Remove the logic that check Python3 version larger than 3.6

2018-10-13 Thread Gao, Liming
Ard:
  So, could I add this version in the commit message? Python3.5.3 has been 
tested. 
  
  And, with this patch, your CI environment can work? Do you find any other 
issue? 
  
Thanks
Liming
> -Original Message-
> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> Sent: Sunday, October 14, 2018 1:05 AM
> To: Gao, Liming 
> Cc: Zhu, Yonghong ; Andrew Fish ; 
> edk2-devel@lists.01.org
> Subject: Re: [edk2] [Patch] BaseTools: Remove the logic that check Python3 
> version larger than 3.6
> 
> On 13 October 2018 at 19:03, Gao, Liming  wrote:
> > Ard:
> >   Do you verify BaseTools with Python35 or Python36?
> >
> 
> Python 3.5.3 (default, Sep 27 2018, 17:25:39)
> [GCC 6.3.0 20170516] on linux
> 
> 
> >> -Original Message-
> >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ard 
> >> Biesheuvel
> >> Sent: Sunday, October 14, 2018 12:52 AM
> >> To: Zhu, Yonghong ; Andrew Fish 
> >> Cc: edk2-devel@lists.01.org
> >> Subject: Re: [edk2] [Patch] BaseTools: Remove the logic that check Python3 
> >> version larger than 3.6
> >>
> >> On 13 October 2018 at 18:39, Yonghong Zhu  wrote:
> >> > Remove the logic that the Python3 version must larger than 3.6.
> >> > We verified Python3 migration patches on version 3.6 and 3.7.
> >> > for other version we not verified it.
> >> >
> >> > Cc: Ard Biesheuvel 
> >> > Cc: Leif Lindholm 
> >> > Contributed-under: TianoCore Contribution Agreement 1.1
> >> > Signed-off-by: Yonghong Zhu 
> >>
> >> I will note that this does not solve Andrew's problem, but nonetheless:
> >>
> >> Reviewed-by: Ard Biesheuvel 
> >> Tested-by: Ard Biesheuvel 
> >>
> >> > ---
> >> >  BaseTools/toolsetup.bat | 7 ---
> >> >  edksetup.sh | 4 ++--
> >> >  2 files changed, 2 insertions(+), 9 deletions(-)
> >> >
> >> > diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
> >> > index 0d4028d..d585431 100755
> >> > --- a/BaseTools/toolsetup.bat
> >> > +++ b/BaseTools/toolsetup.bat
> >> > @@ -314,17 +314,10 @@ set PYTHON3=py -3
> >> >   echo.
> >> >   echo !!! ERROR !!!  %PYTHON3% not install.
> >> >   echo.
> >> >   goto end
> >> > )
> >> > -  FOR /F "TOKENS=1,2" %%i IN ('%PYTHON3% --version') DO set VERSION=%%j
> >> > -  if /I "%VERSION%" LSS "3.6" (
> >> > - echo.
> >> > - echo !!! ERROR !!!  python version should greater than or equal to 
> >> > version 3.6.
> >> > - echo.
> >> > - goto end
> >> > -  )
> >> >
> >> >  :check_freezer_path
> >> >@REM We have Python, now test for FreezePython application
> >> >if not defined PYTHON_FREEZER_PATH (
> >> >  echo.
> >> > diff --git a/edksetup.sh b/edksetup.sh
> >> > index d4e577e..84b3e63 100755
> >> > --- a/edksetup.sh
> >> > +++ b/edksetup.sh
> >> > @@ -129,13 +129,13 @@ function SetupPython3()
> >> >  if [ "$ret" -eq 1 ]; then
> >> >origin_version=$python_version
> >> >export PYTHON3=$python
> >> >  fi
> >> >done
> >> > -  if [ -z "$origin_version" ] || [ `echo "$origin_version < 3.6" |bc` 
> >> > -eq 1 ]; then
> >> > +  if [ -z "$origin_version" ]; then
> >> >  echo
> >> > -echo ERROR!!!, python version should greater than or equal to 
> >> > version 3.6.
> >> > +echo ERROR!!!, Please install a Python 3 Tool.
> >> >  echo
> >> >  return 1
> >> >fi
> >> >
> >> >
> >> > --
> >> > 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] BaseTools: Remove the logic that check Python3 version larger than 3.6

2018-10-13 Thread Ard Biesheuvel
On 13 October 2018 at 19:03, Gao, Liming  wrote:
> Ard:
>   Do you verify BaseTools with Python35 or Python36?
>

Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux


>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ard 
>> Biesheuvel
>> Sent: Sunday, October 14, 2018 12:52 AM
>> To: Zhu, Yonghong ; Andrew Fish 
>> Cc: edk2-devel@lists.01.org
>> Subject: Re: [edk2] [Patch] BaseTools: Remove the logic that check Python3 
>> version larger than 3.6
>>
>> On 13 October 2018 at 18:39, Yonghong Zhu  wrote:
>> > Remove the logic that the Python3 version must larger than 3.6.
>> > We verified Python3 migration patches on version 3.6 and 3.7.
>> > for other version we not verified it.
>> >
>> > Cc: Ard Biesheuvel 
>> > Cc: Leif Lindholm 
>> > Contributed-under: TianoCore Contribution Agreement 1.1
>> > Signed-off-by: Yonghong Zhu 
>>
>> I will note that this does not solve Andrew's problem, but nonetheless:
>>
>> Reviewed-by: Ard Biesheuvel 
>> Tested-by: Ard Biesheuvel 
>>
>> > ---
>> >  BaseTools/toolsetup.bat | 7 ---
>> >  edksetup.sh | 4 ++--
>> >  2 files changed, 2 insertions(+), 9 deletions(-)
>> >
>> > diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
>> > index 0d4028d..d585431 100755
>> > --- a/BaseTools/toolsetup.bat
>> > +++ b/BaseTools/toolsetup.bat
>> > @@ -314,17 +314,10 @@ set PYTHON3=py -3
>> >   echo.
>> >   echo !!! ERROR !!!  %PYTHON3% not install.
>> >   echo.
>> >   goto end
>> > )
>> > -  FOR /F "TOKENS=1,2" %%i IN ('%PYTHON3% --version') DO set VERSION=%%j
>> > -  if /I "%VERSION%" LSS "3.6" (
>> > - echo.
>> > - echo !!! ERROR !!!  python version should greater than or equal to 
>> > version 3.6.
>> > - echo.
>> > - goto end
>> > -  )
>> >
>> >  :check_freezer_path
>> >@REM We have Python, now test for FreezePython application
>> >if not defined PYTHON_FREEZER_PATH (
>> >  echo.
>> > diff --git a/edksetup.sh b/edksetup.sh
>> > index d4e577e..84b3e63 100755
>> > --- a/edksetup.sh
>> > +++ b/edksetup.sh
>> > @@ -129,13 +129,13 @@ function SetupPython3()
>> >  if [ "$ret" -eq 1 ]; then
>> >origin_version=$python_version
>> >export PYTHON3=$python
>> >  fi
>> >done
>> > -  if [ -z "$origin_version" ] || [ `echo "$origin_version < 3.6" |bc` -eq 
>> > 1 ]; then
>> > +  if [ -z "$origin_version" ]; then
>> >  echo
>> > -echo ERROR!!!, python version should greater than or equal to version 
>> > 3.6.
>> > +echo ERROR!!!, Please install a Python 3 Tool.
>> >  echo
>> >  return 1
>> >fi
>> >
>> >
>> > --
>> > 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] BaseTools: Remove the logic that check Python3 version larger than 3.6

2018-10-13 Thread Gao, Liming
Ard:
  Do you verify BaseTools with Python35 or Python36?

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ard 
> Biesheuvel
> Sent: Sunday, October 14, 2018 12:52 AM
> To: Zhu, Yonghong ; Andrew Fish 
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] [Patch] BaseTools: Remove the logic that check Python3 
> version larger than 3.6
> 
> On 13 October 2018 at 18:39, Yonghong Zhu  wrote:
> > Remove the logic that the Python3 version must larger than 3.6.
> > We verified Python3 migration patches on version 3.6 and 3.7.
> > for other version we not verified it.
> >
> > Cc: Ard Biesheuvel 
> > Cc: Leif Lindholm 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Yonghong Zhu 
> 
> I will note that this does not solve Andrew's problem, but nonetheless:
> 
> Reviewed-by: Ard Biesheuvel 
> Tested-by: Ard Biesheuvel 
> 
> > ---
> >  BaseTools/toolsetup.bat | 7 ---
> >  edksetup.sh | 4 ++--
> >  2 files changed, 2 insertions(+), 9 deletions(-)
> >
> > diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
> > index 0d4028d..d585431 100755
> > --- a/BaseTools/toolsetup.bat
> > +++ b/BaseTools/toolsetup.bat
> > @@ -314,17 +314,10 @@ set PYTHON3=py -3
> >   echo.
> >   echo !!! ERROR !!!  %PYTHON3% not install.
> >   echo.
> >   goto end
> > )
> > -  FOR /F "TOKENS=1,2" %%i IN ('%PYTHON3% --version') DO set VERSION=%%j
> > -  if /I "%VERSION%" LSS "3.6" (
> > - echo.
> > - echo !!! ERROR !!!  python version should greater than or equal to 
> > version 3.6.
> > - echo.
> > - goto end
> > -  )
> >
> >  :check_freezer_path
> >@REM We have Python, now test for FreezePython application
> >if not defined PYTHON_FREEZER_PATH (
> >  echo.
> > diff --git a/edksetup.sh b/edksetup.sh
> > index d4e577e..84b3e63 100755
> > --- a/edksetup.sh
> > +++ b/edksetup.sh
> > @@ -129,13 +129,13 @@ function SetupPython3()
> >  if [ "$ret" -eq 1 ]; then
> >origin_version=$python_version
> >export PYTHON3=$python
> >  fi
> >done
> > -  if [ -z "$origin_version" ] || [ `echo "$origin_version < 3.6" |bc` -eq 
> > 1 ]; then
> > +  if [ -z "$origin_version" ]; then
> >  echo
> > -echo ERROR!!!, python version should greater than or equal to version 
> > 3.6.
> > +echo ERROR!!!, Please install a Python 3 Tool.
> >  echo
> >  return 1
> >fi
> >
> >
> > --
> > 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] BaseTools/Tests: Update GNUmakefile to use python3 variable

2018-10-13 Thread Zhu, Yonghong
Hi Ard,

Thanks. I pushed this patch since it is critical block issue.
Version SHA-1: 678f85131238622e576705117e299d81cff755c9

Best Regards,
Zhu Yonghong

-Original Message-
From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] 
Sent: Sunday, October 14, 2018 12:44 AM
To: Zhu, Yonghong 
Cc: edk2-devel@lists.01.org; Leif Lindholm 
Subject: Re: [Patch] BaseTools/Tests: Update GNUmakefile to use python3 variable

On 13 October 2018 at 18:40, Yonghong Zhu  wrote:
> Cover the case use do make -C BaseTools before run the .edksetup.sh 
> file.
>
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu 

Reviewed-by: Ard Biesheuvel 
Tested-by: Ard Biesheuvel 

> ---
>  BaseTools/Tests/GNUmakefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/BaseTools/Tests/GNUmakefile b/BaseTools/Tests/GNUmakefile 
> index af334a8a..536f0b7 100644
> --- a/BaseTools/Tests/GNUmakefile
> +++ b/BaseTools/Tests/GNUmakefile
> @@ -12,10 +12,10 @@
>  #
>
>  all: test
>
>  test:
> -   @if command -v $(PYTHON3) >/dev/null 2>&1; then $(PYTHON3) 
> RunTests.py; else python RunTests.py; fi
> +   @if command -v python3 >/dev/null 2>&1; then python3 
> + RunTests.py; else echo "Error: Please install a python 3 tool!"; fi
>
>  clean:
> find . -name '*.pyc' -exec rm '{}' ';'
>
> --
> 2.6.1.windows.1
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] BaseTools: Remove the logic that check Python3 version larger than 3.6

2018-10-13 Thread Ard Biesheuvel
On 13 October 2018 at 18:39, Yonghong Zhu  wrote:
> Remove the logic that the Python3 version must larger than 3.6.
> We verified Python3 migration patches on version 3.6 and 3.7.
> for other version we not verified it.
>
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu 

I will note that this does not solve Andrew's problem, but nonetheless:

Reviewed-by: Ard Biesheuvel 
Tested-by: Ard Biesheuvel 

> ---
>  BaseTools/toolsetup.bat | 7 ---
>  edksetup.sh | 4 ++--
>  2 files changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
> index 0d4028d..d585431 100755
> --- a/BaseTools/toolsetup.bat
> +++ b/BaseTools/toolsetup.bat
> @@ -314,17 +314,10 @@ set PYTHON3=py -3
>   echo.
>   echo !!! ERROR !!!  %PYTHON3% not install.
>   echo.
>   goto end
> )
> -  FOR /F "TOKENS=1,2" %%i IN ('%PYTHON3% --version') DO set VERSION=%%j
> -  if /I "%VERSION%" LSS "3.6" (
> - echo.
> - echo !!! ERROR !!!  python version should greater than or equal to 
> version 3.6.
> - echo.
> - goto end
> -  )
>
>  :check_freezer_path
>@REM We have Python, now test for FreezePython application
>if not defined PYTHON_FREEZER_PATH (
>  echo.
> diff --git a/edksetup.sh b/edksetup.sh
> index d4e577e..84b3e63 100755
> --- a/edksetup.sh
> +++ b/edksetup.sh
> @@ -129,13 +129,13 @@ function SetupPython3()
>  if [ "$ret" -eq 1 ]; then
>origin_version=$python_version
>export PYTHON3=$python
>  fi
>done
> -  if [ -z "$origin_version" ] || [ `echo "$origin_version < 3.6" |bc` -eq 1 
> ]; then
> +  if [ -z "$origin_version" ]; then
>  echo
> -echo ERROR!!!, python version should greater than or equal to version 
> 3.6.
> +echo ERROR!!!, Please install a Python 3 Tool.
>  echo
>  return 1
>fi
>
>
> --
> 2.6.1.windows.1
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] BaseTools/Tests: Update GNUmakefile to use python3 variable

2018-10-13 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: Sunday, October 14, 2018 12:40 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [Patch] BaseTools/Tests: Update GNUmakefile to use python3 
> variable
> 
> Cover the case use do make -C BaseTools before run the .edksetup.sh
> file.
> 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu 
> ---
>  BaseTools/Tests/GNUmakefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Tests/GNUmakefile b/BaseTools/Tests/GNUmakefile
> index af334a8a..536f0b7 100644
> --- a/BaseTools/Tests/GNUmakefile
> +++ b/BaseTools/Tests/GNUmakefile
> @@ -12,10 +12,10 @@
>  #
> 
>  all: test
> 
>  test:
> - @if command -v $(PYTHON3) >/dev/null 2>&1; then $(PYTHON3) RunTests.py; 
> else python RunTests.py; fi
> + @if command -v python3 >/dev/null 2>&1; then python3 RunTests.py; else 
> echo "Error: Please install a python 3 tool!"; fi
> 
>  clean:
>   find . -name '*.pyc' -exec rm '{}' ';'
> 
> --
> 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] BaseTools/Tests: Update GNUmakefile to use python3 variable

2018-10-13 Thread Ard Biesheuvel
On 13 October 2018 at 18:40, Yonghong Zhu  wrote:
> Cover the case use do make -C BaseTools before run the .edksetup.sh
> file.
>
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu 

Reviewed-by: Ard Biesheuvel 
Tested-by: Ard Biesheuvel 

> ---
>  BaseTools/Tests/GNUmakefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/BaseTools/Tests/GNUmakefile b/BaseTools/Tests/GNUmakefile
> index af334a8a..536f0b7 100644
> --- a/BaseTools/Tests/GNUmakefile
> +++ b/BaseTools/Tests/GNUmakefile
> @@ -12,10 +12,10 @@
>  #
>
>  all: test
>
>  test:
> -   @if command -v $(PYTHON3) >/dev/null 2>&1; then $(PYTHON3) 
> RunTests.py; else python RunTests.py; fi
> +   @if command -v python3 >/dev/null 2>&1; then python3 RunTests.py; 
> else echo "Error: Please install a python 3 tool!"; fi
>
>  clean:
> find . -name '*.pyc' -exec rm '{}' ';'
>
> --
> 2.6.1.windows.1
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] BaseTools/Tests: Update GNUmakefile to use python3 variable

2018-10-13 Thread Yonghong Zhu
Cover the case use do make -C BaseTools before run the .edksetup.sh
file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu 
---
 BaseTools/Tests/GNUmakefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Tests/GNUmakefile b/BaseTools/Tests/GNUmakefile
index af334a8a..536f0b7 100644
--- a/BaseTools/Tests/GNUmakefile
+++ b/BaseTools/Tests/GNUmakefile
@@ -12,10 +12,10 @@
 #
 
 all: test
 
 test:
-   @if command -v $(PYTHON3) >/dev/null 2>&1; then $(PYTHON3) RunTests.py; 
else python RunTests.py; fi
+   @if command -v python3 >/dev/null 2>&1; then python3 RunTests.py; else 
echo "Error: Please install a python 3 tool!"; fi
 
 clean:
find . -name '*.pyc' -exec rm '{}' ';'
 
-- 
2.6.1.windows.1

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


[edk2] [Patch] BaseTools: Remove the logic that check Python3 version larger than 3.6

2018-10-13 Thread Yonghong Zhu
Remove the logic that the Python3 version must larger than 3.6.
We verified Python3 migration patches on version 3.6 and 3.7.
for other version we not verified it.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu 
---
 BaseTools/toolsetup.bat | 7 ---
 edksetup.sh | 4 ++--
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
index 0d4028d..d585431 100755
--- a/BaseTools/toolsetup.bat
+++ b/BaseTools/toolsetup.bat
@@ -314,17 +314,10 @@ set PYTHON3=py -3
  echo.
  echo !!! ERROR !!!  %PYTHON3% not install.
  echo.
  goto end
)
-  FOR /F "TOKENS=1,2" %%i IN ('%PYTHON3% --version') DO set VERSION=%%j
-  if /I "%VERSION%" LSS "3.6" (
- echo.
- echo !!! ERROR !!!  python version should greater than or equal to 
version 3.6.
- echo.
- goto end
-  )
 
 :check_freezer_path
   @REM We have Python, now test for FreezePython application
   if not defined PYTHON_FREEZER_PATH (
 echo.
diff --git a/edksetup.sh b/edksetup.sh
index d4e577e..84b3e63 100755
--- a/edksetup.sh
+++ b/edksetup.sh
@@ -129,13 +129,13 @@ function SetupPython3()
 if [ "$ret" -eq 1 ]; then
   origin_version=$python_version
   export PYTHON3=$python
 fi
   done
-  if [ -z "$origin_version" ] || [ `echo "$origin_version < 3.6" |bc` -eq 1 ]; 
then
+  if [ -z "$origin_version" ]; then
 echo
-echo ERROR!!!, python version should greater than or equal to version 3.6.
+echo ERROR!!!, Please install a Python 3 Tool.
 echo 
 return 1
   fi
 
  
-- 
2.6.1.windows.1

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


[edk2] [PATCH] uefi-sct/SctPkg:The Lun display order issue in iSCSI device path text

2018-10-13 Thread Eric Jin
Cc: Supreeth Venkatesh 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin 
---
 .../BlackBoxTest/DevicePathFromTextBBTestCoverage.c  | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
index fc099d8e..6f97924a 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2017 Unified EFI, Inc.
-  Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -1442,7 +1442,7 @@ CreateiScsiDeviceNode (
   CHAR16  *DataDigestStr;
   CHAR16  *AuthenticationStr;
   CHAR16  *ProtocolStr;
-  UINT64  LunNum;
+  UINT64  LunNum = 0;
   ISCSI_DEVICE_PATH_WITH_NAME *iSCSI;
 
   NameStr   = SctSplitStr (, L',');
@@ -1459,7 +1459,7 @@ CreateiScsiDeviceNode (
 );
   SctUnicodeToAscii (iSCSI->iSCSITargetName, NameStr, SctStrLen (NameStr));
   iSCSI->TargetPortalGroupTag = (UINT16) SctStrToUInt (PortalGroupStr);
-  SctStrToUInt64 (LunStr, );
+  StrToUInt8Array(LunStr, );
   iSCSI->Lun = LunNum;
 
   Options = 0x;
@@ -2846,12 +2846,12 @@ DevicePathFromTextConvertTextToDeviceNodeCoverageTest (
 (UINTN)__LINE__
 );
   //
-  // TDS 3.10.1.2.26
+  // TDS 3.10.1.2.26   0x5678 - byte 3 is 0x56 and byte4 is 0x78
   //
-  SctStrCpy (text, L"MyTargetName,0x12AB,5678,CRC32C,None,CHAP_BI,TCP");
+  SctStrCpy (text, 
L"MyTargetName,0x12AB,0x00567800,CRC32C,None,CHAP_BI,TCP");
   pDevicePath = CreateiScsiDeviceNode(text);
 
-  SctStrCpy (text, L"iSCSI(MyTargetName,0x12AB,5678,CRC32C,None,CHAP_BI,TCP)");
+  SctStrCpy (text, 
L"iSCSI(MyTargetName,0x12AB,0x00567800,CRC32C,None,CHAP_BI,TCP)");
   pReDevicePath = DevicePathFromText->ConvertTextToDeviceNode (text);
   if (SctCompareMem (pDevicePath, pReDevicePath, SctDevicePathNodeLength 
((EFI_DEVICE_PATH_PROTOCOL *) pReDevicePath)) == 0) {
 AssertionType = EFI_TEST_ASSERTION_PASSED;
-- 
2.18.0.windows.1

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


[edk2] [PATCH] uefi-sct/SctPkg: Fix the Possible numeric underflow

2018-10-13 Thread Eric Jin
Possible numeric underflow when calculating the starting LBA for 
ReadBlocks_Func test

Cc: Supreeth Venkatesh 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin 
---
 .../Protocol/BlockIo/BlackBoxTest/BlockIoBBTestFunction.c   | 6 +-
 .../Protocol/BlockIo/BlackBoxTest/BlockIoBBTestFunction.c   | 6 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/BlockIo/BlackBoxTest/BlockIoBBTestFunction.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/BlockIo/BlackBoxTest/BlockIoBBTestFunction.c
index 847ff9cb..e25743b7 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/BlockIo/BlackBoxTest/BlockIoBBTestFunction.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/BlockIo/BlackBoxTest/BlockIoBBTestFunction.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2016 Unified EFI, Inc.
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -316,9 +316,13 @@ BBTestReadBlocksFunctionAutoTest (
   NewLba = IndexJ;
 } else if (IndexJ < 2 * MAX_DIFFERENT_LBA_FOR_TEST) {
   // from (LastBlock - MAX_DIFFERENT_LBA_FOR_TEST - 
MAX_DIFFERENT_BUFFERSIZE_FOR_TEST)  to (LastBlock - 
MAX_DIFFERENT_BUFFERSIZE_FOR_TEST)
+  if (LastBlock < MAX_DIFFERENT_LBA_FOR_TEST + 
MAX_DIFFERENT_BUFFERSIZE_FOR_TEST)
+continue;
   NewLba = IndexJ + LastBlock - 2 * MAX_DIFFERENT_LBA_FOR_TEST - 
MAX_DIFFERENT_BUFFERSIZE_FOR_TEST;
 } else {
   // from (LastBlock/2 - MAX_DIFFERENT_LBA_FOR_TEST/2) to (LastBlock/2 
+ MAX_DIFFERENT_LBA_FOR_TEST/2)
+  if (LastBlock < MAX_DIFFERENT_LBA_FOR_TEST)
+continue;
   NewLba = IndexJ - 2 * MAX_DIFFERENT_LBA_FOR_TEST + (SctDivU64x32 
(LastBlock, 2, ) - MAX_DIFFERENT_LBA_FOR_TEST / 2);
 }
 
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/BlockIo/BlackBoxTest/BlockIoBBTestFunction.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/BlockIo/BlackBoxTest/BlockIoBBTestFunction.c
index 2590c035..e8d4295e 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/BlockIo/BlackBoxTest/BlockIoBBTestFunction.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/BlockIo/BlackBoxTest/BlockIoBBTestFunction.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2016 Unified EFI, Inc.
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -316,9 +316,13 @@ BBTestReadBlocksFunctionAutoTest (
   NewLba = IndexJ;
 } else if (IndexJ < 2 * MAX_DIFFERENT_LBA_FOR_TEST) {
   // from (LastBlock - MAX_DIFFERENT_LBA_FOR_TEST - 
MAX_DIFFERENT_BUFFERSIZE_FOR_TEST)  to (LastBlock - 
MAX_DIFFERENT_BUFFERSIZE_FOR_TEST)
+  if (LastBlock < MAX_DIFFERENT_LBA_FOR_TEST + 
MAX_DIFFERENT_BUFFERSIZE_FOR_TEST)
+continue;
   NewLba = IndexJ + LastBlock - 2 * MAX_DIFFERENT_LBA_FOR_TEST - 
MAX_DIFFERENT_BUFFERSIZE_FOR_TEST;
 } else {
   // from (LastBlock/2 - MAX_DIFFERENT_LBA_FOR_TEST/2) to (LastBlock/2 
+ MAX_DIFFERENT_LBA_FOR_TEST/2)
+  if (LastBlock < MAX_DIFFERENT_LBA_FOR_TEST)
+continue;
   NewLba = IndexJ - 2 * MAX_DIFFERENT_LBA_FOR_TEST + (SctDivU64x32 
(LastBlock, 2, ) - MAX_DIFFERENT_LBA_FOR_TEST / 2);
 }
 
-- 
2.18.0.windows.1

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


[edk2] [PATCH] uefi-sct/SctPkg:Add the checkpoint of Toggle state of ReadKeyStrokeEx

2018-10-13 Thread Eric Jin
UEFI Spec clarify the Toggle state

Cc: Supreeth Venkatesh 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin 
---
 .../SimpleTextInputEx/BlackBoxTest/Guid.c |   7 +-
 .../SimpleTextInputEx/BlackBoxTest/Guid.h |  12 +-
 .../SimpleTextInputExBBTestFunction.c | 210 +
 .../SimpleTextInputExBBTestMain.c |  13 +-
 .../SimpleTextInputExBBTestMain.h |  22 +-
 .../SimpleTextInputEx/BlackBoxTest/Guid.c |   7 +-
 .../SimpleTextInputEx/BlackBoxTest/Guid.h |  12 +-
 .../SimpleTextInputExBBTestFunction.c | 212 +-
 .../SimpleTextInputExBBTestMain.c |  11 +-
 .../SimpleTextInputExBBTestMain.h |  20 +-
 10 files changed, 513 insertions(+), 13 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/Guid.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/Guid.c
index 9cb19f48..ff2d50fa 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/Guid.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/Guid.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2012 Unified EFI, Inc.
-  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -63,3 +63,8 @@ EFI_GUID gSimpleTextInputExBBTestFunctionAssertionGuid007 = 
EFI_TEST_SIMPLETEXTI
 EFI_GUID gSimpleTextInputExBBTestFunctionAssertionGuid008 = 
EFI_TEST_SIMPLETEXTINPUTEXBBTESTFUNCTION_ASSERTION_008_GUID;
 
 EFI_GUID gSimpleTextInputExBBTestFunctionAssertionGuid009 = 
EFI_TEST_SIMPLETEXTINPUTEXBBTESTFUNCTION_ASSERTION_009_GUID;
+
+EFI_GUID gSimpleTextInputExBBTestFunctionAssertionGuid010 = 
EFI_TEST_SIMPLETEXTINPUTEXBBTESTFUNCTION_ASSERTION_010_GUID;
+
+EFI_GUID gSimpleTextInputExBBTestFunctionAssertionGuid011 = 
EFI_TEST_SIMPLETEXTINPUTEXBBTESTFUNCTION_ASSERTION_011_GUID;
+
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/Guid.h
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/Guid.h
index 6c90fca3..2a6be48b 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/Guid.h
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/Guid.h
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2010 Unified EFI, Inc.
-  Copyright (c) 2010, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -119,3 +119,13 @@ extern EFI_GUID 
gSimpleTextInputExBBTestFunctionAssertionGuid008;
 { 0x534369f7, 0x8399, 0x4353, { 0x94, 0xad, 0xc4, 0x48, 0xfa, 0xda, 0xeb, 0x84 
} }
 
 extern EFI_GUID gSimpleTextInputExBBTestFunctionAssertionGuid009;
+
+#define EFI_TEST_SIMPLETEXTINPUTEXBBTESTFUNCTION_ASSERTION_010_GUID \
+{ 0xcf4d54eb, 0x6696, 0x4794, { 0x91, 0x74, 0x59, 0xd, 0x1c, 0x22, 0xa8, 0x67 
} }
+
+extern EFI_GUID gSimpleTextInputExBBTestFunctionAssertionGuid010;
+
+#define EFI_TEST_SIMPLETEXTINPUTEXBBTESTFUNCTION_ASSERTION_011_GUID \
+{ 0xf8e8f879, 0xa6d4, 0x4fd3, { 0x8b, 0x8e, 0xba, 0x1d, 0x18, 0xf1, 0x40, 0x71 
} }
+
+extern EFI_GUID gSimpleTextInputExBBTestFunctionAssertionGuid011;
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/SimpleTextInputExBBTestFunction.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/SimpleTextInputExBBTestFunction.c
index 153ade03..48f91002 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/SimpleTextInputExBBTestFunction.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/SimpleTextInputExBBTestFunction.c
@@ -456,6 +456,78 @@ BBTestUnregisterKeyNotifyFunctionManualTest (
 }
 
 
+EFI_STATUS
+BBTestReadKeyStrokeExFunctionAutoTest (
+  IN EFI_BB_TEST_PROTOCOL   *This,
+  IN VOID   *ClientInterface,
+  IN EFI_TEST_LEVEL TestLevel,
+  IN EFI_HANDLE SupportHandle
+  )
+{
+  EFI_STANDARD_TEST_LIBRARY_PROTOCOL*StandardLib;
+  EFI_STATUSStatus;
+  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *SimpleTextInputEx;
+  
+  EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+  CHAR16   *DevicePathStr;
+
+  //
+  // init
+  //
+  SimpleTextInputEx = (EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL*)ClientInterface;
+
+  //
+  // Get the Standard Library Interface
+  //
+  Status = gtBS->HandleProtocol (
+   SupportHandle,
+   ,
+   (VOID **) 
+   );
+  if (EFI_ERROR(Status)) {
+return 

[edk2] [PATCH] uefi-sct/SctPkg:Update the PKCS7Verify Test to add the VerifySignature() checkpoint

2018-10-13 Thread Eric Jin
Cc: Supreeth Venkatesh 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin 
---
 .../Protocol/PKCS7Verify/BlackBoxTest/Guid.c  |   12 +-
 .../Protocol/PKCS7Verify/BlackBoxTest/Guid.h  |   30 +-
 .../BlackBoxTest/Pkcs7BBTestConformance.c |  308 +++-
 .../BlackBoxTest/Pkcs7BBTestData.c| 1468 +++--
 .../BlackBoxTest/Pkcs7BBTestFunction.c|   89 +-
 .../BlackBoxTest/Pkcs7BBTestMain.c|   28 +-
 .../BlackBoxTest/Pkcs7BBTestMain.h|   26 +-
 7 files changed, 1400 insertions(+), 561 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.c 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.c
index c31d3d2d..f7b59623 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2016 Unified EFI, Inc.
-  Copyright (c) 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2016 - 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
@@ -36,9 +36,15 @@ EFI_GUID gPkcs7BBTestConformanceAssertionGuid007 = 
EFI_TEST_PKCS7BBTESTCONFORMAN
 EFI_GUID gPkcs7BBTestConformanceAssertionGuid008 = 
EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_008_GUID;
 EFI_GUID gPkcs7BBTestConformanceAssertionGuid009 = 
EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_009_GUID;
 EFI_GUID gPkcs7BBTestConformanceAssertionGuid010 = 
EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_010_GUID;
-
+EFI_GUID gPkcs7BBTestConformanceAssertionGuid011 = 
EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_011_GUID;
+EFI_GUID gPkcs7BBTestConformanceAssertionGuid012 = 
EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_012_GUID;
+EFI_GUID gPkcs7BBTestConformanceAssertionGuid013 = 
EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_013_GUID;
+EFI_GUID gPkcs7BBTestConformanceAssertionGuid014 = 
EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_014_GUID;
+EFI_GUID gPkcs7BBTestConformanceAssertionGuid015 = 
EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_015_GUID;
 
 EFI_GUID gPkcs7BBTestFunctionAssertionGuid001 = 
EFI_TEST_PKCS7BBTESTFUNCTION_ASSERTION_001_GUID;
 EFI_GUID gPkcs7BBTestFunctionAssertionGuid002 = 
EFI_TEST_PKCS7BBTESTFUNCTION_ASSERTION_002_GUID;
 EFI_GUID gPkcs7BBTestFunctionAssertionGuid003 = 
EFI_TEST_PKCS7BBTESTFUNCTION_ASSERTION_003_GUID;
-EFI_GUID gPkcs7BBTestFunctionAssertionGuid004 = 
EFI_TEST_PKCS7BBTESTFUNCTION_ASSERTION_004_GUID;
\ No newline at end of file
+EFI_GUID gPkcs7BBTestFunctionAssertionGuid004 = 
EFI_TEST_PKCS7BBTESTFUNCTION_ASSERTION_004_GUID;
+EFI_GUID gPkcs7BBTestFunctionAssertionGuid005 = 
EFI_TEST_PKCS7BBTESTFUNCTION_ASSERTION_005_GUID;
+EFI_GUID gPkcs7BBTestFunctionAssertionGuid006 = 
EFI_TEST_PKCS7BBTESTFUNCTION_ASSERTION_006_GUID;
\ No newline at end of file
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.h 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.h
index 2165cce4..c6bc3c87 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.h
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.h
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2016 Unified EFI, Inc.
-  Copyright (c) 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2016 - 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
@@ -65,6 +65,27 @@ extern EFI_GUID gPkcs7BBTestConformanceAssertionGuid009;
 { 0xb136e016, 0x4f80, 0x44bd, {0xba, 0xb0, 0x1c, 0x34, 0x8a, 0x2d, 0xa1, 0x8a 
}}
 extern EFI_GUID gPkcs7BBTestConformanceAssertionGuid010;
 
+#define EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_011_GUID \
+{ 0xa58f3626, 0xf16e, 0x4cd5, { 0xba, 0x12, 0x7a, 0x9d, 0xd6, 0x9a, 0x7a, 0x71 
}}
+extern EFI_GUID gPkcs7BBTestConformanceAssertionGuid011;
+
+#define EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_012_GUID \
+{ 0xbe4a0bf2, 0x2d46, 0x4d96, { 0xa6, 0x11, 0x21, 0x99, 0xa5, 0x5f, 0xa4, 0xee 
}}
+extern EFI_GUID gPkcs7BBTestConformanceAssertionGuid012;
+
+#define EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_013_GUID \
+{ 0xc0536a27, 0x304e, 0x497a, { 0xa5, 0xe3, 0x94, 0x11, 0x38, 0x53, 0x6e, 0x40 
}}
+extern EFI_GUID gPkcs7BBTestConformanceAssertionGuid013;
+
+#define EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_014_GUID \
+{ 0x8c5aa0e8, 0x17ff, 0x49cd, { 0x8f, 0xec, 0x37, 0xc3, 0xfd, 0x5f, 0x77, 0x0 
}}
+extern EFI_GUID gPkcs7BBTestConformanceAssertionGuid014;
+
+#define EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_015_GUID \
+{ 0x5f83c45e, 0xce1d, 0x48cb, { 0x86, 0x80, 0xfe, 0x48, 0x63, 0x19, 0xc0, 0x1c 
 }}
+extern EFI_GUID gPkcs7BBTestConformanceAssertionGuid015;
+
+
 
 #define EFI_TEST_PKCS7BBTESTFUNCTION_ASSERTION_001_GUID \
 { 

[edk2] [PATCH] uefi-sct/SctPkg:The original design for the 'EraseLengthGranularity' test need consider this case

2018-10-13 Thread Eric Jin
For the SD device, no same as the eMMC, the 'EraseLengthGranularity' is 1.

Cc: Supreeth Venkatesh 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin 
---
 .../BlackBoxTest/EraseBlockBBTestFunction.c   | 154 +-
 1 file changed, 78 insertions(+), 76 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/EraseBlock/BlackBoxTest/EraseBlockBBTestFunction.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/EraseBlock/BlackBoxTest/EraseBlockBBTestFunction.c
index bc16a473..ea081625 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/EraseBlock/BlackBoxTest/EraseBlockBBTestFunction.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/EraseBlock/BlackBoxTest/EraseBlockBBTestFunction.c
@@ -214,54 +214,56 @@ BBTestEraseBlocksFunctionTest (
   }  
 
   // Erase Blocks with non-EraseLengthGranularity blocks
-  Token.Event = NULL;
-  Token.TransactionStatus = EFI_NOT_READY;
-  EraseStatus = EraseBlock->EraseBlocks (EraseBlock, MediaId, Lba+1, 
, BufferSize - 2 * BlockSize);
-
-  // Read the data with 0, the first/last block should not be erased
-  ReadStatus = BlockIo->ReadBlocks (BlockIo, MediaId, Lba, BufferSize, 
(VOID*)Buffer2);
-  if (ReadStatus == EFI_SUCCESS) {
-for (Index1 = 0; Index1 < BlockSize; Index1++) {
-  if (Buffer2[Index1] != 0) {
-IsZero1 = FALSE;
-break;
+  if (BufferSize > 2 * BlockSize) {
+Token.Event = NULL;
+Token.TransactionStatus = EFI_NOT_READY;
+  
+EraseStatus = EraseBlock->EraseBlocks (EraseBlock, MediaId, Lba+1, 
, BufferSize - 2 * BlockSize);
+
+// Read the data with 0, the first/last block should not be erased
+ReadStatus = BlockIo->ReadBlocks (BlockIo, MediaId, Lba, BufferSize, 
(VOID*)Buffer2);
+if (ReadStatus == EFI_SUCCESS) {
+  for (Index1 = 0; Index1 < BlockSize; Index1++) {
+if (Buffer2[Index1] != 0) {
+  IsZero1 = FALSE;
+  break;
+}
   }
-}
 
-for (Index1 = BlockSize; Index1 < BufferSize - BlockSize; Index1++) {
-  if (Buffer2[Index1] != 0) {
-IsZero2 = FALSE;
-break;
+  for (Index1 = BlockSize; Index1 < BufferSize - BlockSize; Index1++) {
+if (Buffer2[Index1] != 0) {
+  IsZero2 = FALSE;
+  break;
+}
   }
-}
 
-for (Index1 = BufferSize - BlockSize; Index1 < BufferSize; Index1++) {
-  if (Buffer2[Index1] != 0) {
-IsZero3 = FALSE;
-break;
+  for (Index1 = BufferSize - BlockSize; Index1 < BufferSize; Index1++) 
{
+if (Buffer2[Index1] != 0) {
+  IsZero3 = FALSE;
+  break;
+}
   }
-}
 
-if ((EraseStatus == EFI_SUCCESS) && (IsZero1 == FALSE) && (IsZero2 == 
TRUE) && ((IsZero3 == FALSE)))
- AssertionType = EFI_TEST_ASSERTION_PASSED;
-else
-  AssertionType = EFI_TEST_ASSERTION_FAILED;
+  if ((EraseStatus == EFI_SUCCESS) && (IsZero1 == FALSE) && (IsZero2 
== TRUE) && ((IsZero3 == FALSE)))
+   AssertionType = EFI_TEST_ASSERTION_PASSED;
+  else
+AssertionType = EFI_TEST_ASSERTION_FAILED;
 
 
-StandardLib->RecordAssertion (
-   StandardLib,
-   AssertionType,
-   gEraseBlockBBTestFunctionAssertionGuid003,
-   L"EraseBlocks - EraseBlocks for testing, the first/last 
block should not be erased",
-   L"%a:%d:EraseBlocks Status - %r, IsZero1 - %d, IsZero2 
- %d, IsZero3 - %d",
-   __FILE__,
-   (UINTN)__LINE__,
-   Status,
-   IsZero1, IsZero2, IsZero3
-   );   
+  StandardLib->RecordAssertion (
+ StandardLib,
+ AssertionType,
+ gEraseBlockBBTestFunctionAssertionGuid003,
+ L"EraseBlocks - EraseBlocks for testing, the 
first/last block should not be erased",
+ L"%a:%d:EraseBlocks Status - %r, IsZero1 - %d, 
IsZero2 - %d, IsZero3 - %d",
+ __FILE__,
+ (UINTN)__LINE__,
+ EraseStatus,
+ IsZero1, IsZero2, IsZero3
+ );   
 
+}
   }
-
   //
   // Erase Blocks with the EraseLengthGranularity blocks
   //
@@ -453,13 +455,13 @@ BlockIo2:
   //
   // Erase Blocks with non EraseLengthGranularity blocks
   //
+  if (BufferSize > 2 * BlockSize) {
+Token.Event = NULL;
+Token.TransactionStatus = EFI_NOT_READY;
 
-  Token.Event = NULL;
-  Token.TransactionStatus = EFI_NOT_READY;
-
-  

Re: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE FIX

2018-10-13 Thread Gao, Liming
https://pythonclock.org/ say Python 2.7 will not be maintained past 2020. One 
BZ https://bugzilla.tianocore.org/show_bug.cgi?id=55 also requests this 
migration. So, we migrate BaseTools to support Python3. Because Python27 will 
not be maintained, we drop Python27 support when we do Python3 migration. In 
fact, OS supports more than one python tool. In Linux or Mac OS, after you 
install Python3, you will have "python3" command to trig python3. "python" 
command to trig python2. In Windows, after you install Python3, there will be 
py -3 to trig python3, and py -2 to trig python2. You can still use python2 for 
python2 script. BaseTools will auto find python3 command to call BaseTools 
script. User only needs to install Python3. It has no impact on other project. 

Why we choose Python3.6 or above? Python3.6 is relative new python version. We 
choose it to validate BaseTools Python3 functionality. In fact, current 
BaseTools may work with Python35 or Python34. But, we don't do full validation. 
So, we don't mention them. We can do basic test for other python3 version. If 
no big block issue, we can relax this requirement. And, Python37 is new version 
that does performance optimization. We collect performance data in Windows OS, 
Python37 improves 20% performance in BaseTools AutoGen phase than Python27. 
Python36 performance is bad. It decreases 20% performance than Python27. I get 
the information that early Python3 version performance is not good. So, I 
suggest to use Python37 for better build performance.

On break issue, I admit this is our mistake. We don't verify Wiki work flow. We 
need to fix it ASAP. And, I admit Yonghong breaks patch review process. One 
patch is not reviewed in mail list and pushed. We need to strictly follow the 
process. Thank you to catch it. 

> -Original Message-
> From: af...@apple.com [mailto:af...@apple.com]
> Sent: Saturday, October 13, 2018 11:12 PM
> To: Ard Biesheuvel 
> Cc: Gao, Liming ; edk2-devel-01 
> ; Kinney, Michael D ;
> Laszlo Ersek 
> Subject: Re: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE 
> FIX
> 
> 
> 
> > On Oct 13, 2018, at 5:18 AM, Ard Biesheuvel  
> > wrote:
> >
> > On 13 October 2018 at 11:23, Gao, Liming  wrote:
> >> Ard:
> >>  I know the failure reason. . edksetup.sh must be called in edk2 before 
> >> enter BaseTools with make. edksetup.sh is used to detect the
> python3 and set PYTHON3 env. This env is used in GNUmakefile.
> >>
> >>  I don't aware this change before. Because we usually call edksetup.sh, 
> >> then make BaseTools. We will try to find the way to handle
> it.
> >>
> >
> > Thanks for diagnosing that. As Leif points out, this deviates from the
> > instructions on the wiki. It also deviates from the build script I use
> > in my CI environment, hence the breakage.
> >
> > Unfortunately, our CI environment is based on Debian Stretch, which
> > provides Python 3.5.3 only not Python 3.6 or later. I will work with
> > our infrastructure team to find out if we can support Python 3.6 as
> > well, but it will probably take time.
> >
> > What is the reason we need 3.6 or later?
> >
> 
> All the macOS based builds are broken too. Python 2.7.* comes with macOS. The 
> instructions are broken for macOS as you never had to
> install Python before.
> 
> I'm not able to install an alternate version of Python in our internal CI 
> infrastructure (You build the OS with tools from the OS). This will
> likely force me to have to check in a version of Python 3.6 into the edk2 
> tree to keep the build working, or fork off an older version of the
> build system that works with Python 2.7.*.
> 
> What problem are we solving by forcing everyone to be on Python 3.6 or later? 
> I understand on Widows you have to install Python, but a
> lot of the Unix installs you can get an older version of Python installed for 
> free.
> 
> Thanks,
> 
> Andrew Fish
> 
> >
> >>> -Original Message-
> >>> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> >>> Sent: Saturday, October 13, 2018 4:46 PM
> >>> To: Gao, Liming 
> >>> Cc: edk2-devel-01 ; Laszlo Ersek 
> >>> ; Leif Lindholm ; Kinney,
> >>> Michael D ; Zhu, Yonghong 
> >>> ; stephano.cet...@linux.intel.com
> >>> Subject: Re: [edk2] BaseTools/ build broken due to unreviewed patch - 
> >>> PLEASE FIX
> >>>
> >>> On 13 October 2018 at 10:44, Gao, Liming  wrote:
>  Ard:
>   I pull the latest edk2 code. I can find RunTests.py in BaseTools/Tests. 
>  The below error message shows RunTests.py is not found.
> But,
> >>> this file is in BaseTools/Tests. I also run Make command in BaseTools 
> >>> directory. It can work in my Ubuntu machine. I install Python37.
> Do
> >>> you install Python36 or Python37 in your machine?
> 
>   Yonghong has sent the mail to notify BaseTools Python3 migration is 
>  done. Python3.6 or the above is required.
> 
> >>>
> >>> I have python3 on my machine, yes. But that does not mean it is the
> >>> default for everyone.
> 

[edk2] [PATCH] uefi-sct/SctPkg:Fix the flaw in BBTestCreateEventEx_Func_Sub3 on certain situation. Besides AllocatePages(), CreateEventEx may cause the memorymap change itself. Enhance the test to fil

2018-10-13 Thread Eric Jin
Cc: Supreeth Venkatesh 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin 
---
 ...rTaskPriorityServicesBBTestCreateEventEx.c | 26 +++
 .../BlackBoxTest/Support.c| 19 +-
 2 files changed, 33 insertions(+), 12 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/EventTimerTaskPriorityServicesBBTestCreateEventEx.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/EventTimerTaskPriorityServicesBBTestCreateEventEx.c
index e2e173ab..25d1ed97 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/EventTimerTaskPriorityServicesBBTestCreateEventEx.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/EventTimerTaskPriorityServicesBBTestCreateEventEx.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2016 Unified EFI, Inc.
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -192,6 +192,10 @@ BBTestCreateEventEx_Func (
   BBTestCreateEventEx_Func_Sub2 (StandardLib);
 #endif
 
+  //
+  // The test for the EFI_EVENT_GROUP_MEMORY_MAP_CHANGE 
+  // This event group is notified by the system when the memory map has 
changed.
+  //
   BBTestCreateEventEx_Func_Sub3 (StandardLib);
 
   //
@@ -599,12 +603,12 @@ BBTestCreateEventEx_Func_Sub1 (
   UINTN   Buffer[MAX_TEST_EVENT_NUM + MAX_TEST_EVENT_NUM*2];
 
   //
-  // Initialize Buffer
+  // Initialize Buffer and the 0xAA is only for the Sub3 test
   //
   for (Index = 0; Index < MAX_TEST_EVENT_NUM; Index ++) {
 Buffer[Index] = Index;
-Buffer[Index + MAX_TEST_EVENT_NUM + Index] = (UINTN)(-1);
-Buffer[Index + MAX_TEST_EVENT_NUM + 1 + Index] = (UINTN)(-1);
+Buffer[Index + MAX_TEST_EVENT_NUM + Index] = (UINTN)(0xAA);
+Buffer[Index + MAX_TEST_EVENT_NUM + 1 + Index] = (UINTN)(0xAA);
   }
 
   //
@@ -755,12 +759,12 @@ BBTestCreateEventEx_Func_Sub2 (
   UINTN   Buffer[MAX_TEST_EVENT_NUM + MAX_TEST_EVENT_NUM*2];
 
   //
-  // Initialize Buffer
+  // Initialize Buffer and the 0xAA is only for the Sub3 test
   //
   for (Index = 0; Index < MAX_TEST_EVENT_NUM; Index ++) {
 Buffer[Index] = Index;
-Buffer[Index + MAX_TEST_EVENT_NUM + Index] = (UINTN)(-1);
-Buffer[Index + MAX_TEST_EVENT_NUM + 1 + Index] = (UINTN)(-1);
+Buffer[Index + MAX_TEST_EVENT_NUM + Index] = (UINTN)(0xAA);
+Buffer[Index + MAX_TEST_EVENT_NUM + 1 + Index] = (UINTN)(0xAA);
   }
 
   //
@@ -914,12 +918,12 @@ BBTestCreateEventEx_Func_Sub3 (
   UINTN   Buffer[MAX_TEST_EVENT_NUM + MAX_TEST_EVENT_NUM*2];
 
   //
-  // Initialize Buffer
+  // Initialize Buffer and the trick to initial it as 0xAA
   //
   for (Index = 0; Index < MAX_TEST_EVENT_NUM; Index ++) {
 Buffer[Index] = Index;
-Buffer[Index + MAX_TEST_EVENT_NUM + Index] = (UINTN)(-1);
-Buffer[Index + MAX_TEST_EVENT_NUM + 1 + Index] = (UINTN)(-1);
+Buffer[Index + MAX_TEST_EVENT_NUM + Index] = (UINTN)(0xAA);
+Buffer[Index + MAX_TEST_EVENT_NUM + 1 + Index] = (UINTN)(0xAA);
   }
 
   //
@@ -974,7 +978,7 @@ BBTestCreateEventEx_Func_Sub3 (
   }
   
   //
-  // Install a configuration table at TPL_NOTIFY
+  // Call AllocatePage to change the memorymap
   //
   OldTpl = gtBS->RaiseTPL (TPL_NOTIFY);
   
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/Support.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/Support.c
index aa02383e..823e16ab 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/Support.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/EventTimerTaskPriorityServices/BlackBoxTest/Support.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2010 Unified EFI, Inc.
-  Copyright (c) 2010, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -64,6 +64,23 @@ NotifyFunctionTplEx(
 
 EventIndex = Buffer[0];
 
+//
+// The special code for the sub3
+// To block possible enter triggered by CreateEventEx  
+// 
+if (EventIndex != 2 && Buffer[4] == (UINTN)(0xAA))
+  return;
+
+//
+// The special code for the sub3
+// To initial the Buffer and block the possible enter caused by the 
CloseEvent
+//
+if (EventIndex == 2 && Buffer[1] == (UINTN)(0xAA)) {
+  for (Index=1; Index<7; Index++) {
+Buffer[Index] = (UINTN)(-1);
+  }  
+}
+
 Index = 3-EventIndex;

[edk2] [PATCH] uefi-sct/SctPkg:One checkpoint in the ExtractConfigFunction need be removed

2018-10-13 Thread Eric Jin
The Results output from ExtractConfigFunction() may be different during two 
calls in some case.

Cc: Supreeth Venkatesh 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin 
---
 .../HIIConfigRouting/BlackBoxTest/Guid.c  |  4 +---
 .../HIIConfigRouting/BlackBoxTest/Guid.h  |  6 +
 .../HIIConfigRoutingBBTestFunction.c  | 23 +--
 3 files changed, 3 insertions(+), 30 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigRouting/BlackBoxTest/Guid.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigRouting/BlackBoxTest/Guid.c
index 18282f30..93265947 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigRouting/BlackBoxTest/Guid.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigRouting/BlackBoxTest/Guid.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2011 Unified EFI, Inc.
-  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -88,7 +88,5 @@ EFI_GUID gHIIConfigRoutingBBTestFunctionAssertionGuid009 = 
EFI_TEST_HIICONFIGROU
 
 EFI_GUID gHIIConfigRoutingBBTestFunctionAssertionGuid010 = 
EFI_TEST_HIICONFIGROUTINGBBTESTFUNCTION_ASSERTION_010_GUID;
 
-EFI_GUID gHIIConfigRoutingBBTestFunctionAssertionGuid011 = 
EFI_TEST_HIICONFIGROUTINGBBTESTFUNCTION_ASSERTION_011_GUID;
-
 EFI_GUID gHIIConfigRoutingBBTestFunctionAssertionGuid012 = 
EFI_TEST_HIICONFIGROUTINGBBTESTFUNCTION_ASSERTION_012_GUID;
 
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigRouting/BlackBoxTest/Guid.h
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigRouting/BlackBoxTest/Guid.h
index 97e257e7..7ade1a0f 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigRouting/BlackBoxTest/Guid.h
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigRouting/BlackBoxTest/Guid.h
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2011 Unified EFI, Inc.
-  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -180,10 +180,6 @@ extern EFI_GUID 
gHIIConfigRoutingBBTestFunctionAssertionGuid009;
 
 extern EFI_GUID gHIIConfigRoutingBBTestFunctionAssertionGuid010;
 
-#define EFI_TEST_HIICONFIGROUTINGBBTESTFUNCTION_ASSERTION_011_GUID \
-{ 0xf91ef5f3, 0xe0c6, 0x4aca, { 0xa0, 0xd0, 0x5, 0xf9, 0xb1, 0x6a, 0x13, 0xbd 
} }
-
-extern EFI_GUID gHIIConfigRoutingBBTestFunctionAssertionGuid011;
 
 #define EFI_TEST_HIICONFIGROUTINGBBTESTFUNCTION_ASSERTION_012_GUID \
 { 0xf732d246, 0x9fa5, 0x4ed3, { 0x88, 0x95, 0x28, 0x63, 0xba, 0xf4, 0x68, 0x5d 
} }
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigRouting/BlackBoxTest/HIIConfigRoutingBBTestFunction.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigRouting/BlackBoxTest/HIIConfigRoutingBBTestFunction.c
index 5eed6c6c..d4bd23d1 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigRouting/BlackBoxTest/HIIConfigRoutingBBTestFunction.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigRouting/BlackBoxTest/HIIConfigRoutingBBTestFunction.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2016 Unified EFI, Inc.
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -418,27 +418,6 @@ BBTestExtractConfigFunctionTestCheckpoint1 (
  Status
  );
 
-  // 
-  // Since ExtractConfig may not append  at string tail.  
-  // We check whether Results is a substring of MultiConfigAltResp from 
ExportConfig 
-  //
-  if (Status == EFI_SUCCESS && (SctStrStr (MultiConfigAltResp, Results) != 
NULL)) {
-AssertionType = EFI_TEST_ASSERTION_PASSED;
-  } else if (EFI_OUT_OF_RESOURCES == Status){
-AssertionType = EFI_TEST_ASSERTION_WARNING;
-  } else {
-AssertionType = EFI_TEST_ASSERTION_FAILED;
-  }
-  StandardLib->RecordAssertion (
- StandardLib,
- AssertionType,
- gHIIConfigRoutingBBTestFunctionAssertionGuid011,
- L"HII_CONFIG_ROUTING_PROTOCOL.ExtractConfig - ExtractConfig() 
Check if Results is in  format.",
- L"%a:%d:",
- __FILE__,
- (UINTN)__LINE__
- );
-
 FUNC_EXIT:
 
   if (Request != NULL) {
-- 
2.18.0.windows.1

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


[edk2] [PATCH] uefi-sct/SctPkg:Add conformance test cases for deprecated EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS attribute.

2018-10-13 Thread Eric Jin
Cc: Supreeth Venkatesh 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin 
---
 .../AuthVariableServicesBBTestConformance.c   | 143 ++
 .../VariableServices/BlackBoxTest/Guid.c  |   6 +-
 .../VariableServices/BlackBoxTest/Guid.h  |  11 +-
 3 files changed, 132 insertions(+), 28 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
index 05281054..a1d1c4c3 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/AuthVariableServicesBBTestConformance.c
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright 2006 - 2012 Unified EFI, Inc.
-  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 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
@@ -151,6 +151,44 @@ AuthVariableDERConfTest (
   EFI_TEST_LOGGING_LIBRARY_PROTOCOL   *LoggingLib;
   UINT32  Attr;
   EFI_TEST_ASSERTION  Result;
+  UINTN   Index;
+  UINTN   MaximumVariableStorageSize;
+  UINTN   RemainingVariableStorageSize;
+  UINTN   MaximumVariableSize;
+  UINT32  AttrArray[] = {
+//
+//  For 1 attribute.
+//
+EFI_VARIABLE_NON_VOLATILE,
+EFI_VARIABLE_RUNTIME_ACCESS,
+EFI_VARIABLE_BOOTSERVICE_ACCESS,
+EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+
+//
+//  For 2 attributes.
+//
+EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS,
+EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
+EFI_VARIABLE_NON_VOLATILE | 
EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+
+EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
+EFI_VARIABLE_RUNTIME_ACCESS | 
EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+
+EFI_VARIABLE_BOOTSERVICE_ACCESS | 
EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+
+//
+//  For 3 attributes.
+//
+EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | 
EFI_VARIABLE_BOOTSERVICE_ACCESS,
+EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | 
EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | 
EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS | 
EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+
+//
+//  For 4 attributes.
+//
+EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | 
EFI_VARIABLE_BOOTSERVICE_ACCESS | 
EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS,
+  };
 
   Status = GetTestSupportLibrary (
  SupportHandle,
@@ -192,33 +230,86 @@ AuthVariableDERConfTest (
  Status
  );
 
-  Attr = EFI_VARIABLE_NON_VOLATILE | 
- EFI_VARIABLE_RUNTIME_ACCESS | 
- EFI_VARIABLE_BOOTSERVICE_ACCESS |
- EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS;
+  for (Index = 0; Index < sizeof (AttrArray) / sizeof (AttrArray[0]); Index = 
Index + 1) {
+Attr = AttrArray[Index];
+Attr |= EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS;
+
+Status = RT->SetVariable (
+   L"AuthVarDER",
+   ,
+   Attr,
+   sizeof (mValidAuthVarDERCreate),
+   (VOID *) mValidAuthVarDERCreate
+   );
+if (Status == EFI_UNSUPPORTED) {
+  Result = EFI_TEST_ASSERTION_PASSED;
+} else {
+  Result = EFI_TEST_ASSERTION_FAILED;
+}
+
+StandardLib->RecordAssertion (
+   StandardLib,
+   Result,
+   gVariableServicesBbTestConformanceAssertionGuid020,
+   L"RT.SetVariable - Set Auth Variable with valid cert.",
+   L"Attributes = Array[%d]. %a:%d:Status - %r",
+   Index,
+   __FILE__,
+   (UINTN)__LINE__,
+   Status
+   );
+
+Status = RT->SetVariable (
+   L"AuthVarDER",
+   ,
+   Attr,
+   sizeof (mInvalidAuthVarDERCreate),
+   (VOID *) mInvalidAuthVarDERCreate
+   );
+if (Status == EFI_UNSUPPORTED) {
+  Result = EFI_TEST_ASSERTION_PASSED;
+} else {
+  Result = EFI_TEST_ASSERTION_FAILED;
+}
+
+StandardLib->RecordAssertion (
+   StandardLib,
+  

Re: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE FIX

2018-10-13 Thread Andrew Fish



> On Oct 13, 2018, at 5:18 AM, Ard Biesheuvel  wrote:
> 
> On 13 October 2018 at 11:23, Gao, Liming  wrote:
>> Ard:
>>  I know the failure reason. . edksetup.sh must be called in edk2 before 
>> enter BaseTools with make. edksetup.sh is used to detect the python3 and set 
>> PYTHON3 env. This env is used in GNUmakefile.
>> 
>>  I don't aware this change before. Because we usually call edksetup.sh, then 
>> make BaseTools. We will try to find the way to handle it.
>> 
> 
> Thanks for diagnosing that. As Leif points out, this deviates from the
> instructions on the wiki. It also deviates from the build script I use
> in my CI environment, hence the breakage.
> 
> Unfortunately, our CI environment is based on Debian Stretch, which
> provides Python 3.5.3 only not Python 3.6 or later. I will work with
> our infrastructure team to find out if we can support Python 3.6 as
> well, but it will probably take time.
> 
> What is the reason we need 3.6 or later?
> 

All the macOS based builds are broken too. Python 2.7.* comes with macOS. The 
instructions are broken for macOS as you never had to install Python before. 

I'm not able to install an alternate version of Python in our internal CI 
infrastructure (You build the OS with tools from the OS). This will likely 
force me to have to check in a version of Python 3.6 into the edk2 tree to keep 
the build working, or fork off an older version of the build system that works 
with Python 2.7.*. 

What problem are we solving by forcing everyone to be on Python 3.6 or later? I 
understand on Widows you have to install Python, but a lot of the Unix installs 
you can get an older version of Python installed for free. 

Thanks,

Andrew Fish

> 
>>> -Original Message-
>>> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
>>> Sent: Saturday, October 13, 2018 4:46 PM
>>> To: Gao, Liming 
>>> Cc: edk2-devel-01 ; Laszlo Ersek 
>>> ; Leif Lindholm ; Kinney,
>>> Michael D ; Zhu, Yonghong 
>>> ; stephano.cet...@linux.intel.com
>>> Subject: Re: [edk2] BaseTools/ build broken due to unreviewed patch - 
>>> PLEASE FIX
>>> 
>>> On 13 October 2018 at 10:44, Gao, Liming  wrote:
 Ard:
  I pull the latest edk2 code. I can find RunTests.py in BaseTools/Tests. 
 The below error message shows RunTests.py is not found. But,
>>> this file is in BaseTools/Tests. I also run Make command in BaseTools 
>>> directory. It can work in my Ubuntu machine. I install Python37. Do
>>> you install Python36 or Python37 in your machine?
 
  Yonghong has sent the mail to notify BaseTools Python3 migration is done. 
 Python3.6 or the above is required.
 
>>> 
>>> I have python3 on my machine, yes. But that does not mean it is the
>>> default for everyone.
>>> 
>>> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
> Ard Biesheuvel
> Sent: Saturday, October 13, 2018 4:18 PM
> To: edk2-devel-01 ; Gao, Liming 
> ; Laszlo Ersek ; Leif
>>> Lindholm
> ; Kinney, Michael D 
> ; Zhu, Yonghong ;
> stephano.cet...@linux.intel.com
> Subject: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE 
> FIX
> 
> Commit ea787b6b55499e8f931201f8f49daaaeb2e4409f
> 
>  "BaseTools: update Test scripts support python3"
> 
> [which has never been sent out for review to the mailing list, as far
> as I can tell] is breaking the BaseTools build
> 
> make -C Tests
> make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
> /bin/sh: 1: RunTests.py: not found
> GNUmakefile:17: recipe for target 'test' failed
> make[1]: *** [test] Error 127
> make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
> GNUmakefile:25: recipe for target 'Tests' failed
> make: *** [Tests] Error 2
> make: Leaving directory '/home/ard/build/edk2/BaseTools'
> 
> I tried reverting that patch alone, but that gives me
> 
> make -C Tests
> make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
> Traceback (most recent call last):
>  File "RunTests.py", line 36, in 
>allTests = GetAllTestsSuite()
>  File "RunTests.py", line 33, in GetAllTestsSuite
>return unittest.TestSuite([GetCTestSuite(), GetPythonTestSuite()])
>  File "RunTests.py", line 30, in GetPythonTestSuite
>return PythonToolsTests.TheTestSuite()
>  File "/home/ard/build/edk2/BaseTools/Tests/PythonToolsTests.py",
> line 27, in TheTestSuite
>import CheckUnicodeSourceFiles
>  File "/home/ard/build/edk2/BaseTools/Tests/CheckUnicodeSourceFiles.py",
> line 25, in 
>from Common.Misc import PathClass
>  File "/home/ard/build/edk2/BaseTools/Source/Python/Common/Misc.py",
> line 27, in 
>from collections import UserDict as IterableUserDict
> ImportError: cannot import name UserDict
> GNUmakefile:17: recipe for target 'test' failed
> make[1]: *** [test] 

[edk2] Does edk2 still support python 2?

2018-10-13 Thread Chen, Farrah
Hello,

When we make edk2 "OvmfPkg/build.sh -a X64 -n 16", we met below error:

[vmm@vmm-build edk2]$ OvmfPkg/build.sh -a X64 -n 16
Initializing workspace
/home/fan/edk2/BaseTools
Loading previous configuration from /home/fan/edk2/Conf/BuildEnv.sh
WORKSPACE: /home/fan/edk2
EDK_TOOLS_PATH: /home/fan/edk2/BaseTools
CONF_PATH: /home/fan/edk2/Conf

ERROR!!!, python version should greater than or equal to version 3.6.

Does edk2 still support python 2? How can we make edk2 with python 2? Or we 
must update the python version to python 3.6?


Thanks,
Fan

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


Re: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE FIX

2018-10-13 Thread Ard Biesheuvel
On 13 October 2018 at 11:23, Gao, Liming  wrote:
> Ard:
>   I know the failure reason. . edksetup.sh must be called in edk2 before 
> enter BaseTools with make. edksetup.sh is used to detect the python3 and set 
> PYTHON3 env. This env is used in GNUmakefile.
>
>   I don't aware this change before. Because we usually call edksetup.sh, then 
> make BaseTools. We will try to find the way to handle it.
>

Thanks for diagnosing that. As Leif points out, this deviates from the
instructions on the wiki. It also deviates from the build script I use
in my CI environment, hence the breakage.

Unfortunately, our CI environment is based on Debian Stretch, which
provides Python 3.5.3 only not Python 3.6 or later. I will work with
our infrastructure team to find out if we can support Python 3.6 as
well, but it will probably take time.

What is the reason we need 3.6 or later?


>> -Original Message-
>> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
>> Sent: Saturday, October 13, 2018 4:46 PM
>> To: Gao, Liming 
>> Cc: edk2-devel-01 ; Laszlo Ersek 
>> ; Leif Lindholm ; Kinney,
>> Michael D ; Zhu, Yonghong 
>> ; stephano.cet...@linux.intel.com
>> Subject: Re: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE 
>> FIX
>>
>> On 13 October 2018 at 10:44, Gao, Liming  wrote:
>> > Ard:
>> >   I pull the latest edk2 code. I can find RunTests.py in BaseTools/Tests. 
>> > The below error message shows RunTests.py is not found. But,
>> this file is in BaseTools/Tests. I also run Make command in BaseTools 
>> directory. It can work in my Ubuntu machine. I install Python37. Do
>> you install Python36 or Python37 in your machine?
>> >
>> >   Yonghong has sent the mail to notify BaseTools Python3 migration is 
>> > done. Python3.6 or the above is required.
>> >
>>
>> I have python3 on my machine, yes. But that does not mean it is the
>> default for everyone.
>>
>>
>> >> -Original Message-
>> >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
>> >> Ard Biesheuvel
>> >> Sent: Saturday, October 13, 2018 4:18 PM
>> >> To: edk2-devel-01 ; Gao, Liming 
>> >> ; Laszlo Ersek ; Leif
>> Lindholm
>> >> ; Kinney, Michael D 
>> >> ; Zhu, Yonghong ;
>> >> stephano.cet...@linux.intel.com
>> >> Subject: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE 
>> >> FIX
>> >>
>> >> Commit ea787b6b55499e8f931201f8f49daaaeb2e4409f
>> >>
>> >>   "BaseTools: update Test scripts support python3"
>> >>
>> >> [which has never been sent out for review to the mailing list, as far
>> >> as I can tell] is breaking the BaseTools build
>> >>
>> >> make -C Tests
>> >> make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
>> >> /bin/sh: 1: RunTests.py: not found
>> >> GNUmakefile:17: recipe for target 'test' failed
>> >> make[1]: *** [test] Error 127
>> >> make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
>> >> GNUmakefile:25: recipe for target 'Tests' failed
>> >> make: *** [Tests] Error 2
>> >> make: Leaving directory '/home/ard/build/edk2/BaseTools'
>> >>
>> >> I tried reverting that patch alone, but that gives me
>> >>
>> >> make -C Tests
>> >> make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
>> >> Traceback (most recent call last):
>> >>   File "RunTests.py", line 36, in 
>> >> allTests = GetAllTestsSuite()
>> >>   File "RunTests.py", line 33, in GetAllTestsSuite
>> >> return unittest.TestSuite([GetCTestSuite(), GetPythonTestSuite()])
>> >>   File "RunTests.py", line 30, in GetPythonTestSuite
>> >> return PythonToolsTests.TheTestSuite()
>> >>   File "/home/ard/build/edk2/BaseTools/Tests/PythonToolsTests.py",
>> >> line 27, in TheTestSuite
>> >> import CheckUnicodeSourceFiles
>> >>   File "/home/ard/build/edk2/BaseTools/Tests/CheckUnicodeSourceFiles.py",
>> >> line 25, in 
>> >> from Common.Misc import PathClass
>> >>   File "/home/ard/build/edk2/BaseTools/Source/Python/Common/Misc.py",
>> >> line 27, in 
>> >> from collections import UserDict as IterableUserDict
>> >> ImportError: cannot import name UserDict
>> >> GNUmakefile:17: recipe for target 'test' failed
>> >> make[1]: *** [test] Error 1
>> >> make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
>> >> GNUmakefile:25: recipe for target 'Tests' failed
>> >> make: *** [Tests] Error 2
>> >> make: Leaving directory '/home/ard/build/edk2/BaseTools'
>> >>
>> >> Breaking the build for everyone with an unreviewed patch 2 days before
>> >> the plugfest is NOT OK.
>> >>
>> >> Please fix or revert ASAP
>> >>
>> >> (I suppose that the failing test is a false negative in this case, but
>> >> that is not really the point - my CI jobs are broken due to this and
>> >> so are many others, I imagine)
>> >> ___
>> >> 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

Re: [edk2] [PATCH v1 2/6] PcAtChipsetPkg: Add MMIO Support to RTC driver

2018-10-13 Thread Leif Lindholm
On Fri, Oct 12, 2018 at 03:40:05PM +0100, Sami Mujawar wrote:
> Some virtual machine managers like kvmtool emulate the MC146818
> RTC controller in the MMIO space so that architectures that do
> not support I/O Mapped I/O can use the RTC. This patch adds MMIO
> support to the RTC controller driver.
> 
> The PCD PcdRtcUseMmio has been added to select I/O or MMIO support.
>   If PcdRtcUseMmio is:
> TRUE  - Indicates the RTC port registers are in MMIO space.
> FALSE - Indicates the RTC port registers are in I/O space.
> Default is I/O space.
> 
> When MMIO support is selected (PcdRtcUseMmio == TRUE) the driver
> maps the MMIO region used by the RTC as runtime memory so that the
> RTC registers are accessible post ExitBootServices.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Sami Mujawar 
> ---
> The changes can be seen at 
> https://github.com/samimujawar/edk2/commit/d9fa7df2204c12883a795c7df429578c310725bf
> 
> Notes:
> v1:
> - Add support to read/write from RTC registers using MMIO access  [SAMI]
> 
>  PcAtChipsetPkg/PcAtChipsetPkg.dec  | 
>   8 ++
>  PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c | 
>  38 ++-
>  PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c| 
> 112 +++-
>  PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf | 
>   8 ++
>  4 files changed, 162 insertions(+), 4 deletions(-)
> 
> diff --git a/PcAtChipsetPkg/PcAtChipsetPkg.dec 
> b/PcAtChipsetPkg/PcAtChipsetPkg.dec
> index 
> 0e66ff0ba3770cf765cfe36d592151d72eaa238a..5aaf5e73811c4dba3b83768f1535e028938ead1f
>  100644
> --- a/PcAtChipsetPkg/PcAtChipsetPkg.dec
> +++ b/PcAtChipsetPkg/PcAtChipsetPkg.dec
> @@ -6,6 +6,7 @@
>  #
>  # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
>  # Copyright (c) 2017, AMD Inc. All rights reserved.
> +# Copyright (c) 2018, ARM Limited. All rights reserved.
>  #
>  # This program and the accompanying materials
>  # are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -202,5 +203,12 @@ [PcdsFixedAtBuild, PcdsPatchableInModule]
># @Prompt RTC Target Register address
>gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister|0x71|UINT8|0x001F
>  
> +  ## Indicates the RTC port registers are in MMIO space, or in I/O space.
> +  #  Default is I/O space.
> +  #   TRUE  - RTC port registers are in MMIO space.
> +  #   FALSE - RTC port registers are in I/O space.
> +  # @Prompt RTC port registers use MMIO.
> +  gPcAtChipsetPkgTokenSpaceGuid.PcdRtcUseMmio|FALSE|BOOLEAN|0x0020
> +
>  [UserExtensions.TianoCore."ExtraFiles"]
>PcAtChipsetPkgExtra.uni
> diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c 
> b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
> index 
> 7965eb8aa55b92caef7a63834695506123935e2d..ee746add57b9778bf09a4d9eb6881d06caa14aba
>  100644
> --- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
> +++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
> @@ -3,6 +3,7 @@
>  
>  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
>  Copyright (c) 2017, AMD Inc. All rights reserved.
> +Copyright (c) 2018, ARM Limited. All rights reserved.
>  
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -16,6 +17,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
> EXPRESS OR IMPLIED.
>  
>  #include "PcRtc.h"
>  
> +extern EFI_PHYSICAL_ADDRESS   mRtcRegisterBase;
> +
>  //
>  // Days of month.
>  //
> @@ -72,7 +75,21 @@ RtcRead (
>IN  UINT8 Address
>)
>  {
> -  IoWrite8 (PcdGet8 (PcdRtcIndexRegister), (UINT8) (Address | (UINT8) 
> (IoRead8 (PcdGet8 (PcdRtcIndexRegister)) & 0x80)));
> +  if (FixedPcdGetBool (PcdRtcUseMmio)) {
> +MmioWrite8 (
> +  mRtcRegisterBase,
> +  (UINT8)(Address | (UINT8)(MmioRead8 (mRtcRegisterBase) & 0x80))
> +  );
> +return MmioRead8 (
> + mRtcRegisterBase + (PcdGet8 (PcdRtcTargetRegister) -
> +   PcdGet8 (PcdRtcIndexRegister))
> + );
> +  }
> +
> +  IoWrite8 (
> +PcdGet8 (PcdRtcIndexRegister),
> +(UINT8)(Address | (UINT8)(IoRead8 (PcdGet8 (PcdRtcIndexRegister)) & 
> 0x80))
> +);
>return IoRead8 (PcdGet8 (PcdRtcTargetRegister));

So, this isn't my package, but I would much rather see this solved
with local (STATIC) wrapper functions (i.e. RtcRead*/RtcWrite*) for
the accessors instead of conditionalising which one to use at every
call site.

/
Leif

>  }
>  
> @@ -90,8 +107,23 @@ RtcWrite (
>IN  UINT8   Data
>)
>  {
> -  IoWrite8 (PcdGet8 (PcdRtcIndexRegister), (UINT8) (Address | (UINT8) 
> (IoRead8 (PcdGet8 (PcdRtcIndexRegister)) & 0x80)));
> -  IoWrite8 (PcdGet8 (PcdRtcTargetRegister), Data);
> +  if (FixedPcdGetBool (PcdRtcUseMmio)) {
> +MmioWrite8 (
> +  mRtcRegisterBase,
> +  (UINT8)(Address 

Re: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE FIX

2018-10-13 Thread Gao, Liming
Ard:
  I know the failure reason. . edksetup.sh must be called in edk2 before enter 
BaseTools with make. edksetup.sh is used to detect the python3 and set PYTHON3 
env. This env is used in GNUmakefile.

  I don't aware this change before. Because we usually call edksetup.sh, then 
make BaseTools. We will try to find the way to handle it. 

Thanks
Liming
> -Original Message-
> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> Sent: Saturday, October 13, 2018 4:46 PM
> To: Gao, Liming 
> Cc: edk2-devel-01 ; Laszlo Ersek 
> ; Leif Lindholm ; Kinney,
> Michael D ; Zhu, Yonghong 
> ; stephano.cet...@linux.intel.com
> Subject: Re: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE 
> FIX
> 
> On 13 October 2018 at 10:44, Gao, Liming  wrote:
> > Ard:
> >   I pull the latest edk2 code. I can find RunTests.py in BaseTools/Tests. 
> > The below error message shows RunTests.py is not found. But,
> this file is in BaseTools/Tests. I also run Make command in BaseTools 
> directory. It can work in my Ubuntu machine. I install Python37. Do
> you install Python36 or Python37 in your machine?
> >
> >   Yonghong has sent the mail to notify BaseTools Python3 migration is done. 
> > Python3.6 or the above is required.
> >
> 
> I have python3 on my machine, yes. But that does not mean it is the
> default for everyone.
> 
> 
> >> -Original Message-
> >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ard 
> >> Biesheuvel
> >> Sent: Saturday, October 13, 2018 4:18 PM
> >> To: edk2-devel-01 ; Gao, Liming 
> >> ; Laszlo Ersek ; Leif
> Lindholm
> >> ; Kinney, Michael D 
> >> ; Zhu, Yonghong ;
> >> stephano.cet...@linux.intel.com
> >> Subject: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE 
> >> FIX
> >>
> >> Commit ea787b6b55499e8f931201f8f49daaaeb2e4409f
> >>
> >>   "BaseTools: update Test scripts support python3"
> >>
> >> [which has never been sent out for review to the mailing list, as far
> >> as I can tell] is breaking the BaseTools build
> >>
> >> make -C Tests
> >> make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
> >> /bin/sh: 1: RunTests.py: not found
> >> GNUmakefile:17: recipe for target 'test' failed
> >> make[1]: *** [test] Error 127
> >> make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
> >> GNUmakefile:25: recipe for target 'Tests' failed
> >> make: *** [Tests] Error 2
> >> make: Leaving directory '/home/ard/build/edk2/BaseTools'
> >>
> >> I tried reverting that patch alone, but that gives me
> >>
> >> make -C Tests
> >> make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
> >> Traceback (most recent call last):
> >>   File "RunTests.py", line 36, in 
> >> allTests = GetAllTestsSuite()
> >>   File "RunTests.py", line 33, in GetAllTestsSuite
> >> return unittest.TestSuite([GetCTestSuite(), GetPythonTestSuite()])
> >>   File "RunTests.py", line 30, in GetPythonTestSuite
> >> return PythonToolsTests.TheTestSuite()
> >>   File "/home/ard/build/edk2/BaseTools/Tests/PythonToolsTests.py",
> >> line 27, in TheTestSuite
> >> import CheckUnicodeSourceFiles
> >>   File "/home/ard/build/edk2/BaseTools/Tests/CheckUnicodeSourceFiles.py",
> >> line 25, in 
> >> from Common.Misc import PathClass
> >>   File "/home/ard/build/edk2/BaseTools/Source/Python/Common/Misc.py",
> >> line 27, in 
> >> from collections import UserDict as IterableUserDict
> >> ImportError: cannot import name UserDict
> >> GNUmakefile:17: recipe for target 'test' failed
> >> make[1]: *** [test] Error 1
> >> make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
> >> GNUmakefile:25: recipe for target 'Tests' failed
> >> make: *** [Tests] Error 2
> >> make: Leaving directory '/home/ard/build/edk2/BaseTools'
> >>
> >> Breaking the build for everyone with an unreviewed patch 2 days before
> >> the plugfest is NOT OK.
> >>
> >> Please fix or revert ASAP
> >>
> >> (I suppose that the failing test is a false negative in this case, but
> >> that is not really the point - my CI jobs are broken due to this and
> >> so are many others, I imagine)
> >> ___
> >> 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] BaseTools/ build broken due to unreviewed patch - PLEASE FIX

2018-10-13 Thread Leif Lindholm
Liming,

The fact that the set includes unreviewed patches[1] should be
sufficient argument for reverting it immediately.

[1] ea787b6b55499e8f931201f8f49daaaeb2e4409f

But beyond that, a set this invasive should only ever be pushed
in the days after a stable tag has been created - not 2/3 through the
period.

This particular one breaks builds using the instructions from
https://github.com/tianocore/tianocore.github.io/wiki/Common-instructions

With the new set, it is mandatory that edksetup.sh is sourced before
building BaseTools. That was not previously the case, meaning existing
CI jobs following the documentation example now fail.

Please revert this set for now. We can revisit and plan a suitable way
forward after that.

Regards,

Leif

On Sat, Oct 13, 2018 at 08:44:39AM +, Gao, Liming wrote:
> Ard:
>   I pull the latest edk2 code. I can find RunTests.py in
>   BaseTools/Tests. The below error message shows RunTests.py is not
>   found. But, this file is in BaseTools/Tests. I also run Make
>   command in BaseTools directory. It can work in my Ubuntu
>   machine. I install Python37. Do you install Python36 or Python37
>   in your machine?
>   
>   Yonghong has sent the mail to notify BaseTools Python3 migration
>   is done. Python3.6 or the above is required.
>   
> 
> Thanks
> Liming
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ard 
> > Biesheuvel
> > Sent: Saturday, October 13, 2018 4:18 PM
> > To: edk2-devel-01 ; Gao, Liming 
> > ; Laszlo Ersek ; Leif Lindholm
> > ; Kinney, Michael D ; 
> > Zhu, Yonghong ;
> > stephano.cet...@linux.intel.com
> > Subject: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE FIX
> > 
> > Commit ea787b6b55499e8f931201f8f49daaaeb2e4409f
> > 
> >   "BaseTools: update Test scripts support python3"
> > 
> > [which has never been sent out for review to the mailing list, as far
> > as I can tell] is breaking the BaseTools build
> > 
> > make -C Tests
> > make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
> > /bin/sh: 1: RunTests.py: not found
> > GNUmakefile:17: recipe for target 'test' failed
> > make[1]: *** [test] Error 127
> > make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
> > GNUmakefile:25: recipe for target 'Tests' failed
> > make: *** [Tests] Error 2
> > make: Leaving directory '/home/ard/build/edk2/BaseTools'
> > 
> > I tried reverting that patch alone, but that gives me
> > 
> > make -C Tests
> > make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
> > Traceback (most recent call last):
> >   File "RunTests.py", line 36, in 
> > allTests = GetAllTestsSuite()
> >   File "RunTests.py", line 33, in GetAllTestsSuite
> > return unittest.TestSuite([GetCTestSuite(), GetPythonTestSuite()])
> >   File "RunTests.py", line 30, in GetPythonTestSuite
> > return PythonToolsTests.TheTestSuite()
> >   File "/home/ard/build/edk2/BaseTools/Tests/PythonToolsTests.py",
> > line 27, in TheTestSuite
> > import CheckUnicodeSourceFiles
> >   File "/home/ard/build/edk2/BaseTools/Tests/CheckUnicodeSourceFiles.py",
> > line 25, in 
> > from Common.Misc import PathClass
> >   File "/home/ard/build/edk2/BaseTools/Source/Python/Common/Misc.py",
> > line 27, in 
> > from collections import UserDict as IterableUserDict
> > ImportError: cannot import name UserDict
> > GNUmakefile:17: recipe for target 'test' failed
> > make[1]: *** [test] Error 1
> > make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
> > GNUmakefile:25: recipe for target 'Tests' failed
> > make: *** [Tests] Error 2
> > make: Leaving directory '/home/ard/build/edk2/BaseTools'
> > 
> > Breaking the build for everyone with an unreviewed patch 2 days before
> > the plugfest is NOT OK.
> > 
> > Please fix or revert ASAP
> > 
> > (I suppose that the failing test is a false negative in this case, but
> > that is not really the point - my CI jobs are broken due to this and
> > so are many others, I imagine)
> > ___
> > 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 v1 3/6] MdeModulePkg: Map persistent (NV) memory

2018-10-13 Thread Zeng, Star
Hi Sami,

Thanks for the patch.
I just checked this patch and roughly checked [PATCH v1 5/6] ArmVirtPkg: Add 
kvmtool platform driver.

I would like to suggest that the code added in this patch to be moved into 
KvmtoolPlatformDxe which is added by [PATCH v1 5/6] as KvmtoolPlatformDxe is 
the producer of KvmtoolPlatformDxe and has full knowledge to that memory usage.



Thanks,
Star
-Original Message-
From: Sami Mujawar [mailto:sami.muja...@arm.com] 
Sent: Friday, October 12, 2018 10:40 PM
To: edk2-devel@lists.01.org
Cc: ard.biesheu...@linaro.org; leif.lindh...@linaro.org; Zeng, Star 
; Wang, Jian J ; Ni, Ruiyu 
; evan.ll...@arm.com; matteo.carl...@arm.com; 
stephanie.hughes-f...@arm.com; n...@arm.com
Subject: [PATCH v1 3/6] MdeModulePkg: Map persistent (NV) memory

Some platforms are able to preserve a memory range across system resets. This 
memory can be used for the Non-Volatile variables storage. The 
PcdEmuVariableNvStoreReserved is used to specify this option.

This patch enables mapping of this Non-Volatile memory range as runtime memory 
so that the variable storage is accessible post ExitBootServices.

Also added PcdMapEmuVariableNvStoreReserved to select if the memory region 
described by PcdMapEmuVariableNvStoreReserved should be mapped by the Variable 
Emulation driver.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
The changes can be seen at 
https://github.com/samimujawar/edk2/commit/a4fbf2336578546031920337239f41544a3a130e

Notes:
v1:
- Add support for mapping memory used for Non-Volatile variable   [SAMI]
  storage as runtime memory.

 MdeModulePkg/MdeModulePkg.dec   |  9 
+++
 MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c | 77 
+++-
 MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf |  6 ++
 3 files changed, 90 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec 
index 
6037504fa789d4ca96d45bf3a776dd77bc17a909..077d3682371e1d44b0c86f922f80536080403e52
 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -8,6 +8,7 @@
 # (C) Copyright 2016 Hewlett Packard Enterprise Development LP  # 
Copyright (c) 2017, AMD Incorporated. All rights reserved.  # Copyright (c) 
2016, Microsoft Corporation
+# Copyright (c) 2018, ARM Limited. All rights reserved.
 # This program and the accompanying materials are licensed and made available 
under  # the terms and conditions of the BSD License that accompanies this 
distribution.
 # The full text of the license may be found at @@ -1592,6 +1593,14 @@ 
[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   # @Prompt Reserved memory range for EMU variable NV storage.
   
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0|UINT64|0x4008
 
+  ## Indicates if the reserved memory range for the EMU Variable 
+ driver's  #  NV Variable Store should be mapped by the driver. The 
+ memory range size  #  must be PcdVariableStoreSize.
+  #   TRUE  - Map the memory as persistent runtime memory.
+  #   FALSE - Do not map the memory.
+  # @Prompt Map persistent memory range for EMU variable NV storage.
+  
+ gEfiMdeModulePkgTokenSpaceGuid.PcdMapEmuVariableNvStoreReserved|FALSE|
+ BOOLEAN|0x400f
+
   ## This PCD defines the times to print hello world string.
   #  This PCD is a sample to explain UINT32 PCD usage.
   # @Prompt HellowWorld print times.
diff --git a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c 
b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
index 
1bcf931b96a670ab1fc66cd66f9d88d68f363e7f..e103a340aea9394d9ff146efa5581d3180c45035
 100644
--- a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
+++ b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
@@ -4,6 +4,7 @@
   The nonvolatile variable space doesn't exist.
 
 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2018, ARM Limited. All rights reserved.
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at @@ -14,6 +15,8 @@ 
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 **/
 
+#include 
+
 #include "Variable.h"
 
 ///
@@ -1643,11 +1646,13 @@ EmuQueryVariableInfo (
 
   This function allocates memory space for variable store area and initializes 
its attributes.
 
+  @param  ImageHandleThe Image handle of this driver.
   @param  VolatileStore  Indicates if the variable store is volatile.
 
 **/
 EFI_STATUS
 InitializeVariableStore (
+  IN  EFI_HANDLEImageHandle,
   IN  BOOLEAN   VolatileStore
   )
 {
@@ -1693,6 +1698,74 @@ InitializeVariableStore (
 VariableStore =
   (VARIABLE_STORE_HEADER *)(VOID*)(UINTN)
 PcdGet64 

[edk2] PACKAGES_PATH in !include path in Dsc files

2018-10-13 Thread Pankaj Bansal
Hello All,

I am trying to add this functionality that we can specify PACKAGES_PATH in 
!include path in Dsc files just like we can specify WORKSPACE.
I did below changes for it:

--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -1530,6 +1530,7 @@ class DscParser(MetaFileParser):
 # Allow using system environment variables  in path after !include
 #
 __IncludeMacros['WORKSPACE'] = 
GlobalData.gGlobalDefines['WORKSPACE']
+__IncludeMacros['PACKAGES_PATH'] = 
GlobalData.gGlobalDefines['PACKAGES_PATH']^M
 if "ECP_SOURCE" in GlobalData.gGlobalDefines:
 __IncludeMacros['ECP_SOURCE'] = 
GlobalData.gGlobalDefines['ECP_SOURCE']
 #
diff --git a/BaseTools/Source/Python/build/build.py 
b/BaseTools/Source/Python/build/build.py
index d74082fc26..61dce3a856 100644
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -197,6 +197,7 @@ def CheckEnvVariable():
 GlobalData.gEcpSource = EcpSourceDir

 GlobalData.gGlobalDefines["WORKSPACE"]  = WorkspaceDir
+GlobalData.gGlobalDefines["PACKAGES_PATH"]  = PackagesPath^M
 GlobalData.gGlobalDefines["EFI_SOURCE"] = EfiSourceDir
 GlobalData.gGlobalDefines["EDK_SOURCE"] = EdkSourceDir
 GlobalData.gGlobalDefines["ECP_SOURCE"] = EcpSourceDir

With these changes the compilation starts OK, but I get this error later on:

GenFds.py...
: error C0DE: Tools code failure
Please send email to edk2-devel@lists.01.org for help, attaching 
following call stack trace!

Traceback (most recent call last):
  File "/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/GenFds/GenFds.py", 
line 246, in main
TargetArchList = 
set(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, TAB_COMMON, 
Options.BuildTarget, Options.ToolChain].SupArchList) & set(ArchList)
  File 
"/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py",
 line 132, in __getitem__
Toolchain
  File 
"/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/DscBuildData.py",
 line 221, in __init__
self._HandleOverridePath()
  File 
"/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/DscBuildData.py",
 line 282, in _HandleOverridePath
RecordList = self._RawData[MODEL_META_DATA_COMPONENT, self._Arch]
  File 
"/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/MetaFileParser.py",
 line 257, in __getitem__
self._PostProcess()
  File 
"/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/MetaFileParser.py",
 line 1358, in _PostProcess
Processer[self._ItemType]()
  File 
"/home/nxa34148/Desktop/uefi/BaseTools/Source/Python/Workspace/MetaFileParser.py",
 line 1533, in __ProcessDirective
__IncludeMacros['PACKAGES_PATH'] = 
GlobalData.gGlobalDefines['PACKAGES_PATH']
KeyError: 'PACKAGES_PATH'



build.py...
: error 7000: Failed to execute command
GenFds -f 
/home/nxa34148/Desktop/uefi/edk2-platforms/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf
 --conf=/home/nxa34148/Desktop/uefi/Conf -o 
/home/nxa34148/Desktop/uefi/Build/LS1043aRdbPkg/RELEASE_GCC49 -t GCC49 -b 
RELEASE -p 
/home/nxa34148/Desktop/uefi/edk2-platforms/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc
 -a AARCH64 -D "EFI_SOURCE=/home/nxa34148/Desktop/uefi/EdkCompatibilityPkg" -D 
"EDK_SOURCE=/home/nxa34148/Desktop/uefi/EdkCompatibilityPkg" -D 
"TOOL_CHAIN_TAG=GCC49" -D "TOOLCHAIN=GCC49" -D "FAMILY=GCC" -D 
"PACKAGES_PATH=/home/nxa34148/Desktop/uefi/edk2-platforms" -D 
"EDK_TOOLS_PATH=/home/nxa34148/Desktop/uefi/BaseTools" -D 
"WORKSPACE=/home/nxa34148/Desktop/uefi" -D "ARCH=AARCH64" -D 
"ECP_SOURCE=/home/nxa34148/Desktop/uefi/EdkCompatibilityPkg" -D 
"TARGET=RELEASE" [/home/nxa34148/Desktop/uefi]

- Failed -

I am not able to understand the cause of this error.

Can you please help?

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


Re: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE FIX

2018-10-13 Thread Gao, Liming
Ard:
  With Python3, do you still meet with the failure?

  On BaseTools Python3 migration, the first patch is sent 
https://lists.01.org/pipermail/edk2-devel/2018-September/030216.html. And, the 
check in plan is sent on 
https://lists.01.org/pipermail/edk2-devel/2018-October/030563.html. There is no 
reject or concern on this migration. So, we push this change today. And, send 
the notification 
https://lists.01.org/pipermail/edk2-devel/2018-October/030722.html, and require 
edk2 user to install Python3 in the machine. 

Thanks
Liming
> -Original Message-
> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> Sent: Saturday, October 13, 2018 4:46 PM
> To: Gao, Liming 
> Cc: edk2-devel-01 ; Laszlo Ersek 
> ; Leif Lindholm ; Kinney,
> Michael D ; Zhu, Yonghong 
> ; stephano.cet...@linux.intel.com
> Subject: Re: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE 
> FIX
> 
> On 13 October 2018 at 10:44, Gao, Liming  wrote:
> > Ard:
> >   I pull the latest edk2 code. I can find RunTests.py in BaseTools/Tests. 
> > The below error message shows RunTests.py is not found. But,
> this file is in BaseTools/Tests. I also run Make command in BaseTools 
> directory. It can work in my Ubuntu machine. I install Python37. Do
> you install Python36 or Python37 in your machine?
> >
> >   Yonghong has sent the mail to notify BaseTools Python3 migration is done. 
> > Python3.6 or the above is required.
> >
> 
> I have python3 on my machine, yes. But that does not mean it is the
> default for everyone.
> 
> 
> >> -Original Message-
> >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ard 
> >> Biesheuvel
> >> Sent: Saturday, October 13, 2018 4:18 PM
> >> To: edk2-devel-01 ; Gao, Liming 
> >> ; Laszlo Ersek ; Leif
> Lindholm
> >> ; Kinney, Michael D 
> >> ; Zhu, Yonghong ;
> >> stephano.cet...@linux.intel.com
> >> Subject: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE 
> >> FIX
> >>
> >> Commit ea787b6b55499e8f931201f8f49daaaeb2e4409f
> >>
> >>   "BaseTools: update Test scripts support python3"
> >>
> >> [which has never been sent out for review to the mailing list, as far
> >> as I can tell] is breaking the BaseTools build
> >>
> >> make -C Tests
> >> make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
> >> /bin/sh: 1: RunTests.py: not found
> >> GNUmakefile:17: recipe for target 'test' failed
> >> make[1]: *** [test] Error 127
> >> make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
> >> GNUmakefile:25: recipe for target 'Tests' failed
> >> make: *** [Tests] Error 2
> >> make: Leaving directory '/home/ard/build/edk2/BaseTools'
> >>
> >> I tried reverting that patch alone, but that gives me
> >>
> >> make -C Tests
> >> make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
> >> Traceback (most recent call last):
> >>   File "RunTests.py", line 36, in 
> >> allTests = GetAllTestsSuite()
> >>   File "RunTests.py", line 33, in GetAllTestsSuite
> >> return unittest.TestSuite([GetCTestSuite(), GetPythonTestSuite()])
> >>   File "RunTests.py", line 30, in GetPythonTestSuite
> >> return PythonToolsTests.TheTestSuite()
> >>   File "/home/ard/build/edk2/BaseTools/Tests/PythonToolsTests.py",
> >> line 27, in TheTestSuite
> >> import CheckUnicodeSourceFiles
> >>   File "/home/ard/build/edk2/BaseTools/Tests/CheckUnicodeSourceFiles.py",
> >> line 25, in 
> >> from Common.Misc import PathClass
> >>   File "/home/ard/build/edk2/BaseTools/Source/Python/Common/Misc.py",
> >> line 27, in 
> >> from collections import UserDict as IterableUserDict
> >> ImportError: cannot import name UserDict
> >> GNUmakefile:17: recipe for target 'test' failed
> >> make[1]: *** [test] Error 1
> >> make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
> >> GNUmakefile:25: recipe for target 'Tests' failed
> >> make: *** [Tests] Error 2
> >> make: Leaving directory '/home/ard/build/edk2/BaseTools'
> >>
> >> Breaking the build for everyone with an unreviewed patch 2 days before
> >> the plugfest is NOT OK.
> >>
> >> Please fix or revert ASAP
> >>
> >> (I suppose that the failing test is a false negative in this case, but
> >> that is not really the point - my CI jobs are broken due to this and
> >> so are many others, I imagine)
> >> ___
> >> 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] BaseTools/ build broken due to unreviewed patch - PLEASE FIX

2018-10-13 Thread Ard Biesheuvel
On 13 October 2018 at 10:44, Gao, Liming  wrote:
> Ard:
>   I pull the latest edk2 code. I can find RunTests.py in BaseTools/Tests. The 
> below error message shows RunTests.py is not found. But, this file is in 
> BaseTools/Tests. I also run Make command in BaseTools directory. It can work 
> in my Ubuntu machine. I install Python37. Do you install Python36 or Python37 
> in your machine?
>
>   Yonghong has sent the mail to notify BaseTools Python3 migration is done. 
> Python3.6 or the above is required.
>

I have python3 on my machine, yes. But that does not mean it is the
default for everyone.


>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ard 
>> Biesheuvel
>> Sent: Saturday, October 13, 2018 4:18 PM
>> To: edk2-devel-01 ; Gao, Liming 
>> ; Laszlo Ersek ; Leif Lindholm
>> ; Kinney, Michael D ; 
>> Zhu, Yonghong ;
>> stephano.cet...@linux.intel.com
>> Subject: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE FIX
>>
>> Commit ea787b6b55499e8f931201f8f49daaaeb2e4409f
>>
>>   "BaseTools: update Test scripts support python3"
>>
>> [which has never been sent out for review to the mailing list, as far
>> as I can tell] is breaking the BaseTools build
>>
>> make -C Tests
>> make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
>> /bin/sh: 1: RunTests.py: not found
>> GNUmakefile:17: recipe for target 'test' failed
>> make[1]: *** [test] Error 127
>> make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
>> GNUmakefile:25: recipe for target 'Tests' failed
>> make: *** [Tests] Error 2
>> make: Leaving directory '/home/ard/build/edk2/BaseTools'
>>
>> I tried reverting that patch alone, but that gives me
>>
>> make -C Tests
>> make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
>> Traceback (most recent call last):
>>   File "RunTests.py", line 36, in 
>> allTests = GetAllTestsSuite()
>>   File "RunTests.py", line 33, in GetAllTestsSuite
>> return unittest.TestSuite([GetCTestSuite(), GetPythonTestSuite()])
>>   File "RunTests.py", line 30, in GetPythonTestSuite
>> return PythonToolsTests.TheTestSuite()
>>   File "/home/ard/build/edk2/BaseTools/Tests/PythonToolsTests.py",
>> line 27, in TheTestSuite
>> import CheckUnicodeSourceFiles
>>   File "/home/ard/build/edk2/BaseTools/Tests/CheckUnicodeSourceFiles.py",
>> line 25, in 
>> from Common.Misc import PathClass
>>   File "/home/ard/build/edk2/BaseTools/Source/Python/Common/Misc.py",
>> line 27, in 
>> from collections import UserDict as IterableUserDict
>> ImportError: cannot import name UserDict
>> GNUmakefile:17: recipe for target 'test' failed
>> make[1]: *** [test] Error 1
>> make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
>> GNUmakefile:25: recipe for target 'Tests' failed
>> make: *** [Tests] Error 2
>> make: Leaving directory '/home/ard/build/edk2/BaseTools'
>>
>> Breaking the build for everyone with an unreviewed patch 2 days before
>> the plugfest is NOT OK.
>>
>> Please fix or revert ASAP
>>
>> (I suppose that the failing test is a false negative in this case, but
>> that is not really the point - my CI jobs are broken due to this and
>> so are many others, I imagine)
>> ___
>> 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] BaseTools/ build broken due to unreviewed patch - PLEASE FIX

2018-10-13 Thread Gao, Liming
Ard:
  I pull the latest edk2 code. I can find RunTests.py in BaseTools/Tests. The 
below error message shows RunTests.py is not found. But, this file is in 
BaseTools/Tests. I also run Make command in BaseTools directory. It can work in 
my Ubuntu machine. I install Python37. Do you install Python36 or Python37 in 
your machine? 
  
  Yonghong has sent the mail to notify BaseTools Python3 migration is done. 
Python3.6 or the above is required. 
  

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ard 
> Biesheuvel
> Sent: Saturday, October 13, 2018 4:18 PM
> To: edk2-devel-01 ; Gao, Liming 
> ; Laszlo Ersek ; Leif Lindholm
> ; Kinney, Michael D ; 
> Zhu, Yonghong ;
> stephano.cet...@linux.intel.com
> Subject: [edk2] BaseTools/ build broken due to unreviewed patch - PLEASE FIX
> 
> Commit ea787b6b55499e8f931201f8f49daaaeb2e4409f
> 
>   "BaseTools: update Test scripts support python3"
> 
> [which has never been sent out for review to the mailing list, as far
> as I can tell] is breaking the BaseTools build
> 
> make -C Tests
> make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
> /bin/sh: 1: RunTests.py: not found
> GNUmakefile:17: recipe for target 'test' failed
> make[1]: *** [test] Error 127
> make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
> GNUmakefile:25: recipe for target 'Tests' failed
> make: *** [Tests] Error 2
> make: Leaving directory '/home/ard/build/edk2/BaseTools'
> 
> I tried reverting that patch alone, but that gives me
> 
> make -C Tests
> make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
> Traceback (most recent call last):
>   File "RunTests.py", line 36, in 
> allTests = GetAllTestsSuite()
>   File "RunTests.py", line 33, in GetAllTestsSuite
> return unittest.TestSuite([GetCTestSuite(), GetPythonTestSuite()])
>   File "RunTests.py", line 30, in GetPythonTestSuite
> return PythonToolsTests.TheTestSuite()
>   File "/home/ard/build/edk2/BaseTools/Tests/PythonToolsTests.py",
> line 27, in TheTestSuite
> import CheckUnicodeSourceFiles
>   File "/home/ard/build/edk2/BaseTools/Tests/CheckUnicodeSourceFiles.py",
> line 25, in 
> from Common.Misc import PathClass
>   File "/home/ard/build/edk2/BaseTools/Source/Python/Common/Misc.py",
> line 27, in 
> from collections import UserDict as IterableUserDict
> ImportError: cannot import name UserDict
> GNUmakefile:17: recipe for target 'test' failed
> make[1]: *** [test] Error 1
> make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
> GNUmakefile:25: recipe for target 'Tests' failed
> make: *** [Tests] Error 2
> make: Leaving directory '/home/ard/build/edk2/BaseTools'
> 
> Breaking the build for everyone with an unreviewed patch 2 days before
> the plugfest is NOT OK.
> 
> Please fix or revert ASAP
> 
> (I suppose that the failing test is a false negative in this case, but
> that is not really the point - my CI jobs are broken due to this and
> so are many others, I imagine)
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] BaseTools/ build broken due to unreviewed patch - PLEASE FIX

2018-10-13 Thread Ard Biesheuvel
Commit ea787b6b55499e8f931201f8f49daaaeb2e4409f

  "BaseTools: update Test scripts support python3"

[which has never been sent out for review to the mailing list, as far
as I can tell] is breaking the BaseTools build

make -C Tests
make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
/bin/sh: 1: RunTests.py: not found
GNUmakefile:17: recipe for target 'test' failed
make[1]: *** [test] Error 127
make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
GNUmakefile:25: recipe for target 'Tests' failed
make: *** [Tests] Error 2
make: Leaving directory '/home/ard/build/edk2/BaseTools'

I tried reverting that patch alone, but that gives me

make -C Tests
make[1]: Entering directory '/home/ard/build/edk2/BaseTools/Tests'
Traceback (most recent call last):
  File "RunTests.py", line 36, in 
allTests = GetAllTestsSuite()
  File "RunTests.py", line 33, in GetAllTestsSuite
return unittest.TestSuite([GetCTestSuite(), GetPythonTestSuite()])
  File "RunTests.py", line 30, in GetPythonTestSuite
return PythonToolsTests.TheTestSuite()
  File "/home/ard/build/edk2/BaseTools/Tests/PythonToolsTests.py",
line 27, in TheTestSuite
import CheckUnicodeSourceFiles
  File "/home/ard/build/edk2/BaseTools/Tests/CheckUnicodeSourceFiles.py",
line 25, in 
from Common.Misc import PathClass
  File "/home/ard/build/edk2/BaseTools/Source/Python/Common/Misc.py",
line 27, in 
from collections import UserDict as IterableUserDict
ImportError: cannot import name UserDict
GNUmakefile:17: recipe for target 'test' failed
make[1]: *** [test] Error 1
make[1]: Leaving directory '/home/ard/build/edk2/BaseTools/Tests'
GNUmakefile:25: recipe for target 'Tests' failed
make: *** [Tests] Error 2
make: Leaving directory '/home/ard/build/edk2/BaseTools'

Breaking the build for everyone with an unreviewed patch 2 days before
the plugfest is NOT OK.

Please fix or revert ASAP

(I suppose that the failing test is a false negative in this case, but
that is not really the point - my CI jobs are broken due to this and
so are many others, I imagine)
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel