Re: [edk2] [PATCH] BaseTools: Fix regression issue by 1eb72acddd61

2018-04-26 Thread Zhu, Yonghong
Reviewed-by: Yonghong Zhu  

Best Regards,
Zhu Yonghong


-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Yonghong 
Zhu
Sent: Friday, April 27, 2018 12:29 PM
To: edk2-devel@lists.01.org
Cc: Feng, YunhuaX ; Gao, Liming 
Subject: [edk2] [PATCH] BaseTools: Fix regression issue by 1eb72acddd61

From: Yunhua Feng 

Fix regression issue by 1eb72acddd61
secRe not replace by secReGeneral

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
---
 BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py 
b/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
index 2a039480a0..ebd6a30639 100644
--- a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
+++ b/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
@@ -150,11 +150,11 @@ def _parseGeneral(lines, efifilepath):
 continue
 if line.startswith("entry point at"):
 status = 3
 continue
 if status == 1 and len(line) != 0:
-m = secRe.match(line)
+m = secReGeneral.match(line)
 assert m is not None, "Fail to parse the section in map file , 
line is %s" % line
 sec_no, sec_start, sec_length, sec_name, sec_class = m.groups(0)
 secs.append([int(sec_no, 16), int(sec_start, 16), int(sec_length, 
16), sec_name, sec_class])
 if status == 2 and len(line) != 0:
 m = symRe.match(line)
-- 
2.12.2.windows.2

___
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] [PATCH] BaseTools: Fix regression issue by 1eb72acddd61

2018-04-26 Thread Yonghong Zhu
From: Yunhua Feng 

Fix regression issue by 1eb72acddd61
secRe not replace by secReGeneral

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
---
 BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py 
b/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
index 2a039480a0..ebd6a30639 100644
--- a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
+++ b/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
@@ -150,11 +150,11 @@ def _parseGeneral(lines, efifilepath):
 continue
 if line.startswith("entry point at"):
 status = 3
 continue
 if status == 1 and len(line) != 0:
-m = secRe.match(line)
+m = secReGeneral.match(line)
 assert m is not None, "Fail to parse the section in map file , 
line is %s" % line
 sec_no, sec_start, sec_length, sec_name, sec_class = m.groups(0)
 secs.append([int(sec_no, 16), int(sec_start, 16), int(sec_length, 
16), sec_name, sec_class])
 if status == 2 and len(line) != 0:
 m = symRe.match(line)
-- 
2.12.2.windows.2

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


Re: [edk2] [PATCH v1 0/2] MdePkg: IORT Specification updates

2018-04-26 Thread Gao, Liming
Thanks for your update. 
Reviewed-by: Liming Gao 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Sami 
> Mujawar
> Sent: Thursday, April 26, 2018 11:41 PM
> To: edk2-devel@lists.01.org
> Cc: stephanie.hughes-f...@arm.com; ard.biesheu...@linaro.org; 
> leif.lindh...@linaro.org; Gao, Liming ;
> Kinney, Michael D ; n...@arm.com
> Subject: [edk2] [PATCH v1 0/2] MdePkg: IORT Specification updates
> 
> The IORT specification was updated soon after the patch "MdePkg: SMMUv3
> updates for IORT table definitions" (included again in this series) was
> submitted.
> 
> In response to query regarding the changes for the latest revision (See
> https://lists.01.org/pipermail/edk2-devel/2018-March/023295.html);
> submitting a separate patch for the IORT specification Rev D, March 2018
> updates.
> 
> Patchset:
>   1. MdePkg: SMMUv3 updates for IORT table definitions
>  - Patch already ACKed by Ard Biesheuvel, however has not yet
>been merged in edk2.
> 
>   2. MdePkg: IORT Specification Rev D updates
>  - Patch for IORT Spec Rev D, March 2018 updates.
> 
> Sami Mujawar (2):
>   MdePkg: SMMUv3 updates for IORT table definitions
>   MdePkg: IORT Specification Rev D updates
> 
>  MdePkg/Include/IndustryStandard/IoRemappingTable.h | 17 ++---
>  1 file changed, 14 insertions(+), 3 deletions(-)
> 
> --
> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
> 
> 
> ___
> 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 edk2-platforms] Silicon/Socionext/SynQuacer: update PHY reference clock rate

2018-04-26 Thread Ard Biesheuvel
On 19 April 2018 at 17:38, Leif Lindholm  wrote:
> On Mon, Apr 16, 2018 at 01:00:58PM +0200, Ard Biesheuvel wrote:
>> As reported by Kojima-san, the PHY reference clock value we use in our
>> ACPI and DT descriptions is out of sync with the hardware. Replace
>> 125 MHz with 250 MHz throughout.
>>
>> Cc: Masahisa Kojima 
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ard Biesheuvel 
>
> Reviewed-by: Leif Lindholm 
>

Thanks

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


Re: [edk2] [PATCH v1] Platform/ARM: Fix platform timer offset in GTDT

2018-04-26 Thread Ard Biesheuvel
On 24 April 2018 at 16:19, Sami Mujawar  wrote:
> The FVP_PLATFORM_TIMER_COUNT is the sum of the memory
> mapped platform timers and the watchdog timers.
>
> The watchdog timers can be disabled by setting the
> FVP_WATCHDOG_COUNT (defined by PcdWatchdogCount)
> to zero.
>
> On the VExpress platform, if the FVP_WATCHDOG_COUNT is
> set to zero, the FVP_PLATFORM_TIMER_COUNT is 1 as
> VExpress has one memory mapped timer.
>
> The code however incorrectly sets the platform timer
> offset to zero in the GTDT. This causes the OS to read
> the platform timer information from an invalid offset,
> and may crash.
>
> Updated the GTDT table to set the platform timer offset
> to zero only when the FVP_PLATFORM_TIMER_COUNT is zero.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Sami Mujawar 
> Reviewed-by: Evan Lloyd 

Reviewed-by: Ard Biesheuvel 

Pushed as ed9be80fa9521edc2ef959d493904d4800e64ca1

Thanks

> ---
>
> Notes:
> v1:
>  - Fix platform timer offset in GTDT for FVP  [SAMI]
>
>  Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc 
> b/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc
> index 
> ae570574b298094ff468f30b78fbd8c98db506c5..1cb4b498300cf1a08514835677154eace1dd1803
>  100644
> --- a/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc
> +++ b/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc
> @@ -108,7 +108,7 @@ FVP_GENERIC_TIMER_DESCRIPTION_TABLES Gtdt = {
>  FVP_GTDT_GTIMER_FLAGS,// UINT32  
> NonSecurePL2TimerFlags
>  FVP_CNT_READ_BASE_ADDRESS,// UINT64  
> CntReadBasePhysicalAddress
>  FVP_PLATFORM_TIMER_COUNT, // UINT32  
> PlatformTimerCount
> -#if (FVP_WATCHDOG_COUNT != 0)
> +#if (FVP_PLATFORM_TIMER_COUNT != 0)
>  sizeof (EFI_ACPI_6_1_GENERIC_TIMER_DESCRIPTION_TABLE) // UINT32  
> PlatfromTimerOffset
>  #else
>  0
> --
> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
>
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v1 0/2] Fix for variable store corrupt issue

2018-04-26 Thread Ard Biesheuvel
On 26 April 2018 at 12:47, Leif Lindholm  wrote:
> On Thu, Apr 26, 2018 at 09:47:17AM +, Sami Mujawar wrote:
>> Hi Ard,
>>
>> I do not have the setup currently to test ArmVExpress-CTA15-A7. However, I 
>> think it will need this change as well.
>> Please ignore this patchset, I will send another one shortly.
>
> No need to resubmit the whole set - just send out a 3/3 to go on top
> of this.
>

Thanks Sami

Patches #1 .. #3 pushed as b581a4934d8f..3f20ed76ce78
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 18/27] BaseTools: Replace PCD type strings with predefined constant

2018-04-26 Thread Jaben Carsey
v2 - fix YongHong's comment.

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py |  4 +--
 BaseTools/Source/Python/AutoGen/GenC.py|  4 +--
 BaseTools/Source/Python/AutoGen/GenPcdDb.py|  2 +-
 BaseTools/Source/Python/Common/DataType.py |  3 ++
 BaseTools/Source/Python/Common/MigrationUtilities.py   |  2 +-
 BaseTools/Source/Python/GenFds/FfsInfStatement.py  |  2 +-
 BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py |  4 +--
 BaseTools/Source/Python/Workspace/DecBuildData.py  | 22 +++---
 BaseTools/Source/Python/Workspace/DscBuildData.py  | 22 +++---
 BaseTools/Source/Python/Workspace/InfBuildData.py  | 26 -
 BaseTools/Source/Python/build/BuildReport.py   | 30 
++--
 11 files changed, 62 insertions(+), 59 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 86caeacb4874..2a6fa05ab819 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -869,8 +869,8 @@ class WorkspaceAutoGen(AutoGen):
 def _CheckPcdDefineAndType(self):
 PcdTypeList = [
 TAB_PCDS_FIXED_AT_BUILD, TAB_PCDS_PATCHABLE_IN_MODULE, 
TAB_PCDS_FEATURE_FLAG,
-TAB_PCDS_DYNAMIC, #"DynamicHii", "DynamicVpd",
-TAB_PCDS_DYNAMIC_EX, # "DynamicExHii", "DynamicExVpd"
+TAB_PCDS_DYNAMIC, #TAB_PCDS_DYNAMIC_HII, TAB_PCDS_DYNAMIC_VPD,
+TAB_PCDS_DYNAMIC_EX, # TAB_PCDS_DYNAMIC_EX_HII, 
TAB_PCDS_DYNAMIC_EX_VPD
 ]
 
 # This dict store PCDs which are not used by any modules with 
specified arches
diff --git a/BaseTools/Source/Python/AutoGen/GenC.py 
b/BaseTools/Source/Python/AutoGen/GenC.py
index 34cb789cecb7..73cda208a7eb 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -28,8 +28,8 @@ from IdfClassObject import *
 
 ## PCD type string
 gItemTypeStringDatabase  = {
-TAB_PCDS_FEATURE_FLAG   :   'FixedAtBuild',
-TAB_PCDS_FIXED_AT_BUILD :   'FixedAtBuild',
+TAB_PCDS_FEATURE_FLAG   :   TAB_PCDS_FIXED_AT_BUILD,
+TAB_PCDS_FIXED_AT_BUILD :   TAB_PCDS_FIXED_AT_BUILD,
 TAB_PCDS_PATCHABLE_IN_MODULE:   'BinaryPatch',
 TAB_PCDS_DYNAMIC:   '',
 TAB_PCDS_DYNAMIC_DEFAULT:   '',
diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py 
b/BaseTools/Source/Python/AutoGen/GenPcdDb.py
index e0d1918e9805..b48ddcd59ec8 100644
--- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py
+++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py
@@ -1217,7 +1217,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, 
DynamicPcdList, Phase):
 Pcd.InitString = 'UNINIT'
 
 if Pcd.DatumType == TAB_VOID:
-if Pcd.Type not in ["DynamicVpd", "DynamicExVpd"]:
+if Pcd.Type not in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_VPD]:
 Pcd.TokenTypeList = ['PCD_TYPE_STRING']
 else:
 Pcd.TokenTypeList = []
diff --git a/BaseTools/Source/Python/Common/DataType.py 
b/BaseTools/Source/Python/Common/DataType.py
index 77d76066f71a..2662132e5106 100644
--- a/BaseTools/Source/Python/Common/DataType.py
+++ b/BaseTools/Source/Python/Common/DataType.py
@@ -220,6 +220,9 @@ TAB_PCDS_DYNAMIC_HII = 'DynamicHii'
 PCD_DYNAMIC_TYPE_SET = {TAB_PCDS_DYNAMIC, TAB_PCDS_DYNAMIC_DEFAULT, 
TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_HII}
 PCD_DYNAMIC_EX_TYPE_SET = {TAB_PCDS_DYNAMIC_EX, TAB_PCDS_DYNAMIC_EX_DEFAULT, 
TAB_PCDS_DYNAMIC_EX_VPD, TAB_PCDS_DYNAMIC_EX_HII}
 
+# leave as a list for order
+PCD_TYPE_LIST = [TAB_PCDS_FIXED_AT_BUILD, TAB_PCDS_PATCHABLE_IN_MODULE, 
TAB_PCDS_FEATURE_FLAG, TAB_PCDS_DYNAMIC, TAB_PCDS_DYNAMIC_EX]
+
 TAB_PCDS_FIXED_AT_BUILD_NULL = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD
 TAB_PCDS_FIXED_AT_BUILD_COMMON = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + 
TAB_SPLIT + TAB_ARCH_COMMON
 TAB_PCDS_FIXED_AT_BUILD_IA32 = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT 
+ TAB_ARCH_IA32
diff --git a/BaseTools/Source/Python/Common/MigrationUtilities.py 
b/BaseTools/Source/Python/Common/MigrationUtilities.py
index e9f1cabcb794..0c93c72a60f6 100644
--- a/BaseTools/Source/Python/Common/MigrationUtilities.py
+++ b/BaseTools/Source/Python/Common/MigrationUtilities.py
@@ -34,7 +34,7 @@ def SetCommon(Common, XmlCommon):
 XmlTag = "Usage"
 Common.Usage = XmlAttribute(XmlCommon, XmlTag).split()
 
-XmlTag = "FeatureFlag"
+XmlTag = TAB_PCDS_FEATURE_FLAG
 Common.FeatureFlag = XmlAttribute(XmlCommon, XmlTag)
 
 XmlTag = "SupArchList"
diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py 
b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
index f973cf2f0b76..9068157ba616 100644
--- 

[edk2] [PATCH v2 19/27] BaseTools: Replace Binary File type strings with predefined constant

2018-04-26 Thread Jaben Carsey
BINARY_FILE_TYPE_FW was 'FW'
BINARY_FILE_TYPE_GUID was 'GUID'
BINARY_FILE_TYPE_PREEFORM was 'PREEFORM'
BINARY_FILE_TYPE_UEFI_APP was 'UEFI_APP'
BINARY_FILE_TYPE_UNI_UI was 'UNI_UI'
BINARY_FILE_TYPE_UNI_VER was 'UNI_VER'
BINARY_FILE_TYPE_LIB was 'LIB'
BINARY_FILE_TYPE_PE32 was 'PE32'
BINARY_FILE_TYPE_PIC was 'PIC'
BINARY_FILE_TYPE_PEI_DEPEX was 'PEI_DEPEX'
BINARY_FILE_TYPE_DXE_DEPEX was 'DXE_DEPEX'
BINARY_FILE_TYPE_SMM_DEPEX was 'SMM_DEPEX'
BINARY_FILE_TYPE_TE was 'TE'
BINARY_FILE_TYPE_VER was 'VER'
BINARY_FILE_TYPE_UI was 'UI'
BINARY_FILE_TYPE_BIN was 'BIN'
BINARY_FILE_TYPE_FV was 'FV'

v2 - split apart FV and GUID types with different meanings.

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 12 +--
 BaseTools/Source/Python/AutoGen/GenC.py|  8 +-
 BaseTools/Source/Python/AutoGen/GenPcdDb.py|  4 +-
 BaseTools/Source/Python/Common/DataType.py |  2 +
 BaseTools/Source/Python/Common/Expression.py   |  2 +-
 BaseTools/Source/Python/Common/Misc.py |  4 +-
 BaseTools/Source/Python/GenFds/DataSection.py  |  6 +-
 BaseTools/Source/Python/GenFds/DepexSection.py |  6 +-
 BaseTools/Source/Python/GenFds/EfiSection.py   | 10 +--
 BaseTools/Source/Python/GenFds/Fd.py   |  3 +-
 BaseTools/Source/Python/GenFds/FdfParser.py| 92 
++--
 BaseTools/Source/Python/GenFds/Ffs.py  | 14 +--
 BaseTools/Source/Python/GenFds/FfsInfStatement.py  | 22 ++---
 BaseTools/Source/Python/GenFds/Fv.py   |  4 +-
 BaseTools/Source/Python/GenFds/GenFds.py   | 10 +--
 BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py |  4 +-
 BaseTools/Source/Python/GenFds/OptRomInfStatement.py   |  2 +-
 BaseTools/Source/Python/GenFds/Region.py   |  5 +-
 BaseTools/Source/Python/GenFds/Section.py  | 46 +-
 BaseTools/Source/Python/GenFds/UiSection.py|  2 +-
 BaseTools/Source/Python/Trim/Trim.py   |  2 +-
 BaseTools/Source/Python/Workspace/DscBuildData.py  |  2 +-
 BaseTools/Source/Python/Workspace/InfBuildData.py  |  2 +-
 BaseTools/Source/Python/build/BuildReport.py   | 12 +--
 24 files changed, 140 insertions(+), 136 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 2a6fa05ab819..671f02133aca 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -922,7 +922,7 @@ class WorkspaceAutoGen(AutoGen):
 ## Return the directory to store FV files
 def _GetFvDir(self):
 if self._FvDir is None:
-self._FvDir = path.join(self.BuildDir, 'FV')
+self._FvDir = path.join(self.BuildDir, TAB_FV_DIRECTORY)
 return self._FvDir
 
 ## Return the directory to store all intermediate and final files built
@@ -1325,7 +1325,7 @@ class PlatformAutoGen(AutoGen):
 
 def UpdateNVStoreMaxSize(self,OrgVpdFile):
 if self.VariableInfo:
-VpdMapFilePath = os.path.join(self.BuildDir, "FV", "%s.map" % 
self.Platform.VpdToolGuid)
+VpdMapFilePath = os.path.join(self.BuildDir, TAB_FV_DIRECTORY, 
"%s.map" % self.Platform.VpdToolGuid)
 PcdNvStoreDfBuffer = [item for item in self._DynamicPcdList if 
item.TokenCName == "PcdNvStoreDefaultValueBuffer" and item.TokenSpaceGuidCName 
== "gEfiMdeModulePkgTokenSpaceGuid"]
 
 if PcdNvStoreDfBuffer:
@@ -1718,7 +1718,7 @@ class PlatformAutoGen(AutoGen):
 
 # Process VPD map file generated by third party BPDG tool
 if NeedProcessVpdMapFile:
-VpdMapFilePath = os.path.join(self.BuildDir, "FV", 
"%s.map" % self.Platform.VpdToolGuid)
+VpdMapFilePath = os.path.join(self.BuildDir, 
TAB_FV_DIRECTORY, "%s.map" % self.Platform.VpdToolGuid)
 if os.path.exists(VpdMapFilePath):
 VpdFile.Read(VpdMapFilePath)
 
@@ -1769,7 +1769,7 @@ class PlatformAutoGen(AutoGen):
 self.AllPcdList = self._NonDynamicPcdList + self._DynamicPcdList
 
 def FixVpdOffset(self,VpdFile ):
-FvPath = os.path.join(self.BuildDir, "FV")
+FvPath = os.path.join(self.BuildDir, TAB_FV_DIRECTORY)
 if not os.path.exists(FvPath):
 try:
 os.makedirs(FvPath)
@@ -1782,7 +1782,7 @@ class PlatformAutoGen(AutoGen):
 # retrieve BPDG tool's path from tool_def.txt according to 
VPD_TOOL_GUID defined in DSC file.
 BPDGToolName = None
 for ToolDef in self.ToolDefinition.values():
-if ToolDef.has_key("GUID") and ToolDef["GUID"] == 
self.Platform.VpdToolGuid:
+if ToolDef.has_key(TAB_GUID) and 

[edk2] [PATCH v2 13/27] BaseTools: replace string constants used for module types

2018-04-26 Thread Jaben Carsey
replace raw strings in the code (note: except UPT) with constants.
SUP_MODULE_BASE was 'BASE'
SUP_MODULE_SEC was 'SEC'
SUP_MODULE_PEI_CORE was 'PEI_CORE'
SUP_MODULE_PEIM was 'PEIM'
SUP_MODULE_DXE_CORE was 'DXE_CORE'
SUP_MODULE_DXE_DRIVER was 'DXE_DRIVER'
SUP_MODULE_DXE_RUNTIME_DRIVER was 'DXE_RUNTIME_DRIVER'
SUP_MODULE_DXE_SAL_DRIVER was 'DXE_SAL_DRIVER'
SUP_MODULE_DXE_SMM_DRIVER was 'DXE_SMM_DRIVER'
SUP_MODULE_UEFI_DRIVER was 'UEFI_DRIVER'
SUP_MODULE_UEFI_APPLICATION was 'UEFI_APPLICATION'
SUP_MODULE_USER_DEFINED was 'USER_DEFINED'
SUP_MODULE_SMM_CORE was 'SMM_CORE'
SUP_MODULE_MM_STANDALONE was 'MM_STANDALONE'
SUP_MODULE_MM_CORE_STANDALONE was 'MM_CORE_STANDALONE'

v2 - fix Yonghong's comments.

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py   |  20 ++--
 BaseTools/Source/Python/AutoGen/BuildEngine.py   |  10 +-
 BaseTools/Source/Python/AutoGen/GenC.py  | 120 ++--
 BaseTools/Source/Python/AutoGen/GenDepex.py  |  33 +++---
 BaseTools/Source/Python/Common/DataType.py   |   2 +-
 BaseTools/Source/Python/Ecc/Check.py |   6 +-
 BaseTools/Source/Python/GenFds/CompressSection.py|   3 +-
 BaseTools/Source/Python/GenFds/DataSection.py|   5 +-
 BaseTools/Source/Python/GenFds/DepexSection.py   |  11 +-
 BaseTools/Source/Python/GenFds/EfiSection.py |  17 +--
 BaseTools/Source/Python/GenFds/FdfParser.py  |  16 +--
 BaseTools/Source/Python/GenFds/Ffs.py|  41 +++
 BaseTools/Source/Python/GenFds/FfsInfStatement.py|  30 ++---
 BaseTools/Source/Python/GenFds/FvImageSection.py |   5 +-
 BaseTools/Source/Python/GenFds/GuidSection.py|   5 +-
 BaseTools/Source/Python/GenFds/UiSection.py  |   3 +-
 BaseTools/Source/Python/GenFds/VerSection.py |   3 +-
 BaseTools/Source/Python/Workspace/InfBuildData.py|  48 
 BaseTools/Source/Python/Workspace/WorkspaceCommon.py |   2 +-
 BaseTools/Source/Python/build/BuildReport.py |  56 -
 BaseTools/Source/Python/build/build.py   |  10 +-
 21 files changed, 228 insertions(+), 218 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index dc82075c5876..2811952fe1d3 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1430,7 +1430,7 @@ class PlatformAutoGen(AutoGen):
 # used by DXE module, it should be stored in DXE PCD 
database.
 # The default Phase is DXE
 #
-if M.ModuleType in ["PEIM", "PEI_CORE"]:
+if M.ModuleType in [SUP_MODULE_PEIM, SUP_MODULE_PEI_CORE]:
 PcdFromModule.Phase = "PEI"
 if PcdFromModule not in self._DynaPcdList_:
 self._DynaPcdList_.append(PcdFromModule)
@@ -1472,7 +1472,7 @@ class PlatformAutoGen(AutoGen):
 # make sure that the "VOID*" kind of datum has 
MaxDatumSize set
 if PcdFromModule.DatumType == TAB_VOID and 
PcdFromModule.MaxDatumSize in [None, '']:
 NoDatumTypePcdList.add("%s.%s [%s]" % 
(PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, InfName))
-if M.ModuleType in ["PEIM", "PEI_CORE"]:
+if M.ModuleType in [SUP_MODULE_PEIM, SUP_MODULE_PEI_CORE]:
 PcdFromModule.Phase = "PEI"
 if PcdFromModule not in self._DynaPcdList_ and 
PcdFromModule.Type in GenC.gDynamicExPcd:
 self._DynaPcdList_.append(PcdFromModule)
@@ -2203,7 +2203,7 @@ class PlatformAutoGen(AutoGen):
 
LibraryModule.LibraryClass.append(LibraryClassObject(LibraryClassName, 
[ModuleType]))
 elif LibraryModule.LibraryClass is None \
  or len(LibraryModule.LibraryClass) == 0 \
- or (ModuleType != 'USER_DEFINED'
+ or (ModuleType != SUP_MODULE_USER_DEFINED
  and ModuleType not in 
LibraryModule.LibraryClass[0].SupModList):
 # only USER_DEFINED can link against any library 
instance despite of its SupModList
 EdkLogger.error("build", OPTION_MISSING,
@@ -3969,8 +3969,8 @@ class ModuleAutoGen(AutoGen):
 break
 
 ModuleType = self.ModuleType
-if ModuleType == 'UEFI_DRIVER' and self.DepexGenerated:
-ModuleType = 'DXE_DRIVER'
+if ModuleType == SUP_MODULE_UEFI_DRIVER and self.DepexGenerated:
+ModuleType = SUP_MODULE_DXE_DRIVER
 
 DriverType = ''
 if self.PcdIsDriver != '':
@@ -4047,11 +4047,11 @@ class 

[edk2] [PATCH v2 21/27] BaseTools: replace string with predefined constant

2018-04-26 Thread Jaben Carsey
v2 - add missing namespace.

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

diff --git a/BaseTools/Source/Python/Ecc/Check.py 
b/BaseTools/Source/Python/Ecc/Check.py
index 089d42a6d181..dde7d7841082 100644
--- a/BaseTools/Source/Python/Ecc/Check.py
+++ b/BaseTools/Source/Python/Ecc/Check.py
@@ -787,7 +787,7 @@ class Check(object):
 continue
 SqlCommand = """select Value3 from Inf where BelongsToFile 
=
 (select ID from File where lower(FullPath) 
= lower('%s'))
-and Value2 = '%s'""" % (LibraryIns, 
'LIBRARY_CLASS')
+and Value2 = '%s'""" % (LibraryIns, 
DT.PLATFORM_COMPONENT_TYPE_LIBRARY_CLASS)
 RecordSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand)
 IsFound = False
 for Record in RecordSet:
-- 
2.16.2.windows.1

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


[edk2] [PATCH v2 16/27] BaseTools: Replace EDK Component strings with predefined constant

2018-04-26 Thread Jaben Carsey
EDK_COMPONENT_TYPE_LIBRARY was 'LIBRARY'
EDK_COMPONENT_TYPE_SECURITY_CORE was 'SECURITY_CORE'
EDK_COMPONENT_TYPE_COMBINED_PEIM_DRIVER was 'COMBINED_PEIM_DRIVER'
EDK_COMPONENT_TYPE_PIC_PEIM was 'PIC_PEIM'
EDK_COMPONENT_TYPE_RELOCATABLE_PEIM was 'RELOCATABLE_PEIM'
EDK_COMPONENT_TYPE_BS_DRIVER was 'BS_DRIVER'
EDK_COMPONENT_TYPE_RT_DRIVER was 'RT_DRIVER'
EDK_COMPONENT_TYPE_SAL_RT_DRIVER was 'SAL_RT_DRIVER'
EDK_COMPONENT_TYPE_APPLICATION was 'APPLICATION'

v2 - revert 2 files.  will update later in own patches.

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey 
---
 BaseTools/Source/Python/Common/DataType.py| 28 ++--
 BaseTools/Source/Python/GenFds/FdfParser.py   |  6 ++---
 BaseTools/Source/Python/GenFds/Ffs.py |  2 +-
 BaseTools/Source/Python/Workspace/InfBuildData.py |  2 +-
 BaseTools/Source/Python/build/BuildReport.py  |  6 ++---
 BaseTools/Source/Python/build/build.py|  8 +++---
 6 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/BaseTools/Source/Python/Common/DataType.py 
b/BaseTools/Source/Python/Common/DataType.py
index cac455f9f7cf..ffd73d6852d1 100644
--- a/BaseTools/Source/Python/Common/DataType.py
+++ b/BaseTools/Source/Python/Common/DataType.py
@@ -84,7 +84,7 @@ SUP_MODULE_LIST_STRING = TAB_VALUE_SPLIT.join(SUP_MODULE_LIST)
 SUP_MODULE_SET_PEI = {SUP_MODULE_PEIM, SUP_MODULE_PEI_CORE}
 
 EDK_COMPONENT_TYPE_LIBRARY = 'LIBRARY'
-EDK_COMPONENT_TYPE_SECUARITY_CORE = 'SECUARITY_CORE'
+EDK_COMPONENT_TYPE_SECURITY_CORE = 'SECURITY_CORE'
 EDK_COMPONENT_TYPE_PEI_CORE = SUP_MODULE_PEI_CORE
 EDK_COMPONENT_TYPE_COMBINED_PEIM_DRIVER = 'COMBINED_PEIM_DRIVER'
 EDK_COMPONENT_TYPE_PIC_PEIM = 'PIC_PEIM'
@@ -97,18 +97,18 @@ EDK_NAME = 'EDK'
 EDKII_NAME = 'EDKII'
 
 COMPONENT_TO_MODULE_MAP_DICT = {
-"LIBRARY"   :   SUP_MODULE_BASE,
-"SECURITY_CORE" :   SUP_MODULE_SEC,
-SUP_MODULE_PEI_CORE :   SUP_MODULE_PEI_CORE,
-"COMBINED_PEIM_DRIVER"  :   SUP_MODULE_PEIM,
-"PIC_PEIM"  :   SUP_MODULE_PEIM,
-"RELOCATABLE_PEIM"  :   SUP_MODULE_PEIM,
-"PE32_PEIM" :   SUP_MODULE_PEIM,
-"BS_DRIVER" :   SUP_MODULE_DXE_DRIVER,
-"RT_DRIVER" :   SUP_MODULE_DXE_RUNTIME_DRIVER,
-"SAL_RT_DRIVER" :   SUP_MODULE_DXE_SAL_DRIVER,
-"APPLICATION"   :   SUP_MODULE_UEFI_APPLICATION,
-"LOGO"  :   SUP_MODULE_BASE,
+EDK_COMPONENT_TYPE_LIBRARY   :   SUP_MODULE_BASE,
+EDK_COMPONENT_TYPE_SECURITY_CORE :   SUP_MODULE_SEC,
+EDK_COMPONENT_TYPE_PEI_CORE  :   SUP_MODULE_PEI_CORE,
+EDK_COMPONENT_TYPE_COMBINED_PEIM_DRIVER  :   SUP_MODULE_PEIM,
+EDK_COMPONENT_TYPE_PIC_PEIM  :   SUP_MODULE_PEIM,
+EDK_COMPONENT_TYPE_RELOCATABLE_PEIM  :   SUP_MODULE_PEIM,
+"PE32_PEIM"  :   SUP_MODULE_PEIM,
+EDK_COMPONENT_TYPE_BS_DRIVER :   SUP_MODULE_DXE_DRIVER,
+EDK_COMPONENT_TYPE_RT_DRIVER :   SUP_MODULE_DXE_RUNTIME_DRIVER,
+EDK_COMPONENT_TYPE_SAL_RT_DRIVER :   SUP_MODULE_DXE_SAL_DRIVER,
+EDK_COMPONENT_TYPE_APPLICATION   :   SUP_MODULE_UEFI_APPLICATION,
+"LOGO"   :   SUP_MODULE_BASE,
 }
 
 BINARY_FILE_TYPE_FW = 'FW'
@@ -129,7 +129,7 @@ BINARY_FILE_TYPE_UI = 'UI'
 BINARY_FILE_TYPE_BIN = 'BIN'
 BINARY_FILE_TYPE_FV = 'FV'
 
-PLATFORM_COMPONENT_TYPE_LIBRARY = 'LIBRARY'
+PLATFORM_COMPONENT_TYPE_LIBRARY = EDK_COMPONENT_TYPE_LIBRARY
 PLATFORM_COMPONENT_TYPE_LIBRARY_CLASS = 'LIBRARY_CLASS'
 PLATFORM_COMPONENT_TYPE_MODULE = 'MODULE'
 
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py 
b/BaseTools/Source/Python/GenFds/FdfParser.py
index db8947e4b453..d15656c5fc6c 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -3630,8 +3630,8 @@ class FdfParser:
  SUP_MODULE_DXE_DRIVER, SUP_MODULE_DXE_SAL_DRIVER, 
\
  SUP_MODULE_DXE_SMM_DRIVER, 
SUP_MODULE_DXE_RUNTIME_DRIVER, \
  SUP_MODULE_UEFI_DRIVER, 
SUP_MODULE_UEFI_APPLICATION, SUP_MODULE_USER_DEFINED, "DEFAULT", 
SUP_MODULE_BASE, \
- "SECURITY_CORE", "COMBINED_PEIM_DRIVER", 
"PIC_PEIM", "RELOCATABLE_PEIM", \
-"PE32_PEIM", "BS_DRIVER", "RT_DRIVER", 
"SAL_RT_DRIVER", "APPLICATION", "ACPITABLE", SUP_MODULE_SMM_CORE, 
SUP_MODULE_MM_STANDALONE, SUP_MODULE_MM_CORE_STANDALONE):
+ EDK_COMPONENT_TYPE_SECURITY_CORE, 
EDK_COMPONENT_TYPE_COMBINED_PEIM_DRIVER, EDK_COMPONENT_TYPE_PIC_PEIM, 
EDK_COMPONENT_TYPE_RELOCATABLE_PEIM, \
+"PE32_PEIM", 
EDK_COMPONENT_TYPE_BS_DRIVER, EDK_COMPONENT_TYPE_RT_DRIVER, 

Re: [edk2] [PATCH v1 2/2] MdePkg: IORT Specification Rev D updates

2018-04-26 Thread Ard Biesheuvel
On 26 April 2018 at 17:41, Sami Mujawar  wrote:
> Updated IORT structure definitions to conform to the IO Remapping
> Table, Platform Design Document, Revision D, March 2018.
>
> The following structures have been updated:
>   1. SMMUv3 - fix on proximity node.
>   2. PMCG - added page 1 support.
>   3. Root complex node - added DMA mask (memory address size limit).
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Sami Mujawar 
> Reviewed-by: Evan Lloyd 

Reviewed-by: Ard Biesheuvel 

> ---
> The changes can be seen at:
> https://github.com/samimujawar/edk2/tree/253_iort_update_v1
>
> Notes:
> v1:
> - Updated for IORT Specification Revision D.[SAMI]
>
>  MdePkg/Include/IndustryStandard/IoRemappingTable.h | 10 ++
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/MdePkg/Include/IndustryStandard/IoRemappingTable.h 
> b/MdePkg/Include/IndustryStandard/IoRemappingTable.h
> index 
> 2e5cb45d7e2ffd4a0559ef706b71874843e3fdbd..389f352c2fbc725e5e9a881a73adc306035dc0de
>  100644
> --- a/MdePkg/Include/IndustryStandard/IoRemappingTable.h
> +++ b/MdePkg/Include/IndustryStandard/IoRemappingTable.h
> @@ -1,7 +1,7 @@
>  /** @file
> -  ACPI IO Remapping Table (IORT) as specified in ARM spec DEN0049C
> +  ACPI IO Remapping Table (IORT) as specified in ARM spec DEN0049D
>
> -  
> http://infocenter.arm.com/help/topic/com.arm.doc.den0049c/DEN0049C_IO_Remapping_Table.pdf
> +  
> http://infocenter.arm.com/help/topic/com.arm.doc.den0049d/DEN0049D_IO_Remapping_Table.pdf
>
>Copyright (c) 2017, Linaro Limited. All rights reserved.
>Copyright (c) 2018, ARM Limited. All rights reserved.
> @@ -123,6 +123,8 @@ typedef struct {
>
>UINT32  AtsAttribute;
>UINT32  PciSegmentNumber;
> +  UINT8   MemoryAddressSize;
> +  UINT8   Reserved1[3];
>  } EFI_ACPI_6_0_IO_REMAPPING_RC_NODE;
>
>  ///
> @@ -185,8 +187,7 @@ typedef struct {
>UINT32  Pri;
>UINT32  Gerr;
>UINT32  Sync;
> -  UINT8   ProximityDomain;
> -  UINT8   Reserved1[3];
> +  UINT32  ProximityDomain;
>UINT32  DeviceIdMappingIndex;
>  } EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE;
>
> @@ -199,6 +200,7 @@ typedef struct {
>UINT64  Base;
>UINT32  OverflowInterruptGsiv;
>UINT32  NodeReference;
> +  UINT64  Page1Base;
>  //EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE  OverflowInterruptMsiMapping[1];
>  } EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE;
>
> --
> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
>
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 2/2] MdePkg: IORT Specification Rev D updates

2018-04-26 Thread Sami Mujawar
Updated IORT structure definitions to conform to the IO Remapping
Table, Platform Design Document, Revision D, March 2018.

The following structures have been updated:
  1. SMMUv3 - fix on proximity node.
  2. PMCG - added page 1 support.
  3. Root complex node - added DMA mask (memory address size limit).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
Reviewed-by: Evan Lloyd 
---
The changes can be seen at:
https://github.com/samimujawar/edk2/tree/253_iort_update_v1

Notes:
v1:
- Updated for IORT Specification Revision D.[SAMI]

 MdePkg/Include/IndustryStandard/IoRemappingTable.h | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/IoRemappingTable.h 
b/MdePkg/Include/IndustryStandard/IoRemappingTable.h
index 
2e5cb45d7e2ffd4a0559ef706b71874843e3fdbd..389f352c2fbc725e5e9a881a73adc306035dc0de
 100644
--- a/MdePkg/Include/IndustryStandard/IoRemappingTable.h
+++ b/MdePkg/Include/IndustryStandard/IoRemappingTable.h
@@ -1,7 +1,7 @@
 /** @file
-  ACPI IO Remapping Table (IORT) as specified in ARM spec DEN0049C
+  ACPI IO Remapping Table (IORT) as specified in ARM spec DEN0049D
 
-  
http://infocenter.arm.com/help/topic/com.arm.doc.den0049c/DEN0049C_IO_Remapping_Table.pdf
+  
http://infocenter.arm.com/help/topic/com.arm.doc.den0049d/DEN0049D_IO_Remapping_Table.pdf
 
   Copyright (c) 2017, Linaro Limited. All rights reserved.
   Copyright (c) 2018, ARM Limited. All rights reserved.
@@ -123,6 +123,8 @@ typedef struct {
 
   UINT32  AtsAttribute;
   UINT32  PciSegmentNumber;
+  UINT8   MemoryAddressSize;
+  UINT8   Reserved1[3];
 } EFI_ACPI_6_0_IO_REMAPPING_RC_NODE;
 
 ///
@@ -185,8 +187,7 @@ typedef struct {
   UINT32  Pri;
   UINT32  Gerr;
   UINT32  Sync;
-  UINT8   ProximityDomain;
-  UINT8   Reserved1[3];
+  UINT32  ProximityDomain;
   UINT32  DeviceIdMappingIndex;
 } EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE;
 
@@ -199,6 +200,7 @@ typedef struct {
   UINT64  Base;
   UINT32  OverflowInterruptGsiv;
   UINT32  NodeReference;
+  UINT64  Page1Base;
 //EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE  OverflowInterruptMsiMapping[1];
 } EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE;
 
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


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


[edk2] [PATCH v1 1/2] MdePkg: SMMUv3 updates for IORT table definitions

2018-04-26 Thread Sami Mujawar
Updated the IORT SMMUv3 Node structure and flags to match the
IO Remapping Table, Platform Design Document, Revision C dated
15 MAY 2017.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
Reviewed-by: Evan Lloyd 
Reviewed-by: Ard Biesheuvel 
---
The changes can be seen at:
https://github.com/samimujawar/edk2/tree/253_iort_update_v1

Notes:
v1:
- Updated SMMUv3 node structure and associated flags. [SAMI]
- Patch ACKed by Ard Biesheuvel.  [Ard]
- A new version of the IORT specification has been released.  [Liming]
- This patch was submitted before the new IORT specification
  was published. Submitting separate patch for the IORT spec
  Rev D updated.  [SAMI]

 MdePkg/Include/IndustryStandard/IoRemappingTable.h | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Include/IndustryStandard/IoRemappingTable.h 
b/MdePkg/Include/IndustryStandard/IoRemappingTable.h
index 
c113afdd27843111bc7ad6e1de1108260fad2bbc..2e5cb45d7e2ffd4a0559ef706b71874843e3fdbd
 100644
--- a/MdePkg/Include/IndustryStandard/IoRemappingTable.h
+++ b/MdePkg/Include/IndustryStandard/IoRemappingTable.h
@@ -4,6 +4,7 @@
   
http://infocenter.arm.com/help/topic/com.arm.doc.den0049c/DEN0049C_IO_Remapping_Table.pdf
 
   Copyright (c) 2017, Linaro Limited. 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
@@ -53,6 +54,11 @@
 
 #define EFI_ACPI_IORT_SMMUv3_FLAG_COHAC_OVERRIDEBIT0
 #define EFI_ACPI_IORT_SMMUv3_FLAG_HTTU_OVERRIDE BIT1
+#define EFI_ACPI_IORT_SMMUv3_FLAG_PROXIMITY_DOMAIN  BIT3
+
+#define EFI_ACPI_IORT_SMMUv3_MODEL_GENERIC  0x0
+#define EFI_ACPI_IORT_SMMUv3_MODEL_HISILICON_HI161X 0x1
+#define EFI_ACPI_IORT_SMMUv3_MODEL_CAVIUM_CN99XX0x2
 
 #define EFI_ACPI_IORT_ROOT_COMPLEX_ATS_UNSUPPORTED  0x0
 #define EFI_ACPI_IORT_ROOT_COMPLEX_ATS_SUPPORTED0x1
@@ -165,7 +171,7 @@ typedef struct {
 } EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE;
 
 ///
-/// Node type 4: SMMUv4 node
+/// Node type 4: SMMUv3 node
 ///
 typedef struct {
   EFI_ACPI_6_0_IO_REMAPPING_NODE  Node;
@@ -179,6 +185,9 @@ typedef struct {
   UINT32  Pri;
   UINT32  Gerr;
   UINT32  Sync;
+  UINT8   ProximityDomain;
+  UINT8   Reserved1[3];
+  UINT32  DeviceIdMappingIndex;
 } EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE;
 
 ///
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


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


[edk2] [PATCH v1 0/2] MdePkg: IORT Specification updates

2018-04-26 Thread Sami Mujawar
The IORT specification was updated soon after the patch "MdePkg: SMMUv3
updates for IORT table definitions" (included again in this series) was
submitted.

In response to query regarding the changes for the latest revision (See
https://lists.01.org/pipermail/edk2-devel/2018-March/023295.html);
submitting a separate patch for the IORT specification Rev D, March 2018
updates.

Patchset:
  1. MdePkg: SMMUv3 updates for IORT table definitions
 - Patch already ACKed by Ard Biesheuvel, however has not yet
   been merged in edk2.

  2. MdePkg: IORT Specification Rev D updates
 - Patch for IORT Spec Rev D, March 2018 updates.

Sami Mujawar (2):
  MdePkg: SMMUv3 updates for IORT table definitions
  MdePkg: IORT Specification Rev D updates

 MdePkg/Include/IndustryStandard/IoRemappingTable.h | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


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


Re: [edk2] [PATCH] IntelSiliconPkg MicrocodeUpdateDxe: Honor FIT table

2018-04-26 Thread Yao, Jiewen
Thanks.

Maybe we should also do more test on different FIT table (correct format, or 
wrong format), to check the robustness of the code.

For example, don't use ASSERT to check FIT table content, because it might not 
in Initial Boot Block (IBB) region.

Thank you
Yao Jiewen

> -Original Message-
> From: Zeng, Star
> Sent: Monday, April 23, 2018 1:55 AM
> To: Yao, Jiewen ; edk2-devel@lists.01.org
> Cc: Zhu, Yonghong ; Zeng, Star
> 
> Subject: RE: [PATCH] IntelSiliconPkg MicrocodeUpdateDxe: Honor FIT table
> 
> Yonghong helped run regression test for the cases without FIT table.
> I created below cases with FIT table, checked the boot log and confirmed the
> signature is correct after microcode update.
> 1. Update in situ.
> 2. Empty FIT microcode entry with enough space.
> 3. Unused FIT microcode entry with enough space.
> 
> 
> Thanks,
> Star
> -Original Message-
> From: Yao, Jiewen
> Sent: Monday, April 23, 2018 4:49 PM
> To: Zeng, Star ; edk2-devel@lists.01.org
> Cc: Yao, Jiewen 
> Subject: RE: [PATCH] IntelSiliconPkg MicrocodeUpdateDxe: Honor FIT table
> 
> Thanks for the update.
> 
> Would you please share what unit test has been done for this patch?
> 
> 
> Thank you
> Yao Jiewen
> 
> > -Original Message-
> > From: Zeng, Star
> > Sent: Monday, April 23, 2018 2:57 PM
> > To: edk2-devel@lists.01.org
> > Cc: Zeng, Star ; Yao, Jiewen
> > 
> > Subject: [PATCH] IntelSiliconPkg MicrocodeUpdateDxe: Honor FIT table
> >
> > It is the second step for
> > https://bugzilla.tianocore.org/show_bug.cgi?id=540.
> >
> > Cc: Jiewen Yao 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Star Zeng 
> > ---
> >  .../Capsule/MicrocodeUpdateDxe/MicrocodeFmp.c  | 184
> ++-
> >  .../Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c   | 363
> > +++--
> >  .../Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.h   |  12 +-
> >  .../MicrocodeUpdateDxe/MicrocodeUpdateDxe.inf  |   3 +-
> >  4 files changed, 535 insertions(+), 27 deletions(-)
> >
> > diff --git
> > a/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeFmp.c
> > b/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeFmp.c
> > index ebde93a91eb3..8276aaa0279b 100644
> > ---
> > a/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeFmp.c
> > +++ b/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeFmp.
> > +++ c
> > @@ -272,7 +272,7 @@ FmpSetImage (
> >}
> >
> >Status = MicrocodeWrite(MicrocodeFmpPrivate, (VOID *)Image,
> > ImageSize, >LastAttempt.LastAttemptVersion,
> > >LastAttempt.LastAttemptStatus, AbortReason);
> > -  DEBUG((DEBUG_INFO, "SetImage - LastAttemp Version - 0x%x, State -
> > 0x%x\n", MicrocodeFmpPrivate->LastAttempt.LastAttemptVersion,
> > MicrocodeFmpPrivate->LastAttempt.LastAttemptStatus));
> > +  DEBUG((DEBUG_INFO, "SetImage - LastAttempt Version - 0x%x, Status -
> > 0x%x\n", MicrocodeFmpPrivate->LastAttempt.LastAttemptVersion,
> > MicrocodeFmpPrivate->LastAttempt.LastAttemptStatus));
> >VarStatus = gRT->SetVariable(
> >
> MICROCODE_FMP_LAST_ATTEMPT_VARIABLE_NAME,
> >   , @@ -280,7 +280,7 @@
> > FmpSetImage (
> >   sizeof(MicrocodeFmpPrivate->LastAttempt),
> >   >LastAttempt
> >   );
> > -  DEBUG((DEBUG_INFO, "SetLastAttemp - %r\n", VarStatus));
> > +  DEBUG((DEBUG_INFO, "SetLastAttempt - %r\n", VarStatus));
> >
> >if (!EFI_ERROR(Status)) {
> >  InitializeMicrocodeDescriptor(MicrocodeFmpPrivate);
> > @@ -415,6 +415,159 @@ FmpSetPackageInfo (  }
> >
> >  /**
> > +  Sort FIT microcode entries based upon MicrocodeEntryPoint, from low
> > + to
> > high.
> > +
> > +  @param[in] MicrocodeFmpPrivate private data structure to be initialized.
> > +
> > +**/
> > +VOID
> > +SortFitMicrocodeInfo (
> > +  IN MICROCODE_FMP_PRIVATE_DATA *MicrocodeFmpPrivate
> > +  )
> > +{
> > +  FIT_MICROCODE_INFO*FitMicrocodeEntry;
> > +  FIT_MICROCODE_INFO*NextFitMicrocodeEntry;
> > +  FIT_MICROCODE_INFOTempFitMicrocodeEntry;
> > +  FIT_MICROCODE_INFO*FitMicrocodeEntryEnd;
> > +
> > +  FitMicrocodeEntry = MicrocodeFmpPrivate->FitMicrocodeInfo;
> > +  NextFitMicrocodeEntry = FitMicrocodeEntry + 1;
> > + FitMicrocodeEntryEnd = MicrocodeFmpPrivate->FitMicrocodeInfo +
> > MicrocodeFmpPrivate->FitMicrocodeEntryCount;
> > +  while (FitMicrocodeEntry < FitMicrocodeEntryEnd) {
> > +while (NextFitMicrocodeEntry < FitMicrocodeEntryEnd) {
> > +  if (FitMicrocodeEntry->MicrocodeEntryPoint >
> > NextFitMicrocodeEntry->MicrocodeEntryPoint) {
> > +CopyMem (, FitMicrocodeEntry, sizeof
> > (FIT_MICROCODE_INFO));
> > +CopyMem (FitMicrocodeEntry, NextFitMicrocodeEntry, sizeof
> > (FIT_MICROCODE_INFO));
> > +CopyMem 

Re: [edk2] [Patch] BaseTools: Fix one invalid change in 6be94743

2018-04-26 Thread Carsey, Jaben
Can you also update the comment to match the code please.  I think that the 
comment is wrong and your code is correct, but now they are opposite.  The 
comment says skip (return in context) for no binary files, but the new code 
will skip for modules with binary files...

-Jaben


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Zhu, Yonghong
> Sent: Wednesday, April 25, 2018 11:51 PM
> To: Zhu, Yonghong ; edk2-devel@lists.01.org
> Cc: Feng, YunhuaX ; Gao, Liming
> 
> Subject: Re: [edk2] [Patch] BaseTools: Fix one invalid change in 6be94743
> 
> Reviewed-by: Yonghong Zhu 
> 
> Best Regards,
> Zhu Yonghong
> 
> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Yonghong Zhu
> Sent: Wednesday, April 25, 2018 11:09 AM
> To: edk2-devel@lists.01.org
> Cc: Feng, YunhuaX ; Gao, Liming
> 
> Subject: [edk2] [Patch] BaseTools: Fix one invalid change in 6be94743
> 
> From: Yunhua Feng 
> 
> Roll back one change in 6be94743, it was updated incorrect.
> 
> Cc: Liming Gao 
> Cc: Yonghong Zhu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yunhua Feng 
> ---
>  BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
> b/BaseTools/Source/Python/AutoGen/AutoGen.py
> index 56b5d39..ba83d5a 100644
> --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> @@ -3914,11 +3914,11 @@ class ModuleAutoGen(AutoGen):
>  # Skip the following code for modules with no source files
>  if not self.SourceFileList:
>  return
> 
>  # Skip the following code for modules without any binary files
> -if not self.BinaryFileList:
> +if self.BinaryFileList:
>  return
> 
>  ### TODO: How to handles mixed source and binary modules
> 
>  # Find all DynamicEx and PatchableInModule PCDs used by this module
> and dependent libraries
> --
> 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
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v1 09/18] StandaloneMmPkg/MemoryAllocationLib: Add MM memory allocation library.

2018-04-26 Thread Yao, Jiewen
Same comment as previous 2.

Maybe to separate ARM specific function from generic function.

Thank you



> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Achin
> Gupta
> Sent: Wednesday, April 25, 2018 7:34 AM
> To: Supreeth Venkatesh 
> Cc: ard.biesheu...@linaro.org; edk2-devel@lists.01.org;
> leif.lindh...@linaro.org; Yao, Jiewen ; Gao, Liming
> ; Kinney, Michael D ;
> n...@arm.com
> Subject: Re: [edk2] [PATCH v1 09/18] StandaloneMmPkg/MemoryAllocationLib:
> Add MM memory allocation library.
> 
> Hi Supreeth,
> 
> On Fri, Apr 06, 2018 at 03:42:14PM +0100, Supreeth Venkatesh wrote:
> > This patch implements management mode memory allocation services.The
> > implementation borrows the MM Core Memory Allocation services as the
> > primitive for memory allocation instead of using MM System Table
> > services.
> 
> The commit message did not really register with me. Once the MMRAM ranges
> have
> been conveyed to the MMST memory allocation services (through
> MemoryAllocationLibConstructor()), all functions in MemoryAllocationLib.c use
> the MMST services. The message seems to indicate otherwise.
> 
> On Arm, the gEfiMmPeiMmramMemoryReserveGuid HOB is used to convey the
> MMRAM
> ranges. It seems x86 uses gMmCoreDataHobGuid HOB. So it worth getting this
> reviewed by Jiewen.
> 
> The copyright years in the files need to be updated.
> 
> With that in mind..
> 
> Acked-by: Achin Gupta 
> 
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Achin Gupta 
> > Signed-off-by: Supreeth Venkatesh 
> > ---
> >  StandaloneMmPkg/Include/Guid/MmCoreData.h  | 132 +++
> >  StandaloneMmPkg/Include/Guid/MmramMemoryReserve.h  |  62 ++
> >  .../MemoryAllocationLib/MemoryAllocationLib.c  | 907
> +
> >  .../MemoryAllocationLib/MemoryAllocationLib.inf|  49 ++
> >  .../MemoryAllocationLib/MemoryAllocationServices.h |  38 +
> >  5 files changed, 1188 insertions(+)
> >  create mode 100644 StandaloneMmPkg/Include/Guid/MmCoreData.h
> >  create mode 100644
> StandaloneMmPkg/Include/Guid/MmramMemoryReserve.h
> >  create mode 100644
> StandaloneMmPkg/Library/MemoryAllocationLib/MemoryAllocationLib.c
> >  create mode 100644
> StandaloneMmPkg/Library/MemoryAllocationLib/MemoryAllocationLib.inf
> >  create mode 100644
> StandaloneMmPkg/Library/MemoryAllocationLib/MemoryAllocationServices.h
> >
> > diff --git a/StandaloneMmPkg/Include/Guid/MmCoreData.h
> b/StandaloneMmPkg/Include/Guid/MmCoreData.h
> > new file mode 100644
> > index 00..c0ac772014
> > --- /dev/null
> > +++ b/StandaloneMmPkg/Include/Guid/MmCoreData.h
> > @@ -0,0 +1,132 @@
> > +/** @file
> > +  MM Core data.
> > +
> > +Copyright (c) 2015, Intel Corporation. All rights reserved.
> > +This program and the accompanying materials are licensed and made
> available under
> > +the terms and conditions of the BSD License that accompanies this
> distribution.
> > +The full text of the license may be found at
> > +http://opensource.org/licenses/bsd-license.php.
> > +
> > +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> BASIS,
> > +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
> > +
> > +**/
> > +
> > +#ifndef __MM_CORE_DATA_H__
> > +#define __MM_CORE_DATA_H__
> > +
> > +#define MM_CORE_DATA_HOB_GUID \
> > +  { 0xa160bf99, 0x2aa4, 0x4d7d, { 0x99, 0x93, 0x89, 0x9c, 0xb1, 0x2d, 0xf3,
> 0x76 }}
> > +
> > +extern EFI_GUID gMmCoreDataHobGuid;
> > +
> > +typedef struct {
> > +  //
> > +  // Address pointer to MM_CORE_PRIVATE_DATA
> > +  //
> > +  EFI_PHYSICAL_ADDRESS   Address;
> > +} MM_CORE_DATA_HOB_DATA;
> > +
> > +
> > +///
> > +/// Define values for the communications buffer used when
> gEfiEventDxeDispatchGuid is
> > +/// event signaled.  This event is signaled by the DXE Core each time the 
> > DXE
> Core
> > +/// dispatcher has completed its work.  When this event is signaled, the MM
> Core
> > +/// if notified, so the MM Core can dispatch MM drivers.  If
> COMM_BUFFER_MM_DISPATCH_ERROR
> > +/// is returned in the communication buffer, then an error occurred
> dispatching MM
> > +/// Drivers.  If COMM_BUFFER_MM_DISPATCH_SUCCESS is returned, then
> the MM Core
> > +/// dispatched all the drivers it could.  If
> COMM_BUFFER_MM_DISPATCH_RESTART is
> > +/// returned, then the MM Core just dispatched the MM Driver that
> registered
> > +/// the MM Entry Point enabling the use of MM Mode.  In this case, the MM
> Core
> > +/// should be notified again to dispatch more MM Drivers using MM Mode.
> > +///
> > +#define COMM_BUFFER_MM_DISPATCH_ERROR0x00
> > +#define COMM_BUFFER_MM_DISPATCH_SUCCESS  0x01
> > +#define COMM_BUFFER_MM_DISPATCH_RESTART  0x02
> > +
> > +///
> > +/// Signature for the private structure shared between the MM IPL and the
> MM 

Re: [edk2] [PATCH v1 10/18] StandaloneMmPkg/HobLib: Add AARCH64 Specific HOB Library for management mode.

2018-04-26 Thread Yao, Jiewen
Maybe we can use same layout as MmMemLib.

It seems only HobConstructor() is Arm specific. Other functions are quite 
generic.

Thank you

> -Original Message-
> From: Achin Gupta [mailto:achin.gu...@arm.com]
> Sent: Wednesday, April 25, 2018 7:50 AM
> To: Supreeth Venkatesh 
> Cc: edk2-devel@lists.01.org; Kinney, Michael D ;
> Gao, Liming ; Yao, Jiewen ;
> leif.lindh...@linaro.org; ard.biesheu...@linaro.org; n...@arm.com
> Subject: Re: [PATCH v1 10/18] StandaloneMmPkg/HobLib: Add AARCH64
> Specific HOB Library for management mode.
> 
> Hi Supreeth,
> 
> On Fri, Apr 06, 2018 at 03:42:15PM +0100, Supreeth Venkatesh wrote:
> > The Standalone MM environment is initialized during the SEC phase on ARM
> > Standard Platforms. The MM Core driver implements an entry point module
> > which is architecture specific and runs prior to the generic core driver
> > code. The former creates a Hob list that the latter consumes. This
> > happens in the same phase.
> >
> > This patch implements a Hob library that can be used by the entry point
> > module to produce a Hob list and by the core driver code to consume it.
> 
> References to DXE core need to be removed and the copyright years needs to be
> updated.
> 
> I think it is worth getting this hoblib reviewed by the ArmPkg maintainers.
> 
> Acked-by: Achin Gupta 
> 
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Achin Gupta 
> > Signed-off-by: Supreeth Venkatesh 
> > ---
> >  StandaloneMmPkg/Library/HobLib/Arm/HobLib.c | 697
> 
> >  StandaloneMmPkg/Library/HobLib/HobLib.inf   |  45 ++
> >  2 files changed, 742 insertions(+)
> >  create mode 100644 StandaloneMmPkg/Library/HobLib/Arm/HobLib.c
> >  create mode 100644 StandaloneMmPkg/Library/HobLib/HobLib.inf
> >
> > diff --git a/StandaloneMmPkg/Library/HobLib/Arm/HobLib.c
> b/StandaloneMmPkg/Library/HobLib/Arm/HobLib.c
> > new file mode 100644
> > index 00..62abf47f95
> > --- /dev/null
> > +++ b/StandaloneMmPkg/Library/HobLib/Arm/HobLib.c
> > @@ -0,0 +1,697 @@
> > +/** @file
> > +  HOB Library implementation for DxeCore driver.
> > +
> > +Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
> > +Copyright (c) 2017, 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 
> > +
> > +//
> > +// Cache copy of HobList pointer.
> > +//
> > +VOID *gHobList = NULL;
> > +
> > +/**
> > +  Returns the pointer to the HOB list.
> > +
> > +  This function returns the pointer to first HOB in the list.
> > +  For PEI phase, the PEI service GetHobList() can be used to retrieve the
> pointer
> > +  to the HOB list.  For the DXE phase, the HOB list pointer can be 
> > retrieved
> through
> > +  the EFI System Table by looking up theHOB list GUID in the System
> Configuration Table.
> > +  Since the System Configuration Table does not exist that the time the DXE
> Core is
> > +  launched, the DXE Core uses a global variable from the DXE Core Entry
> Point Library
> > +  to manage the pointer to the HOB list.
> > +
> > +  If the pointer to the HOB list is NULL, then ASSERT().
> > +
> > +  @return The pointer to the HOB list.
> > +
> > +**/
> > +VOID *
> > +EFIAPI
> > +GetHobList (
> > +  VOID
> > +  )
> > +{
> > +  ASSERT (gHobList != NULL);
> > +  return gHobList;
> > +}
> > +
> > +/**
> > +  Returns the next instance of a HOB type from the starting HOB.
> > +
> > +  This function searches the first instance of a HOB type from the starting
> HOB pointer.
> > +  If there does not exist such HOB type from the starting HOB pointer, it 
> > will
> return NULL.
> > +  In contrast with macro GET_NEXT_HOB(), this function does not skip the
> starting HOB pointer
> > +  unconditionally: it returns HobStart back if HobStart itself meets the
> requirement;
> > +  caller is required to use GET_NEXT_HOB() if it wishes to skip current
> HobStart.
> > +
> > +  If HobStart is NULL, then ASSERT().
> > +
> > +  @param  Type  The HOB type to return.
> > +  @param  HobStart  The starting HOB pointer to search from.
> > +
> > +  @return The next instance of a HOB type from the starting HOB.
> > +
> > +**/
> > +VOID *
> > +EFIAPI
> > +GetNextHob (
> > +  IN UINT16 Type,
> > +  IN CONST VOID *HobStart
> > +  )
> > +{
> > +  

Re: [edk2] [PATCH v1 08/18] StandaloneMmPkg/MemLib: AARCH64 Specific instance of memory check library.

2018-04-26 Thread Yao, Jiewen
You are right.

I propose to add Arm and X86 specific folder - just include PA calculation.
We can leave the generic function in common folder.

The final layout can be:
StandaloneMmPkg/Library/MmMemLib/MmMemLib.c
StandaloneMmPkg/Library/MmMemLib/MmMemLib.inf
StandaloneMmPkg/Library/MmMemLib/Arm/ArchSpecific.c
StandaloneMmPkg/Library/MmMemLib/AArch64/ArchSpecific.c 
StandaloneMmPkg/Library/MmMemLib/Ia32/ArchSpecific.c
StandaloneMmPkg/Library/MmMemLib/X64/ArchSpecific.c

Thank you
Yao Jiewen

> -Original Message-
> From: Achin Gupta [mailto:achin.gu...@arm.com]
> Sent: Wednesday, April 25, 2018 3:36 AM
> To: Yao, Jiewen 
> Cc: Supreeth Venkatesh ;
> ard.biesheu...@linaro.org; edk2-devel@lists.01.org; leif.lindh...@linaro.org;
> Gao, Liming ; Kinney, Michael D
> ; n...@arm.com
> Subject: Re: [edk2] [PATCH v1 08/18] StandaloneMmPkg/MemLib: AARCH64
> Specific instance of memory check library.
> 
> Hi Jiewen,
> 
> On Mon, Apr 16, 2018 at 10:30:55PM +, Yao, Jiewen wrote:
> > Hi
> > I don't think this lib is generic, because it hardcode the physical address 
> > bits.
> >
> > PhysicalAddressBits = 36;
> >
> > For X86 CPU, we get it from CPUID. :-)
> >
> > As enhancement, we may put most common C-code logic (such as CopyMem,
> or memmap calculation) to StandaloneMmPkg/MemLib, and only include the
> PhysicalAddresBit calculation under StandaloneMmPkg/MemLib/Arm folder.
> >
> > As such, we know clearly on which one is ARM specific.
> 
> My point was that the hardocoded PA bits were not introduced to make this code
> work on Arm. This has been present in the StandaloneMmPkg from the outset. I
> guess for x86 you have moved on to getting this information from the
> CPUID. Afaics, this function is not be used on Arm platforms but Supreeth will
> double check. If that is the case then only the generic library will be 
> required
> minus this function.
> 
> cheers,
> Achin
> 
> >
> > Thank you
> > Yao Jiewen
> >
> > > -Original Message-
> > > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Achin
> > > Gupta
> > > Sent: Monday, April 16, 2018 11:13 PM
> > > To: Supreeth Venkatesh 
> > > Cc: ard.biesheu...@linaro.org; edk2-devel@lists.01.org;
> > > leif.lindh...@linaro.org; Yao, Jiewen ; Gao, Liming
> > > ; Kinney, Michael D ;
> > > n...@arm.com
> > > Subject: Re: [edk2] [PATCH v1 08/18] StandaloneMmPkg/MemLib: AARCH64
> > > Specific instance of memory check library.
> > >
> > > Hi Supreeth,
> > >
> > > On Fri, Apr 06, 2018 at 03:42:13PM +0100, Supreeth Venkatesh wrote:
> > > > MM memory check library library implementation. This library consumes
> > > > MM_ACCESS_PROTOCOL to get MMRAM information. In order to use this
> > > > library instance, the platform should produce all MMRAM range via
> > > > MM_ACCESS_PROTOCOL, including the range for firmware (like MM Core
> > > > and MM driver) and/or specific dedicated hardware.
> > > >
> > > > This patch provides services for MM Memory Operation.
> > > > The management mode Mem Library provides function for checking if
> buffer
> > > > is outside MMRAM and valid. It also provides functions for copy data
> > > > from MMRAM to non-MMRAM, from non-MMRAM to MMRAM,
> > > > from non-MMRAM to non-MMRAM, or set data in non-MMRAM.
> > > >
> > > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > > Signed-off-by: Achin Gupta 
> > > > Signed-off-by: Supreeth Venkatesh 
> > > > ---
> > > >  StandaloneMmPkg/Include/Library/MemLib.h| 140
> ++
> > > >  StandaloneMmPkg/Library/MemLib/Arm/MemLib.c | 276
> > > 
> > >
> > > Why is this Library Arm specific. Apart from cosmetics tweaks, it has not
> > > changed since it was originally contributed?
> > >
> > > cheers,
> > > Achin
> > >
> > > >  StandaloneMmPkg/Library/MemLib/MemLib.inf   |  47 +
> > > >  3 files changed, 463 insertions(+)
> > > >  create mode 100644 StandaloneMmPkg/Include/Library/MemLib.h
> > > >  create mode 100644 StandaloneMmPkg/Library/MemLib/Arm/MemLib.c
> > > >  create mode 100644 StandaloneMmPkg/Library/MemLib/MemLib.inf
> > > >
> > > > diff --git a/StandaloneMmPkg/Include/Library/MemLib.h
> > > b/StandaloneMmPkg/Include/Library/MemLib.h
> > > > new file mode 100644
> > > > index 00..3264f10010
> > > > --- /dev/null
> > > > +++ b/StandaloneMmPkg/Include/Library/MemLib.h
> > > > @@ -0,0 +1,140 @@
> > > > +/** @file
> > > > +  Provides services for MM Memory Operation.
> > > > +
> > > > +  The MM Mem Library provides function for checking if buffer is 
> > > > outside
> > > MMRAM and valid.
> > > > +  It also provides functions for copy data from MMRAM to non-MMRAM,
> > > from non-MMRAM to MMRAM,
> > > > +  from non-MMRAM to non-MMRAM, or set data in non-MMRAM.
> > > > 

[edk2] [PATCH v1] Platforms/ARM: Enable acpiview support

2018-04-26 Thread Sami Mujawar
Acpiview is a program that allows examination of ACPI table
contents from the UEFI Shell.

Enable acpiview support as this can help with investigations,
especially at that stage where the tables are not enabling an
OS to boot.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
Reviewed-by: Evan Lloyd 
---
The patch can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/254_enable_acpiview_v1

Notes:
v1:
- Enable acpiview support in the UEFI shell for ARM platforms.  [SAMI]

 Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc 
b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
index 
7cb47937329efa1944ec4c156e2be995a755ce6f..0badb24f030a58363e7bee22a7cc1e03040b60aa
 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
+#  Copyright (c) 2011-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
@@ -450,6 +450,7 @@ [Components.common]
   
NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
   
NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
   
NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
+  
NULL|ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf
   
HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
   
BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


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


[edk2] [PATCH 3/3] Platform/ARM: Fix NOR Flash dependency for CTA15A7

2018-04-26 Thread Sami Mujawar
The correct load order for the NOR Flash driver and Runtime Variables
to work is as below:
1. Arm CPU Architecture Protocol Dxe
2. NOR Flash Dxe
3. Runtime Variable Dxe

NvVarStoreFormattedLib was recently introduced to resolve the dependency
order and more details can be seen at
https://github.com/tianocore/edk2/compare/master...lersek:depex_fixes

This patch propagates the necessary changes for ARM VExpress CTA15+A7
platform and also fixes the "Firmware Volume for Variable Store is
corrupted" error seen when the Flash is erased (or not formatted).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
Signed-off-by: Alexei Fedorov 
---
The changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/255_firmware_volume_issue_v1

Notes:
v1:
- Fixed firmware volume variable store corrupt issue.   [SAMI]

 Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc 
b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
index 
6c6c8d3938e61abf7456b4c2cd6b464c0238353b..8f35b8a4a958867066d4e08bcc5dba7793e5f52d
 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
@@ -215,6 +215,7 @@ [Components.common]
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
 
   NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
+  
NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   }
   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


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


Re: [edk2] [PATCH v2] OvmfPkg/QemuVideoDxe: round up FrameBufferSize to full page

2018-04-26 Thread Laszlo Ersek
On 04/26/18 09:02, Gerd Hoffmann wrote:
> Guests do the same, because the framebuffer is mapped somewhere, which
> obviously works with page granularity only.
> 
> When not rounding up to full page size we get messages like this one
> (linux kernel):
> 
> efifb: framebuffer at 0x8000, using 1876k, total 1875k
> ^^
> Also sysfb is confused and throws an error:
> 
> sysfb: VRAM smaller than advertised
> 
> Cc: Phil Dennis-Jordan 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Gerd Hoffmann 
> ---
>  OvmfPkg/QemuVideoDxe/Gop.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c
> index d51efc2a83..88142bf376 100644
> --- a/OvmfPkg/QemuVideoDxe/Gop.c
> +++ b/OvmfPkg/QemuVideoDxe/Gop.c
> @@ -69,6 +69,7 @@ QemuVideoCompleteModeData (
>Mode->FrameBufferBase = FrameBufDesc->AddrRangeMin;
>Mode->FrameBufferSize = Info->HorizontalResolution * 
> Info->VerticalResolution;
>Mode->FrameBufferSize = Mode->FrameBufferSize * ((ModeData->ColorDepth + 
> 7) / 8);
> +  Mode->FrameBufferSize = 
> EFI_PAGES_TO_SIZE(EFI_SIZE_TO_PAGES(Mode->FrameBufferSize));
>DEBUG ((EFI_D_INFO, "FrameBufferBase: 0x%Lx, FrameBufferSize: 0x%Lx\n",
>  Mode->FrameBufferBase, (UINT64)Mode->FrameBufferSize));
>  
> @@ -107,6 +108,7 @@ QemuVideoVmwareSvgaCompleteModeData (
>  
>Mode->FrameBufferBase = FrameBufDesc->AddrRangeMin + FbOffset;
>Mode->FrameBufferSize = BytesPerLine * Info->VerticalResolution;
> +  Mode->FrameBufferSize = 
> EFI_PAGES_TO_SIZE(EFI_SIZE_TO_PAGES(Mode->FrameBufferSize));
>  
>FreePool (FrameBufDesc);
>return Status;
> 

Reviewed-by: Laszlo Ersek 
[ler...@redhat.com: fix coding style]

Commit dd7760470fce.

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


Re: [edk2] [PATCH] CryptoPkg/OpensslLib: remove OpenSSL version number from OpenSSL-HOWTO.txt

2018-04-26 Thread Laszlo Ersek
On 04/26/18 02:47, Long, Qin wrote:
> Yes, this was not refreshed at last upgrade. And I agree it's better to 
> remove this statement.
> 
> Reviewed-by: Long Qin 
> 

Thank you, commit e31fe995b81b.

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


Re: [edk2] [PATCH v1 0/2] Fix for variable store corrupt issue

2018-04-26 Thread Leif Lindholm
On Thu, Apr 26, 2018 at 09:47:17AM +, Sami Mujawar wrote:
> Hi Ard,
> 
> I do not have the setup currently to test ArmVExpress-CTA15-A7. However, I 
> think it will need this change as well. 
> Please ignore this patchset, I will send another one shortly. 

No need to resubmit the whole set - just send out a 3/3 to go on top
of this.

Regards,

Leif

> Regards,
> 
> Sami Mujawar
> -Original Message-
> From: Ard Biesheuvel  
> Sent: 26 April 2018 10:44 AM
> To: Sami Mujawar 
> Cc: edk2-devel@lists.01.org; Arvind Chauhan ; Daniil 
> Egranov ; Thomas Abraham ; 
> Leif Lindholm ; Matteo Carlini 
> ; Stephanie Hughes-Fitt 
> ; nd ; Evan Lloyd 
> ; Alexei Fedorov ; Kinney, 
> Michael D 
> Subject: Re: [PATCH v1 0/2] Fix for variable store corrupt issue
> 
> On 26 April 2018 at 11:32, Sami Mujawar  wrote:
> > These patches fix the "Firmware Volume for Variable Store is 
> > corrupted" issue which is seen when the Flash is erased or not 
> > formatted.
> >
> > Sami Mujawar (2):
> >   Platform/ARM: Fix NOR Flash dependency for Juno
> >   Platform/ARM: Fix NOR Flash dependency for FVP
> >
> >  Platform/ARM/JunoPkg/ArmJuno.dsc | 1 +
> >  Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 1 +
> >  2 files changed, 2 insertions(+)
> >
> 
> Hello Sami,
> 
> Does ArmVExpress-CTA15-A7.dsc need this change as well?
> 
> --
> Ard.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v5 0/2] add platform boot options

2018-04-26 Thread Laszlo Ersek
On 04/26/18 05:12, Haojian Zhuang wrote:
> On 26 April 2018 at 00:10, Laszlo Ersek  wrote:

>> (4) In both patches, in both of the CreatePlatformBootOptionFromPath()
>> and CreatePlatformBootOptionFromGuid() helper functions, the
>> "DevicePath" variable is leaked when
>> EfiBootManagerInitializeLoadOption() fails.
>>
>> "DevicePath" should be freed unconditionally at that point, in both
>> patches and in both helper functions (4 instances in total). Simply
>> eliminate the following:
>>
>>   if (EFI_ERROR (Status)) {
>> return Status;
>>   }
>>
>> and you will be left with:
>>
>>   Status = EfiBootManagerInitializeLoadOption (
>>  ...
>>  );
>>   FreePool (DevicePath);
>>   return Status;
>>
>> I believe I need not separately review this update either.
>>
> 
> For this one, I have a different opinion.
> 
> EFI_STATUS
> EFIAPI
> EfiBootManagerInitializeLoadOption (
>   ...
>   )
> {
>   if ((Option == NULL) || (Description == NULL) || (FilePath == NULL)) {
> return EFI_INVALID_PARAMETER;
>   }
> 
>   if (((OptionalData != NULL) && (OptionalDataSize == 0)) ||
>   ((OptionalData == NULL) && (OptionalDataSize != 0))) {
> return EFI_INVALID_PARAMETER;
>   }
>   if ((UINT32) OptionType >= LoadOptionTypeMax) {
> return EFI_INVALID_PARAMETER;
>   }
> 
>   ZeroMem (Option, sizeof (EFI_BOOT_MANAGER_LOAD_OPTION));
>   Option->OptionNumber   = OptionNumber;
>   Option->OptionType = OptionType;
>   Option->Attributes = Attributes;
>   Option->Description= AllocateCopyPool (StrSize
> (Description), Description);
>   Option->FilePath   = DuplicateDevicePath (FilePath);
>   if (OptionalData != NULL) {
> Option->OptionalData = AllocateCopyPool (OptionalDataSize,
> OptionalData);
> Option->OptionalDataSize = OptionalDataSize;
>   }
> 
>   return EFI_SUCCESS;
> }
> 
> We can find that no memory is allocated to "DevicePath" if it returns
> with error.
> 
> So we shouldn't free memory on "DevicePath" if "Status" is error code.

I disagree. We have:

  CreatePlatformBootOptionFromPath()
DevicePath = ConvertTextToDevicePath(...)  #1
EfiBootManagerInitializeLoadOption(... DevicePath ...)
  DuplicateDevicePath(FilePath=DevicePath) #2

The ConvertTextToDevicePath() function returns the binary representation
of the device path in a dynamically allocated area. That is dynamic
object #1, tracked by the "DevicePath" variable. Then,
EfiBootManagerInitializeLoadOption() creates a deep copy, by calling the
DuplicateDevicePath() function. That creates dynamic object #2, tracked
by Option->FilePath.

- If EfiBootManagerInitializeLoadOption() returns with failure, then
dynamic object #2 does not exist, and we no longer need dynamic object
#1, so we have to free dynamic object #1.

- If EfiBootManagerInitializeLoadOption() returns with success, then
dynamic object #2 exists, and is correctly tracked by Option->FilePath.
We no longer need dynamic object #1, so we have to free it.

In other words, regardless of the return status of
EfiBootManagerInitializeLoadOption(), we must release dynamic object #1.
We need dynamic object #1 only temporarily, so we can call
EfiBootManagerInitializeLoadOption(), and let it make a copy.

The same applies to CreatePlatformBootOptionFromGuid(), except replace
ConvertTextToDevicePath() with AppendDevicePathNode():

  CreatePlatformBootOptionFromGuid()
DevicePath = AppendDevicePathNode(...)  #1
EfiBootManagerInitializeLoadOption (... DevicePath ...)
  DuplicateDevicePath(FilePath=DevicePath)  #2

Again, AppendDevicePathNode() produces dynamic object #1, similarly to
ConvertTextToDevicePath().

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


Re: [edk2] [PATCH v1 0/2] Fix for variable store corrupt issue

2018-04-26 Thread Sami Mujawar
Hi Ard,

I do not have the setup currently to test ArmVExpress-CTA15-A7. However, I 
think it will need this change as well. 
Please ignore this patchset, I will send another one shortly. 

Regards,

Sami Mujawar
-Original Message-
From: Ard Biesheuvel  
Sent: 26 April 2018 10:44 AM
To: Sami Mujawar 
Cc: edk2-devel@lists.01.org; Arvind Chauhan ; Daniil 
Egranov ; Thomas Abraham ; Leif 
Lindholm ; Matteo Carlini ; 
Stephanie Hughes-Fitt ; nd ; Evan 
Lloyd ; Alexei Fedorov ; Kinney, 
Michael D 
Subject: Re: [PATCH v1 0/2] Fix for variable store corrupt issue

On 26 April 2018 at 11:32, Sami Mujawar  wrote:
> These patches fix the "Firmware Volume for Variable Store is 
> corrupted" issue which is seen when the Flash is erased or not 
> formatted.
>
> Sami Mujawar (2):
>   Platform/ARM: Fix NOR Flash dependency for Juno
>   Platform/ARM: Fix NOR Flash dependency for FVP
>
>  Platform/ARM/JunoPkg/ArmJuno.dsc | 1 +
>  Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 1 +
>  2 files changed, 2 insertions(+)
>

Hello Sami,

Does ArmVExpress-CTA15-A7.dsc need this change as well?

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


Re: [edk2] [PATCH v1 0/2] Fix for variable store corrupt issue

2018-04-26 Thread Ard Biesheuvel
On 26 April 2018 at 11:32, Sami Mujawar  wrote:
> These patches fix the "Firmware Volume for Variable Store is
> corrupted" issue which is seen when the Flash is erased or
> not formatted.
>
> Sami Mujawar (2):
>   Platform/ARM: Fix NOR Flash dependency for Juno
>   Platform/ARM: Fix NOR Flash dependency for FVP
>
>  Platform/ARM/JunoPkg/ArmJuno.dsc | 1 +
>  Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 1 +
>  2 files changed, 2 insertions(+)
>

Hello Sami,

Does ArmVExpress-CTA15-A7.dsc need this change as well?

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


[edk2] [PATCH v1 0/2] Fix for variable store corrupt issue

2018-04-26 Thread Sami Mujawar
These patches fix the "Firmware Volume for Variable Store is
corrupted" issue which is seen when the Flash is erased or
not formatted.

Sami Mujawar (2):
  Platform/ARM: Fix NOR Flash dependency for Juno
  Platform/ARM: Fix NOR Flash dependency for FVP

 Platform/ARM/JunoPkg/ArmJuno.dsc | 1 +
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 1 +
 2 files changed, 2 insertions(+)

-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


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


[edk2] [PATCH 2/2] Platform/ARM: Fix NOR Flash dependency for FVP

2018-04-26 Thread Sami Mujawar
The correct load order for the NOR Flash driver and Runtime Variables
to work is as below:
1. Arm CPU Architecture Protocol Dxe
2. NOR Flash Dxe
3. Runtime Variable Dxe

NvVarStoreFormattedLib was recently introduced to resolve the dependency
order and more details can be seen at
https://github.com/tianocore/edk2/compare/master...lersek:depex_fixes

This patch propagates the necessary changes for ARM FVP platform and
also fixes the "Firmware Volume for Variable Store is corrupted" error
seen when the Flash is erased (or not formatted).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
Signed-off-by: Alexei Fedorov 
---
The changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/255_firmware_volume_issue_v1

Notes:
v1:
- Fixed firmware volume variable store corrupt issue.   [SAMI]

 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc 
b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
index 
cdf9e2d49784d542701dc84eb511f592e77ec106..e0539d6a01363a3f2ae8e42d1a9e4125711b834f
 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
@@ -229,6 +229,7 @@ [Components.common]
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
 
   NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
+  
NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   }
   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


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


[edk2] [PATCH 1/2] Platform/ARM: Fix NOR Flash dependency for Juno

2018-04-26 Thread Sami Mujawar
The correct load order for the NOR Flash driver and Runtime Variables
to work is as below:
1. Arm CPU Architecture Protocol Dxe
2. NOR Flash Dxe
3. Runtime Variable Dxe

NvVarStoreFormattedLib was recently introduced to resolve the dependency
order and more details can be seen at
https://github.com/tianocore/edk2/compare/master...lersek:depex_fixes

This patch propagates the necessary changes for ARM Juno platform and
also fixes the "Firmware Volume for Variable Store is corrupted" error
seen when the Flash is erased (or not formatted).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
Signed-off-by: Alexei Fedorov 
---
The changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/255_firmware_volume_issue_v1

Notes:
v1:
- Fixed firmware volume variable store corrupt issue.   [SAMI]

 Platform/ARM/JunoPkg/ArmJuno.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index 
d5e87f1edfd5d60a543e51cb42dfbcc4489d3f7d..a10476fa135d0eccbed3d0eaf8cb02b26617c2eb
 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -255,6 +255,7 @@ [Components.common]
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
 
   NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
+  
NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   }
   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


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


Re: [edk2] [PATCH] MdeModulePkg/ConPlatform: Support short-form USB device path

2018-04-26 Thread Zeng, Star
Ray,

Some minor comments below.

1. How MSG_USB_DP and HW_PCCARD_DP be handled? We see they are checked in 
original IsHotPlugDevice()?

2. gEfiUsbIoProtocolGuid needs be stated in ConPlatformDxe.inf?

3. The comment " If it is not a hot-plug device, append the device path to " in 
ConPlatformTextInDriverBindingStart()/ConPlatformTextOutDriverBindingStart() 
needs be updated accordingly since IsHotPlugDevice() will be removed?


Thanks,
Star
-Original Message-
From: Ni, Ruiyu 
Sent: Wednesday, April 25, 2018 1:44 PM
To: edk2-devel@lists.01.org
Cc: Wu, Hao A ; Kinney, Michael D 
; Zeng, Star 
Subject: [PATCH] MdeModulePkg/ConPlatform: Support short-form USB device path

Today's implementation does an exact device path match to check
whether the device path of a console is in ConIn/ConOut/ErrOut.
But that doesn't work for the USB keyboard.
Because when a platform have multiple USB port, ConIn needs to
carry all device paths corresponding to each port.
Even worse, today's BDS core logic removes the device path from
ConIn/ConOut/ErrOut when the connection to that device path fails.
So if user switches the USB keyboard from one port to another across
boot, the USB keyboard doesn't work in the second boot.

ConPlatform driver solved this problem by adding the
IsHotPlugDevice() function. So that for USB keyboard, ConPlatform
doesn't care whether its device path is in ConIn or not.
But the rule is too loose, and now causes platform BDS cannot control
whether to enable USB keyboard as an active console.

The patch changes ConPlatform to support USB short-form device path
when checking whether the device path of a console is in
ConIn/ConOut/ErrOut.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Hao A Wu 
Cc: Michael D Kinney 
Cc: Star Zeng 
---
 .../Universal/Console/ConPlatformDxe/ConPlatform.c | 526 ++---
 .../Universal/Console/ConPlatformDxe/ConPlatform.h |  20 +-
 2 files changed, 353 insertions(+), 193 deletions(-)

diff --git a/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c 
b/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c
index 6b53e8ac74..a509d0e3a5 100644
--- a/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c
+++ b/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c
@@ -2,7 +2,7 @@
   Console Platform DXE Driver, install Console Device Guids and update Console
   Environment Variables.
 
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -270,58 +270,33 @@ ConPlatformTextInDriverBindingStart (
   }
 
   //
-  // Check the device path, if it is a hot plug device,
-  // do not put the device path into ConInDev, and install
-  // gEfiConsoleInDeviceGuid to the device handle directly.
-  // The policy is, make hot plug device plug in and play immediately.
+  // If it is not a hot-plug device, append the device path to the
+  // ConInDev environment variable
   //
-  if (IsHotPlugDevice (DevicePath)) {
+  ConPlatformUpdateDeviceVariable (
+L"ConInDev",
+DevicePath,
+Append
+);
+
+  //
+  // If the device path is an instance in the ConIn environment variable,
+  // then install EfiConsoleInDeviceGuid onto ControllerHandle
+  //
+  if (IsInConInVariable) {
 gBS->InstallMultipleProtocolInterfaces (
,
,
NULL,
NULL
);
-//
-// Append the device path to ConInDev only if it is in ConIn variable.
-//
-if (IsInConInVariable) {
-  ConPlatformUpdateDeviceVariable (
-L"ConInDev",
-DevicePath,
-Append
-);
-}
   } else {
-//
-// If it is not a hot-plug device, append the device path to the
-// ConInDev environment variable
-//
-ConPlatformUpdateDeviceVariable (
-  L"ConInDev",
-  DevicePath,
-  Append
-  );
-
-//
-// If the device path is an instance in the ConIn environment variable,
-// then install EfiConsoleInDeviceGuid onto ControllerHandle
-//
-if (IsInConInVariable) {
-  gBS->InstallMultipleProtocolInterfaces (
- ,
- ,
- NULL,
- NULL
- );
-} else {
-  gBS->CloseProtocol (
- ControllerHandle,
- ,
- This->DriverBindingHandle,
- ControllerHandle
- );
-}
+gBS->CloseProtocol (
+   ControllerHandle,
+   ,
+   This->DriverBindingHandle,
+   ControllerHandle
+   );
   }
 
   return EFI_SUCCESS;
@@ 

[edk2] [PATCH v2] OvmfPkg/QemuVideoDxe: round up FrameBufferSize to full page

2018-04-26 Thread Gerd Hoffmann
Guests do the same, because the framebuffer is mapped somewhere, which
obviously works with page granularity only.

When not rounding up to full page size we get messages like this one
(linux kernel):

efifb: framebuffer at 0x8000, using 1876k, total 1875k
^^
Also sysfb is confused and throws an error:

sysfb: VRAM smaller than advertised

Cc: Phil Dennis-Jordan 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Gerd Hoffmann 
---
 OvmfPkg/QemuVideoDxe/Gop.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c
index d51efc2a83..88142bf376 100644
--- a/OvmfPkg/QemuVideoDxe/Gop.c
+++ b/OvmfPkg/QemuVideoDxe/Gop.c
@@ -69,6 +69,7 @@ QemuVideoCompleteModeData (
   Mode->FrameBufferBase = FrameBufDesc->AddrRangeMin;
   Mode->FrameBufferSize = Info->HorizontalResolution * 
Info->VerticalResolution;
   Mode->FrameBufferSize = Mode->FrameBufferSize * ((ModeData->ColorDepth + 7) 
/ 8);
+  Mode->FrameBufferSize = 
EFI_PAGES_TO_SIZE(EFI_SIZE_TO_PAGES(Mode->FrameBufferSize));
   DEBUG ((EFI_D_INFO, "FrameBufferBase: 0x%Lx, FrameBufferSize: 0x%Lx\n",
 Mode->FrameBufferBase, (UINT64)Mode->FrameBufferSize));
 
@@ -107,6 +108,7 @@ QemuVideoVmwareSvgaCompleteModeData (
 
   Mode->FrameBufferBase = FrameBufDesc->AddrRangeMin + FbOffset;
   Mode->FrameBufferSize = BytesPerLine * Info->VerticalResolution;
+  Mode->FrameBufferSize = 
EFI_PAGES_TO_SIZE(EFI_SIZE_TO_PAGES(Mode->FrameBufferSize));
 
   FreePool (FrameBufDesc);
   return Status;
-- 
2.9.3

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


Re: [edk2] [PATCH] MdeModulePkg/ConPlatform: Support short-form USB device path

2018-04-26 Thread Ni, Ruiyu

> -Original Message-
> From: edk2-devel  On Behalf Of Laszlo
> Ersek
> Sent: Wednesday, April 25, 2018 10:16 PM
> To: Ni, Ruiyu 
> Cc: Wu, Hao A ; Kinney, Michael D
> ; edk2-devel@lists.01.org; Zeng, Star
> 
> Subject: Re: [edk2] [PATCH] MdeModulePkg/ConPlatform: Support short-
> form USB device path
> 
> Hello Ray,
> 
> On 04/25/18 07:44, Ruiyu Ni wrote:
> > Today's implementation does an exact device path match to check
> > whether the device path of a console is in ConIn/ConOut/ErrOut.
> > But that doesn't work for the USB keyboard.
> > Because when a platform have multiple USB port, ConIn needs to carry
> > all device paths corresponding to each port.
> > Even worse, today's BDS core logic removes the device path from
> > ConIn/ConOut/ErrOut when the connection to that device path fails.
> > So if user switches the USB keyboard from one port to another across
> > boot, the USB keyboard doesn't work in the second boot.
> >
> > ConPlatform driver solved this problem by adding the
> > IsHotPlugDevice() function. So that for USB keyboard, ConPlatform
> > doesn't care whether its device path is in ConIn or not.
> > But the rule is too loose, and now causes platform BDS cannot control
> > whether to enable USB keyboard as an active console.
> >
> > The patch changes ConPlatform to support USB short-form device path
> > when checking whether the device path of a console is in
> > ConIn/ConOut/ErrOut.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Ruiyu Ni 
> > Cc: Hao A Wu 
> > Cc: Michael D Kinney 
> > Cc: Star Zeng 
> > ---
> >  .../Universal/Console/ConPlatformDxe/ConPlatform.c | 526
> > ++---
> > .../Universal/Console/ConPlatformDxe/ConPlatform.h |  20 +-
> >  2 files changed, 353 insertions(+), 193 deletions(-)
> 
> just a quick question: in OvmfPkg and ArmVirtPkg (more precisely:
> ArmVirtQemu*), we add a "wild card" USB keyboard to ConIn:
> 
> > STATIC PLATFORM_USB_KEYBOARD mUsbKeyboard = {
> >   //
> >   // USB_CLASS_DEVICE_PATH Keyboard
> >   //
> >   {
> > {
> >   MESSAGING_DEVICE_PATH, MSG_USB_CLASS_DP,
> >   DP_NODE_LEN (USB_CLASS_DEVICE_PATH)
> > },
> > 0x, // VendorId: any
> > 0x, // ProductId: any
> > 3,  // DeviceClass: HID
> > 1,  // DeviceSubClass: boot
> > 1   // DeviceProtocol: keyboard
> >   },
> >
> >   //
> >   // EFI_DEVICE_PATH_PROTOCOL End
> >   //
> >   {
> > END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE,
> > DP_NODE_LEN (EFI_DEVICE_PATH_PROTOCOL)
> >   }
> > };
> >
> > [...]
> >
> >   //
> >   // Add the hardcoded short-form USB keyboard device path to ConIn.
> >   //
> >   EfiBootManagerUpdateConsoleVariable (ConIn,
> > (EFI_DEVICE_PATH_PROTOCOL *), NULL);
> 
> The idea is to connect any USB keyboard(s) that the virtual machine might
> have.
> 
> This patch for ConPlatformDxe will keep that working, right?
Right!

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


Re: [edk2] [Patch] BaseTools: Fix one invalid change in 6be94743

2018-04-26 Thread Zhu, Yonghong
Reviewed-by: Yonghong Zhu  

Best Regards,
Zhu Yonghong


-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Yonghong 
Zhu
Sent: Wednesday, April 25, 2018 11:09 AM
To: edk2-devel@lists.01.org
Cc: Feng, YunhuaX ; Gao, Liming 
Subject: [edk2] [Patch] BaseTools: Fix one invalid change in 6be94743

From: Yunhua Feng 

Roll back one change in 6be94743, it was updated incorrect.

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

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 56b5d39..ba83d5a 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -3914,11 +3914,11 @@ class ModuleAutoGen(AutoGen):
 # Skip the following code for modules with no source files
 if not self.SourceFileList:
 return
 
 # Skip the following code for modules without any binary files
-if not self.BinaryFileList:
+if self.BinaryFileList:
 return
 
 ### TODO: How to handles mixed source and binary modules
 
 # Find all DynamicEx and PatchableInModule PCDs used by this module 
and dependent libraries
-- 
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 0/2] Reenable timer mask quirk for Xen

2018-04-26 Thread Ard Biesheuvel
On 25 April 2018 at 19:26, Julien Grall  wrote:
> Hi Ard,
>
> Thank you for the series, I confirm it fixes EDK2 boot in Xen guest.
>
> Tested-by: Julien Grall 
> Acked-by: Julien Grall 
>

Pushed as 1eb72acddd61..ef42ef7e6dd7

Thanks all.


> On 23/04/18 16:00, Ard Biesheuvel wrote:
>>
>> Reinstate the timer mask quirk for Xen that we recently removed under the
>> assumption that only ancient KVM host implementations still needed it.
>>
>> Ard Biesheuvel (2):
>>ArmPkg: add reenable hook to ArmGenericTimerCounterLib
>>ArmVirtPkg: reinstate timer unmask quirk for Xen
>>
>>   ArmPkg/Drivers/TimerDxe/TimerDxe.c|   1 +
>>   .../Library/ArmGenericTimerCounterLib.h   |   6 +
>>   .../ArmGenericTimerPhyCounterLib.c|   8 +
>>   .../ArmGenericTimerVirtCounterLib.c   |   8 +
>>   ArmVirtPkg/ArmVirtXen.dsc |   1 +
>>   .../XenArmGenericTimerVirtCounterLib.c| 146 ++
>>   .../XenArmGenericTimerVirtCounterLib.inf  |  33 
>>   7 files changed, 203 insertions(+)
>>   create mode 100644
>> ArmVirtPkg/Library/XenArmGenericTimerVirtCounterLib/XenArmGenericTimerVirtCounterLib.c
>>   create mode 100644
>> ArmVirtPkg/Library/XenArmGenericTimerVirtCounterLib/XenArmGenericTimerVirtCounterLib.inf
>>
>
> --
> Julien Grall
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] ShellPkg/TftpDynamicCommand: Fix the potential assertion and memory leak issue.

2018-04-26 Thread Jiaxin Wu
This patch is to fix the issue reported from
https://bugzilla.tianocore.org/show_bug.cgi?id=925.

DataSize variable was not assigned the value if ShellOpenFileByName returns 
error.
In the such a case, it should not be used to FreePages. Instead, DataSize can be
used to record the file size once DownloadFile successfully.

Cc: Vladimir Olovyannikov 
Cc: Ye Ting 
Cc: Fu Siyuan 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin 
---
 ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c 
b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
index 8569c966dd..0620aec1a7 100644
--- a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
+++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
@@ -1,10 +1,10 @@
 /** @file
   The implementation for the 'tftp' Shell command.
 
   Copyright (c) 2015, ARM Ltd. All rights reserved.
-  Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved. 
+  Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved. 
   (C) Copyright 2015 Hewlett Packard Enterprise Development LP
 
   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
@@ -517,10 +517,12 @@ RunTftp (
 mTftpHiiHandle, RemoteFilePath, NicName, Status
   );
   goto NextHandle;
 }
 
+DataSize = FileSize;
+
 if (!EFI_ERROR (ShellFileExists (LocalFilePath))) {
   ShellDeleteFileByName (LocalFilePath);
 }
 
 Status = ShellOpenFileByName (
@@ -537,11 +539,10 @@ RunTftp (
 mTftpHiiHandle, L"tftp", LocalFilePath
   );
   goto NextHandle;
 }
 
-DataSize = FileSize;
 Status = ShellWriteFile (FileHandle, , Data);
 if (!EFI_ERROR (Status)) {
   ShellStatus = SHELL_SUCCESS;
 } else {
   ShellPrintHiiEx (
-- 
2.16.2.windows.1

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