[edk2] [PATCH v2] IntelFrameworkModulePkg/Csm: Set CSM memory executable

2018-08-06 Thread Ruiyu Ni
Commit b22a62be5cdc8fd19d87ec1ecfa5b28fb9be50ad
* IntelFrameworkModule/LegacyBios:Use reserved memory for legacy data
allocates reserved memory for holding legacy code/data.

But with PcdDxeNxMemoryProtectionPolicy set to certain value to
forbid execution when code is in certain type of memory, it's
possible that a platform forbids execution when code is in reserved
memory. The patch calls GCD service to allow such case otherwise
CPU exception may occur.

Code execution in BSCode area should be enabled by platform by
default.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Star Zeng 
Cc: Laszlo Ersek 
---
 .../Csm/LegacyBiosDxe/LegacyBios.c | 22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c 
b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
index 8f14687b28..f86d00b53f 100644
--- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
+++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
@@ -64,8 +64,9 @@ AllocateLegacyMemory (
   OUT EFI_PHYSICAL_ADDRESS  *Result
   )
 {
-  EFI_STATUSStatus;
-  EFI_PHYSICAL_ADDRESS  MemPage;
+  EFI_STATUS  Status;
+  EFI_PHYSICAL_ADDRESSMemPage;
+  EFI_GCD_MEMORY_SPACE_DESCRIPTOR MemDesc;
 
   //
   // Allocate Pages of memory less <= StartPageAddress
@@ -83,10 +84,21 @@ AllocateLegacyMemory (
   //
   if (!EFI_ERROR (Status)) {
 *Result = (EFI_PHYSICAL_ADDRESS) (UINTN) MemPage;
+if (MemoryType != EfiBootServicesCode) {
+  //
+  // Make sure that the buffer can be used to store code.
+  //
+  Status = gDS->GetMemorySpaceDescriptor (MemPage, );
+  if (!EFI_ERROR (Status) && (MemDesc.Attributes & EFI_MEMORY_XP) != 0) {
+Status = gDS->SetMemorySpaceAttributes (
+MemPage,
+EFI_PAGES_TO_SIZE (Pages),
+MemDesc.Attributes & (~EFI_MEMORY_XP)
+);
+  }
+}
   }
-  //
-  // If reach here the status = EFI_SUCCESS
-  //
+
   return Status;
 }
 
-- 
2.16.1.windows.1

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


Re: [edk2] [PATCH 0/6] BaseTools/Source/C: take EXTRA_OPTFLAGS and EXTRA_LDFLAGS from the caller

2018-08-06 Thread Gao, Liming
Laszlo:
  I mean to keep the minimal change in PCCT. I don't prevent the necessary 
change in PCCT code. Per your comments, this change in PCCT is necessary. If 
so, I am OK to this patch. 

  Reviewed-by: Liming Gao 

Thanks
Liming
>-Original Message-
>From: Laszlo Ersek [mailto:ler...@redhat.com]
>Sent: Tuesday, August 07, 2018 12:41 AM
>To: Gao, Liming 
>Cc: edk2-devel-01 
>Subject: Re: [edk2] [PATCH 0/6] BaseTools/Source/C: take EXTRA_OPTFLAGS
>and EXTRA_LDFLAGS from the caller
>
>Hi Liming,
>
>On 08/06/18 17:18, Laszlo Ersek wrote:
>> On 08/06/18 16:48, Gao, Liming wrote:
>>> Laszlo:
>>>   Thanks for your detail information. I understand EXTRA_OPTFLAGS.
>>>   So, its name is OK to me.
>>>
>>>   On Pccts, it is the third party code. I would like to make the
>>>   minimal change. So, I ask whether we not touch it.
>>
>> OK, thank you, I'll look into that.
>
>I started writing up a summary for the stake-holders of
>, explaining that
>some source code that goes into the VfrCompile utility is native to the
>edk2 project, while the code that *generates* the lexer and parser
>source code for VfrCompile comes from the PCCTS project, and is used
>only temporarily. And, that this should be a good enough reason to
>ignore PCCTS, because in upstream the maintainers prefer not touching
>PCCTS source.
>
>However: our git history for "BaseTools/Source/C/VfrCompile/Pccts" does
>not corroborate this preference.
>
>Consider:
>
>(a)  1  30fdf1140b8d [2009-07-17] Check In tool source code based on Build tool
>project revision r1655.
> 2  b69fd59e6f1a [2014-08-25] Fix nmake cleanall bugs.
> 3  5ddccf34c4f5 [2015-07-08] BaseTools: Fix build on FreeBSD and allow use
>of non-gcc system compiler
> 4  819a2394f17f [2016-01-11] BaseTools/VfrCompile: honor CC if it is set
> 5  4ac14ceae076 [2016-09-08] BaseTools VfrCompile Pccts: Update GCC Flags
>to the specific one with BUILD_ prefix
>
>Commits #3 through #5 modify the same set of files as my patches 4-6
>-- the "antlr" and "dlg" makefiles.
>
>(b)  6  99e55970ff07 [2016-10-20] BaseTools: Fix typos in comments and
>variables
>
>This is from Gary's series
>
>  [edk2] [PATCH 00/33] Fix typos in comments and variables
>
>and it modifies "dlg" source code.
>
>(c)  7  bab5ad2fd14b [2016-11-08] BaseTools/VfrCompile: Add checks for array
>access
> 8  77dee0b1859d [2016-11-08] BaseTools/VfrCompile: Avoid freeing freed
>memory in classes
> 9  d55638362727 [2016-11-08] BaseTools/VfrCompile/Pccts: Add virtual
>destructor for class DLGInputStream
>10  fef15ecd20dd [2016-11-08] BaseTools/VfrCompile/Pccts: Make
>assignment operator not returning void
>
>These four commits (#7 through #10) are from Hao's series
>
>  [edk2] [PATCH v2 00/53] Resolve issues for C source codes in BaseTools
>
>and they modify PCCTS headers.
>
>(d) 11  5b26adf03a0b [2016-12-20] BaseTools: fix format-security build
>warnings
>12  8230d45bba51 [2016-12-20] BaseTools: fix format type build warnings
>
>Commits #11 and #12 are from Heyi's series
>
>  [edk2] [PATCH 0/4] Fix GCC build warnings for BaseTools
>
>and they modify the "antlr" source code.
>
>(e) 13  0a64f49fde09 [2016-12-23] BaseTools/Pccts: Resolve GCC sting format
>mismatch build warning
>
>This patch is again from Hao, and it modifies utility code in PCCTS
>that is built into both "dlg" and "antlr" (namely, "set.c").
>
>(f) 14  a5b84d3480b4 [2018-01-02] BaseTools: eliminate unused expression
>result
>15  4e97974c1e52 [2018-01-02] BaseTools: silence parentheses-equality
>warning
>
>These are from a series that Zenith432 posted without a cover
>letter. They modify "antlr" and "dlg" source code.
>
>The above examples imply that we have modified both the makefiles and
>the source code under PCCTS, over time.
>
>Do you still prefer that I drop those parts of my series?
>
>I can attempt to do that, but then I cannot tell the RHBZ#1540244
>stakeholders that we "generally" avoid patching the bundled PCCTS
>instance -- because, we do patch it whenever necessary.
>
>Thanks!
>Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] Build Spec: Add rules for structure pcd display in the report

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

>-Original Message-
>From: Zhu, Yonghong
>Sent: Wednesday, August 01, 2018 11:24 AM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming ; Kinney, Michael D
>; Shaw, Kevin W 
>Subject: [Patch] Build Spec: Add rules for structure pcd display in the report
>
>Cc: Liming Gao 
>Cc: Michael Kinney 
>Cc: Kevin W Shaw 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Yonghong Zhu 
>---
> 13_build_reports/136_global_pcd_section.md | 32
>+-
> 1 file changed, 23 insertions(+), 9 deletions(-)
>
>diff --git a/13_build_reports/136_global_pcd_section.md
>b/13_build_reports/136_global_pcd_section.md
>index 64bda35..1a072b3 100644
>--- a/13_build_reports/136_global_pcd_section.md
>+++ b/13_build_reports/136_global_pcd_section.md
>@@ -142,44 +142,58 @@ These lines are formatted as:
> **
> **Note:** Global PCD section is present when **PCD** is specified in **-
>Y**
> option.
> **
>
>- 13.6.2.4 Field value for Structure PCD
>-If the Pcd is a Structure Pcd, every field value that user specified in 
>DSC/DEC
>-file and build command will print out. The field value is from DSC/DEC file or
>-build command, not from the final structure byte array, and the field order is
>-same as it in DSC/DEC file. when the field value is from build command, tool
>will
>-additional print a *B Flag.
>+ 13.6.2.4 Rules for Structure PCD
>+If the Pcd is a Structure Pcd, it display in the report file would have two 
>parts.
>+One is the final Pcd value and its field value, the field value is from FDF 
>file,
>+DSC file PCD Section or build option, not from the final structure byte array,
>+and the field order is sorted by the field name. When the field value from
>DSC file
>+PCD Section, it will not have additional *P Flag, when the field value from 
>FDF
>file,
>+it will have additional *F Flag before the field name, when the field value
>from
>+build option, it will have additional *B Flag before the field name. The other
>part
>+is the DEC default value and its field value, this part is optional. The field
>value
>+in this part is from DEC file, and the field order is sorted by the field 
>name.
>+
>+**
>+**Note:** When the structure Pcd have some value from build option, no
>matter whether
>+the value is same with FDF or DSC file or DEC file, there will display a *B 
>Flag
>before
>+the PCD name. When the structure Pcd have some value from FDF file, no
>matter whether
>+the value is same with DSC file or DEC file, there will display a *F Flag 
>before
>the
>+PCD name. When the structure Pcd value have some value from DSC file PCD
>section, no
>+matter whether the value is same with DEC file, there will display a *P Flag
>before
>+the PCD name.
>+**
>
>  Example
>
> ```
> gEfiMdePkgTokenSpaceGuid
> *B TestDynamicExHii   : DEXHII(TEST) (SKU1) (STANDARD) = {
>
>0xff,0x01,0x00,0x2e,0xf6,0x08,0x6f,0x19,0x5c,0x8e,0x49,0x91,0x57,0x00,0x00,
>0x00,
> 0x00,0x64,0x00,0x00,0x00}
>.A = 0x1
>-   *B  .C = 0x0
>.Array = 
> {0x2e,0xf6,0x08,0x6f,0x19,0x5c,0x8e,0x49,0x91,0x57}
>+   *B  .C = 0x0
>.D = 0x64
>   : DEXHII(TEST) (SKU1) (Manufacturing) = 
> {
>
>0xff,0x02,0x00,0x2e,0xf6,0x08,0x6f,0x20,0x5c,0x8e,0x49,0x91,0x57,0x00,0x00,
>0x00,
> 0x00,0x68,0x00,0x00,0x00}
>.A = 0x2
>-   *B  .C = 0x0
>.Array = 
> {0x2e,0xf6,0x08,0x6f,0x20,0x5c,0x8e,0x49,0x91,0x57}
>+   *B  .C = 0x0
>.D = 0x68
> DEC DEFAULT = {0xFF,0xFF}
>.A = 0xF
>.C = 0xF
> *P TestFix:  FIXED   (TEST) = {
>
>0xff,0x02,0x00,0x2e,0xf6,0x08,0x6f,0x19,0x5c,0x8e,0x49,0x91,0x57,0x00,0x00,
>0x00,
> 0x00,0x64,0x00,0x00,0x00}
>.A = 0x2
>-   .C = 0x0
>.Array = 
> {0x2e,0xf6,0x08,0x6f,0x19,0x5c,0x8e,0x49,0x91,0x57}
>+   .C = 0x0
>.D = 0x64
> DEC DEFAULT = {0xFF,0xFF}
>.A = 0xF
>.C = 0xF
> ```
>--
>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] DSC Spec: limit the VOID* PCD max size to UINT16

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

>-Original Message-
>From: Zhu, Yonghong
>Sent: Friday, August 03, 2018 2:12 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming ; Kinney, Michael D
>; Shaw, Kevin W 
>Subject: [Patch] DSC Spec: limit the VOID* PCD max size to UINT16
>
>current the max size of VOID* PCD in the spec is a number that doesn't
>no limitation, now this patch update to limit the max size to UINT16,
>besides, also update some typo to make sure the format in chapter 2
>and chapter 3 are align.
>
>Cc: Liming Gao 
>Cc: Michael Kinney 
>Cc: Kevin W Shaw 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Yonghong Zhu 
>---
> 2_dsc_overview/29_pcd_sections.md| 6 +++---
> 3_edk_ii_dsc_file_format/310_pcd_sections.md | 8 
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
>diff --git a/2_dsc_overview/29_pcd_sections.md
>b/2_dsc_overview/29_pcd_sections.md
>index 6547656..b33026c 100644
>--- a/2_dsc_overview/29_pcd_sections.md
>+++ b/2_dsc_overview/29_pcd_sections.md
>@@ -1,9 +1,9 @@
> 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:Fix incorrect %EDK_TOOLS_PATH%

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

>-Original Message-
>From: Feng, YunhuaX
>Sent: Tuesday, August 07, 2018 9:36 AM
>To: edk2-devel@lists.01.org
>Cc: Zhu, Yonghong ; Gao, Liming
>
>Subject: [PATCH] BaseTools:Fix incorrect %EDK_TOOLS_PATH%
>
>For non-root folder, such as "X:\bp", the EDK_TOOLS_PATH will
>resolve to "X:\bp\edk2\BaseTools". This is OK.
>
>But if WORKSPACE is at a root folder, such as "X:\", the EDK_TOOLS_PATH
>will look like "X:\\BaseTools". The *double backslash* can fail the command
>like "del" and thus affect the %ERRORLEVEL% variable, which may break
>subsequent build processing.
>
>Cc: Liming Gao 
>Cc: Yonghong Zhu 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Yunhua Feng 
>---
> edksetup.bat | 39 +--
> 1 file changed, 25 insertions(+), 14 deletions(-)
>
>diff --git a/edksetup.bat b/edksetup.bat
>index 97e2330e8c..c32755a471 100755
>--- a/edksetup.bat
>+++ b/edksetup.bat
>@@ -57,26 +57,37 @@ if /I "%1"=="/h" goto Usage
> if /I "%1"=="/?" goto Usage
> if /I "%1"=="/help" goto Usage
>
> if /I "%1"=="NewBuild" shift
> if not defined EDK_TOOLS_PATH (
>-  if exist %WORKSPACE%\BaseTools (
>-set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
>-  ) else (
>-if defined PACKAGES_PATH (
>-  for %%i IN (%PACKAGES_PATH%) DO (
>-if exist %%~fi\BaseTools (
>-  set EDK_TOOLS_PATH=%%~fi\BaseTools
>-  goto checkNt32Flag
>-)
>+  goto SetEdkToolsPath
>+) else (
>+  goto checkNt32Flag
>+)
>+
>+:SetEdkToolsPath
>+if %WORKSPACE:~-1% EQU \ (
>+  @set EDK_BASETOOLS=%WORKSPACE%BaseTools
>+) else (
>+  @set EDK_BASETOOLS=%WORKSPACE%\BaseTools
>+)
>+if exist %EDK_BASETOOLS% (
>+  set EDK_TOOLS_PATH=%EDK_BASETOOLS%
>+  set EDK_BASETOOLS=
>+) else (
>+  if defined PACKAGES_PATH (
>+for %%i IN (%PACKAGES_PATH%) DO (
>+  if exist %%~fi\BaseTools (
>+set EDK_TOOLS_PATH=%%~fi\BaseTools
>+goto checkNt32Flag
>   )
>-) else (
>-  echo.
>-  echo !!! ERROR !!! Cannot find BaseTools !!!
>-  echo.
>-  goto BadBaseTools
> )
>+  ) else (
>+echo.
>+echo !!! ERROR !!! Cannot find BaseTools !!!
>+echo.
>+goto BadBaseTools
>   )
> )
>
> :checkNt32Flag
> if exist %EDK_TOOLS_PATH%\Source set
>BASE_TOOLS_PATH=%EDK_TOOLS_PATH%
>--
>2.12.2.windows.2

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


[edk2] [PATCH] BaseTools:Fix incorrect %EDK_TOOLS_PATH%

2018-08-06 Thread Feng, YunhuaX
For non-root folder, such as "X:\bp", the EDK_TOOLS_PATH will
resolve to "X:\bp\edk2\BaseTools". This is OK.

But if WORKSPACE is at a root folder, such as "X:\", the EDK_TOOLS_PATH
will look like "X:\\BaseTools". The *double backslash* can fail the command
like "del" and thus affect the %ERRORLEVEL% variable, which may break
subsequent build processing.

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
---
 edksetup.bat | 39 +--
 1 file changed, 25 insertions(+), 14 deletions(-)

diff --git a/edksetup.bat b/edksetup.bat
index 97e2330e8c..c32755a471 100755
--- a/edksetup.bat
+++ b/edksetup.bat
@@ -57,26 +57,37 @@ if /I "%1"=="/h" goto Usage
 if /I "%1"=="/?" goto Usage
 if /I "%1"=="/help" goto Usage
 
 if /I "%1"=="NewBuild" shift
 if not defined EDK_TOOLS_PATH (
-  if exist %WORKSPACE%\BaseTools (
-set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
-  ) else (
-if defined PACKAGES_PATH (
-  for %%i IN (%PACKAGES_PATH%) DO (
-if exist %%~fi\BaseTools (
-  set EDK_TOOLS_PATH=%%~fi\BaseTools
-  goto checkNt32Flag
-)
+  goto SetEdkToolsPath
+) else (
+  goto checkNt32Flag
+)
+
+:SetEdkToolsPath
+if %WORKSPACE:~-1% EQU \ (
+  @set EDK_BASETOOLS=%WORKSPACE%BaseTools
+) else (
+  @set EDK_BASETOOLS=%WORKSPACE%\BaseTools
+)
+if exist %EDK_BASETOOLS% (
+  set EDK_TOOLS_PATH=%EDK_BASETOOLS%
+  set EDK_BASETOOLS=
+) else (
+  if defined PACKAGES_PATH (
+for %%i IN (%PACKAGES_PATH%) DO (
+  if exist %%~fi\BaseTools (
+set EDK_TOOLS_PATH=%%~fi\BaseTools
+goto checkNt32Flag
   )
-) else (
-  echo.
-  echo !!! ERROR !!! Cannot find BaseTools !!!
-  echo.
-  goto BadBaseTools
 )
+  ) else (
+echo.
+echo !!! ERROR !!! Cannot find BaseTools !!!
+echo.
+goto BadBaseTools
   )
 )
 
 :checkNt32Flag
 if exist %EDK_TOOLS_PATH%\Source set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%
-- 
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] ShellPkg/acpi: Fix XCODE5 X64 build failure

2018-08-06 Thread Bi, Dandan
Reviewed-by: Dandan Bi 

Thanks,
Dandan

-Original Message-
From: Ni, Ruiyu 
Sent: Monday, August 6, 2018 2:30 PM
To: edk2-devel@lists.01.org
Cc: Bi, Dandan 
Subject: [PATCH] ShellPkg/acpi: Fix XCODE5 X64 build failure

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Dandan Bi 
---
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c | 2 +-  
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c
index cca25fcce9..5b25c66f40 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtPars
+++ er.c
@@ -33,7 +33,7 @@ STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
 /**
   Get the ACPI XSDT header info.
 **/
-CONST ACPI_DESCRIPTION_HEADER_INFO* CONST
+CONST ACPI_DESCRIPTION_HEADER_INFO *
 EFIAPI
 GetAcpiXsdtHeaderInfo (
   VOID
diff --git 
a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c
index a5e1412484..5fa28338ef 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtPars
+++ er.c
@@ -32,7 +32,7 @@ STATIC CONST ACPI_PARSER XsdtParser[] = {
 /**
   Get the ACPI XSDT header info.
 **/
-CONST ACPI_DESCRIPTION_HEADER_INFO* CONST
+CONST ACPI_DESCRIPTION_HEADER_INFO *
 EFIAPI
 GetAcpiXsdtHeaderInfo (
   VOID
--
2.16.1.windows.1

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


Re: [edk2] [PATCH] OvmfPkg/PlatformDebugLibIoPort: fix port detection for use in the DXE Core

2018-08-06 Thread Laszlo Ersek
On 08/06/18 20:26, Jordan Justen wrote:
> On 2018-08-03 08:08:13, Laszlo Ersek wrote:
>>
>> Should I resubmit the patch for function-scoping (and renaming) the
>> global variables, or for inserting the blank linke?
>
> No need to resubmit. Furthermore, you can consider my suggestions as
> optional. I don't feel too strongly about these ones.

I've traded the blank line which I superfluously added above
"mDebugIoPortChecked", initially, for the one you pointed out as
missing:

> diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.c 
> b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.c
> index 74aef2e37b42..e24cc834c2a3 100644
> --- a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.c
> +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.c
> @@ -16,11 +16,11 @@
>  #include 
>  #include "DebugLibDetect.h"
>
> -
>  //
>  // Set to TRUE if the debug I/O port has been checked
>  //
>  STATIC BOOLEAN mDebugIoPortChecked = FALSE;
> +
>  //
>  // Set to TRUE if the debug I/O port is enabled
>  //

I noted this on the commit message too.

Pushed as commit 91a5b1365075.

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


Re: [edk2] [PATCH] OvmfPkg/PlatformDebugLibIoPort: fix port detection for use in the DXE Core

2018-08-06 Thread Jordan Justen
On 2018-08-03 08:08:13, Laszlo Ersek wrote:
> 
> Should I resubmit the patch for function-scoping (and renaming) the
> global variables, or for inserting the blank linke?

No need to resubmit. Furthermore, you can consider my suggestions as
optional. I don't feel too strongly about these ones.

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


Re: [edk2] [platforms: PATCH 7/9] Marvell/Armada70x0Db: Enable ACPI support

2018-08-06 Thread Marcin Wojtas
pon., 6 sie 2018 o 19:44 Leif Lindholm  napisał(a):
>
>
>
> On Mon, 6 Aug 2018, 17:09 Ard Biesheuvel,  wrote:
>>
>> On 6 August 2018 at 18:08, Marcin Wojtas  wrote:
>> > HI Ard,
>> >
>> > pon., 6 sie 2018 o 13:54 Ard Biesheuvel  
>> > napisał(a):
>> >>
>> >> On 6 August 2018 at 01:28, Marcin Wojtas  wrote:
>> >> > This patch introduces DSDT table and adds necessary
>> >> > wiring in order to enable ACPI support on Armada 7040 DB.
>> >> >
>> >> > Contributed-under: TianoCore Contribution Agreement 1.1
>> >> > Signed-off-by: Marcin Wojtas 
>> >> > ---
>> >> >  Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc |  
>> >> > 14 ++
>> >> >  Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc|   
>> >> > 3 +
>> >> >  Silicon/Marvell/Armada7k8k/Armada7k8k.fdf |  
>> >> > 12 +
>> >> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf |  
>> >> > 61 ++
>> >> >  Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc|   
>> >> > 5 +
>> >> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl   | 
>> >> > 229 
>> >> >  Silicon/Marvell/Documentation/PortingGuide.txt|  
>> >> > 22 ++
>> >> >  7 files changed, 346 insertions(+)
>> >> >  create mode 100644 
>> >> > Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
>> >> >  create mode 100644 
>> >> > Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl
>> >> >
>> >> > diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc 
>> >> > b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
>> >> > index f1ccda0..d4c67a2 100644
>> >> > --- a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
>> >> > +++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
>> >> > @@ -593,6 +593,20 @@
>> >> >ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
>> >> >  !endif #$(INCLUDE_TFTP_COMMAND)
>> >> >
>> >> > +[Components.AARCH64]
>> >> > +  #
>> >> > +  # Generic ACPI modules
>> >> > +  #
>> >> > +  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
>> >> > +  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf {
>> >> > +
>> >> > +  
>> >> > PlatformHasAcpiLib|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf
>> >> > +
>> >> > +
>> >> > +  # support ACPI v5.0 or later
>> >> > +  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20
>> >> > +  }
>> >> > +
>> >> >  
>> >> > [BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION]
>> >> >GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
>> >> >
>> >> > diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc 
>> >> > b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
>> >> > index d3dffb0..f6faff1 100644
>> >> > --- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
>> >> > +++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
>> >> > @@ -51,6 +51,9 @@
>> >> >  [Components.common]
>> >> >Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
>> >> >
>> >> > +[Components.AARCH64]
>> >> > +  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
>> >> > +
>> >> >  
>> >> > 
>> >> >  #
>> >> >  # Pcd Section - list of all EDK II PCD Entries defined by this Platform
>> >> > diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf 
>> >> > b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
>> >> > index 909ad3e..c064a43 100644
>> >> > --- a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
>> >> > +++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
>> >> > @@ -215,6 +215,12 @@ FvNameGuid = 
>> >> > 5eda4200-2c5f-43cb-9da3-0baf74b1b30c
>> >> ># DTB
>> >> >INF EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
>> >> >
>> >> > +!if $(ARCH) == AARCH64
>> >> > +  # ACPI support
>> >> > +  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
>> >> > +  INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
>> >> > +!endif
>> >> > +
>> >> >  !include $(BOARD_DXE_FV_COMPONENTS)
>> >> >
>> >> >  # PEI phase firmware volume
>> >> > @@ -408,3 +414,9 @@ READ_LOCK_STATUS   = TRUE
>> >> >FILE FREEFORM = $(NAMED_GUID) {
>> >> >  RAW BIN|.dtb
>> >> >}
>> >> > +
>> >> > +[Rule.Common.USER_DEFINED.ACPITABLE]
>> >> > +  FILE FREEFORM = $(NAMED_GUID) {
>> >> > +RAW ASL|.aml
>> >> > +RAW ACPI   |.acpi
>> >> > +  }
>> >> > diff --git 
>> >> > a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf 
>> >> > b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
>> >> > new file mode 100644
>> >> > index 000..8732e10
>> >> > --- /dev/null
>> >> > +++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
>> >> > @@ -0,0 +1,61 @@
>> >> > +## @file
>> >> > +#  Component description file for PlatformAcpiTables module.
>> >> > +#
>> 

Re: [edk2] [platforms: PATCH 7/9] Marvell/Armada70x0Db: Enable ACPI support

2018-08-06 Thread Leif Lindholm
On Mon, 6 Aug 2018, 17:09 Ard Biesheuvel,  wrote:

> On 6 August 2018 at 18:08, Marcin Wojtas  wrote:
> > HI Ard,
> >
> > pon., 6 sie 2018 o 13:54 Ard Biesheuvel 
> napisał(a):
> >>
> >> On 6 August 2018 at 01:28, Marcin Wojtas  wrote:
> >> > This patch introduces DSDT table and adds necessary
> >> > wiring in order to enable ACPI support on Armada 7040 DB.
> >> >
> >> > Contributed-under: TianoCore Contribution Agreement 1.1
> >> > Signed-off-by: Marcin Wojtas 
> >> > ---
> >> >  Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc |
> 14 ++
> >> >  Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc|
>  3 +
> >> >  Silicon/Marvell/Armada7k8k/Armada7k8k.fdf |
> 12 +
> >> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf |
> 61 ++
> >> >  Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc|
>  5 +
> >> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl   |
> 229 
> >> >  Silicon/Marvell/Documentation/PortingGuide.txt|
> 22 ++
> >> >  7 files changed, 346 insertions(+)
> >> >  create mode 100644
> Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
> >> >  create mode 100644
> Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl
> >> >
> >> > diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
> b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
> >> > index f1ccda0..d4c67a2 100644
> >> > --- a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
> >> > +++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
> >> > @@ -593,6 +593,20 @@
> >> >ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
> >> >  !endif #$(INCLUDE_TFTP_COMMAND)
> >> >
> >> > +[Components.AARCH64]
> >> > +  #
> >> > +  # Generic ACPI modules
> >> > +  #
> >> > +  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
> >> > +  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf {
> >> > +
> >> > +
> PlatformHasAcpiLib|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf
> >> > +
> >> > +
> >> > +  # support ACPI v5.0 or later
> >> > +  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20
> >> > +  }
> >> > +
> >> >
> [BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION]
> >> >GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> >> >
> >> > diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
> b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
> >> > index d3dffb0..f6faff1 100644
> >> > --- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
> >> > +++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
> >> > @@ -51,6 +51,9 @@
> >> >  [Components.common]
> >> >Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
> >> >
> >> > +[Components.AARCH64]
> >> > +  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
> >> > +
> >> >
> 
> >> >  #
> >> >  # Pcd Section - list of all EDK II PCD Entries defined by this
> Platform
> >> > diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
> b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
> >> > index 909ad3e..c064a43 100644
> >> > --- a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
> >> > +++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
> >> > @@ -215,6 +215,12 @@ FvNameGuid =
> 5eda4200-2c5f-43cb-9da3-0baf74b1b30c
> >> ># DTB
> >> >INF EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
> >> >
> >> > +!if $(ARCH) == AARCH64
> >> > +  # ACPI support
> >> > +  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
> >> > +  INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
> >> > +!endif
> >> > +
> >> >  !include $(BOARD_DXE_FV_COMPONENTS)
> >> >
> >> >  # PEI phase firmware volume
> >> > @@ -408,3 +414,9 @@ READ_LOCK_STATUS   = TRUE
> >> >FILE FREEFORM = $(NAMED_GUID) {
> >> >  RAW BIN|.dtb
> >> >}
> >> > +
> >> > +[Rule.Common.USER_DEFINED.ACPITABLE]
> >> > +  FILE FREEFORM = $(NAMED_GUID) {
> >> > +RAW ASL|.aml
> >> > +RAW ACPI   |.acpi
> >> > +  }
> >> > diff --git
> a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
> b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
> >> > new file mode 100644
> >> > index 000..8732e10
> >> > --- /dev/null
> >> > +++
> b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
> >> > @@ -0,0 +1,61 @@
> >> > +## @file
> >> > +#  Component description file for PlatformAcpiTables module.
> >> > +#
> >> > +#  ACPI table data and ASL sources required to boot the platform.
> >> > +#
> >> > +#  Copyright (c) 2018, Linaro, Ltd. All rights reserved.
> >> > +#  Copyright (C) 2018, Marvell International Ltd. and its
> affiliates.
> >> > +#
> >> > +#  This program and the accompanying materials
> >> > +# 

Re: [edk2] [PATCH] MdeModulePkg: Remove dead code in .c and .h files

2018-08-06 Thread Kinney, Michael D
Laszlo,

I agree for a patch like this that one patch
per module makes more sense.

We also need to make sure that this series is
tested with all supported compilers and CPU
architectures to make sure code is not being 
removed that is required for a combination that
was missed.

Thanks,

Mike


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-
> boun...@lists.01.org] On Behalf Of Laszlo Ersek
> Sent: Monday, August 6, 2018 6:12 AM
> To: Zhang, Shenglei ; edk2-
> de...@lists.01.org
> Cc: Dong, Eric ; Zeng, Star
> 
> Subject: Re: [edk2] [PATCH] MdeModulePkg: Remove dead
> code in .c and .h files
> 
> On 08/06/18 09:49, shenglei wrote:
> > Some dead code has been removed in .c and .h files.
> > https://bugzilla.tianocore.org/show_bug.cgi?id=1062
> >
> > Cc: Star Zeng 
> > Cc: Eric Dong 
> > Contributed-under: TianoCore Contribution Agreement
> 1.1
> > Signed-off-by: shenglei 
> > ---
> >  .../Application/CapsuleApp/CapsuleDump.c  |  31
> ---
> >  MdeModulePkg/Application/UiApp/FrontPage.c|  40
> ---
> >  MdeModulePkg/Application/UiApp/Ui.h   |  30
> --
> >  .../Bus/Ata/AtaAtapiPassThru/AhciMode.c   | 104
> ---
> >  .../Bus/Ata/AtaAtapiPassThru/IdeMode.c| 257
> --
> >  .../Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c|  26
> --
> >  .../Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h  |  12
> -
> >  MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c  |  27
> --
> >  MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.h  |  11
> -
> >  MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.c|  44
> ---
> >  .../Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 110
> 
> >  .../Bus/Pci/PciBusDxe/PciDeviceSupport.c  |  80
> --
> >  .../Bus/Pci/PciBusDxe/PciDeviceSupport.h  |  17
> --
> >  MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c|  41
> ---
> >  MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.h|  21
> --
> >  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c |  94
> ---
> >  MdeModulePkg/Bus/Pci/UhciPei/DmaMem.c |  22
> --
> >  MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c| 125
> -
> >  MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.h|  78
> --
> >  MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c|  66
> -
> >  MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h|  28
> --
> >  MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c   |  24
> --
> >  MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c|  22
> --
> >  MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h|  14
> -
> >  .../Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c |  24
> --
> >  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.c|  24
> --
> >  .../Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c | 101
> ---
> >  MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c |  24
> --
> >  MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c   | 180
> 
> >  .../Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c   |  49
> 
> >  MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c| 190
> -
> >  MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.h|  98
> ---
> >  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c   |  68
> -
> >  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c   | 146
> --
> >  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.h   | 114
> 
> >  MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.c  |  39
> ---
> >  MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.h  |  18
> --
> >  MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c|  77
> --
> >  MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.h|  35
> ---
> >  MdeModulePkg/Core/Dxe/DxeMain.h   |  13
> -
> >  MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c   |  23
> --
> >  MdeModulePkg/Core/Dxe/Mem/HeapGuard.c |  78
> --
> >  MdeModulePkg/Core/PiSmmCore/HeapGuard.c   | 166
> ---
> >  .../Core/PiSmmCore/MemoryAttributesTable.c| 131
> -
> >  MdeModulePkg/Core/PiSmmCore/Page.c| 121
> -
> >  .../Universal/Console/TerminalDxe/Terminal.h  |  12
> -
> >  .../Console/TerminalDxe/TerminalConIn.c   |  25
> --
> >  .../Universal/HiiDatabaseDxe/ConfigRouting.c  |  47
> 
> >  .../Universal/Network/IScsiDxe/IScsiProto.c   |  31
> ---
> >  .../Universal/Network/Ip4Dxe/Ip4Config2Impl.c |  16
> --
> >  .../Universal/Network/Tcp4Dxe/SockImpl.c  |  35
> ---
> >  .../Universal/Network/Tcp4Dxe/SockInterface.c |  41
> ---
> >  .../Universal/Network/Tcp4Dxe/Socket.h|  32
> ---
> >  .../Universal/Network/Tcp4Dxe/Tcp4Option.c|  28
> --
> >  .../Universal/Network/Tcp4Dxe/Tcp4Option.h|  15
> -
> >  .../Universal/SetupBrowserDxe/IfrParse.c  |  33
> ---
> >  56 files changed, 3358 deletions(-)
> 
> Please split this patch up to a series so that *at the
> least* each
> module is covered by a separate patch. For example,
> 
>  1MdeModulePkg/Application/CapsuleApp
>  2MdeModulePkg/Application/UiApp
>  3MdeModulePkg/Bus/Ata/AtaAtapiPassThru
>  4MdeModulePkg/Bus/Isa/Ps2KeyboardDxe
>  5MdeModulePkg/Bus/Pci/EhciDxe
>  6MdeModulePkg/Bus/Pci/NvmExpressDxe
>  

Re: [edk2] [PATCH 0/6] BaseTools/Source/C: take EXTRA_OPTFLAGS and EXTRA_LDFLAGS from the caller

2018-08-06 Thread Laszlo Ersek
Hi Liming,

On 08/06/18 17:18, Laszlo Ersek wrote:
> On 08/06/18 16:48, Gao, Liming wrote:
>> Laszlo:
>>   Thanks for your detail information. I understand EXTRA_OPTFLAGS.
>>   So, its name is OK to me.
>>
>>   On Pccts, it is the third party code. I would like to make the
>>   minimal change. So, I ask whether we not touch it.
>
> OK, thank you, I'll look into that.

I started writing up a summary for the stake-holders of
, explaining that
some source code that goes into the VfrCompile utility is native to the
edk2 project, while the code that *generates* the lexer and parser
source code for VfrCompile comes from the PCCTS project, and is used
only temporarily. And, that this should be a good enough reason to
ignore PCCTS, because in upstream the maintainers prefer not touching
PCCTS source.

However: our git history for "BaseTools/Source/C/VfrCompile/Pccts" does
not corroborate this preference.

Consider:

(a)  1  30fdf1140b8d [2009-07-17] Check In tool source code based on Build tool 
project revision r1655.
 2  b69fd59e6f1a [2014-08-25] Fix nmake cleanall bugs.
 3  5ddccf34c4f5 [2015-07-08] BaseTools: Fix build on FreeBSD and allow use 
of non-gcc system compiler
 4  819a2394f17f [2016-01-11] BaseTools/VfrCompile: honor CC if it is set
 5  4ac14ceae076 [2016-09-08] BaseTools VfrCompile Pccts: Update GCC Flags 
to the specific one with BUILD_ prefix

Commits #3 through #5 modify the same set of files as my patches 4-6
-- the "antlr" and "dlg" makefiles.

(b)  6  99e55970ff07 [2016-10-20] BaseTools: Fix typos in comments and variables

This is from Gary's series

  [edk2] [PATCH 00/33] Fix typos in comments and variables

and it modifies "dlg" source code.

(c)  7  bab5ad2fd14b [2016-11-08] BaseTools/VfrCompile: Add checks for array 
access
 8  77dee0b1859d [2016-11-08] BaseTools/VfrCompile: Avoid freeing freed 
memory in classes
 9  d55638362727 [2016-11-08] BaseTools/VfrCompile/Pccts: Add virtual 
destructor for class DLGInputStream
10  fef15ecd20dd [2016-11-08] BaseTools/VfrCompile/Pccts: Make assignment 
operator not returning void

These four commits (#7 through #10) are from Hao's series

  [edk2] [PATCH v2 00/53] Resolve issues for C source codes in BaseTools

and they modify PCCTS headers.

(d) 11  5b26adf03a0b [2016-12-20] BaseTools: fix format-security build warnings
12  8230d45bba51 [2016-12-20] BaseTools: fix format type build warnings

Commits #11 and #12 are from Heyi's series

  [edk2] [PATCH 0/4] Fix GCC build warnings for BaseTools

and they modify the "antlr" source code.

(e) 13  0a64f49fde09 [2016-12-23] BaseTools/Pccts: Resolve GCC sting format 
mismatch build warning

This patch is again from Hao, and it modifies utility code in PCCTS
that is built into both "dlg" and "antlr" (namely, "set.c").

(f) 14  a5b84d3480b4 [2018-01-02] BaseTools: eliminate unused expression result
15  4e97974c1e52 [2018-01-02] BaseTools: silence parentheses-equality 
warning

These are from a series that Zenith432 posted without a cover
letter. They modify "antlr" and "dlg" source code.

The above examples imply that we have modified both the makefiles and
the source code under PCCTS, over time.

Do you still prefer that I drop those parts of my series?

I can attempt to do that, but then I cannot tell the RHBZ#1540244
stakeholders that we "generally" avoid patching the bundled PCCTS
instance -- because, we do patch it whenever necessary.

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


Re: [edk2] [platforms: PATCH 7/9] Marvell/Armada70x0Db: Enable ACPI support

2018-08-06 Thread Ard Biesheuvel
On 6 August 2018 at 18:08, Marcin Wojtas  wrote:
> HI Ard,
>
> pon., 6 sie 2018 o 13:54 Ard Biesheuvel  
> napisał(a):
>>
>> On 6 August 2018 at 01:28, Marcin Wojtas  wrote:
>> > This patch introduces DSDT table and adds necessary
>> > wiring in order to enable ACPI support on Armada 7040 DB.
>> >
>> > Contributed-under: TianoCore Contribution Agreement 1.1
>> > Signed-off-by: Marcin Wojtas 
>> > ---
>> >  Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc |  14 ++
>> >  Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc|   3 +
>> >  Silicon/Marvell/Armada7k8k/Armada7k8k.fdf |  12 +
>> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf |  61 
>> > ++
>> >  Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc|   5 +
>> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl   | 229 
>> > 
>> >  Silicon/Marvell/Documentation/PortingGuide.txt|  22 ++
>> >  7 files changed, 346 insertions(+)
>> >  create mode 100644 
>> > Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
>> >  create mode 100644 
>> > Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl
>> >
>> > diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc 
>> > b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
>> > index f1ccda0..d4c67a2 100644
>> > --- a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
>> > +++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
>> > @@ -593,6 +593,20 @@
>> >ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
>> >  !endif #$(INCLUDE_TFTP_COMMAND)
>> >
>> > +[Components.AARCH64]
>> > +  #
>> > +  # Generic ACPI modules
>> > +  #
>> > +  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
>> > +  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf {
>> > +
>> > +  
>> > PlatformHasAcpiLib|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf
>> > +
>> > +
>> > +  # support ACPI v5.0 or later
>> > +  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20
>> > +  }
>> > +
>> >  
>> > [BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION]
>> >GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
>> >
>> > diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc 
>> > b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
>> > index d3dffb0..f6faff1 100644
>> > --- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
>> > +++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
>> > @@ -51,6 +51,9 @@
>> >  [Components.common]
>> >Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
>> >
>> > +[Components.AARCH64]
>> > +  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
>> > +
>> >  
>> > 
>> >  #
>> >  # Pcd Section - list of all EDK II PCD Entries defined by this Platform
>> > diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf 
>> > b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
>> > index 909ad3e..c064a43 100644
>> > --- a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
>> > +++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
>> > @@ -215,6 +215,12 @@ FvNameGuid = 
>> > 5eda4200-2c5f-43cb-9da3-0baf74b1b30c
>> ># DTB
>> >INF EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
>> >
>> > +!if $(ARCH) == AARCH64
>> > +  # ACPI support
>> > +  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
>> > +  INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
>> > +!endif
>> > +
>> >  !include $(BOARD_DXE_FV_COMPONENTS)
>> >
>> >  # PEI phase firmware volume
>> > @@ -408,3 +414,9 @@ READ_LOCK_STATUS   = TRUE
>> >FILE FREEFORM = $(NAMED_GUID) {
>> >  RAW BIN|.dtb
>> >}
>> > +
>> > +[Rule.Common.USER_DEFINED.ACPITABLE]
>> > +  FILE FREEFORM = $(NAMED_GUID) {
>> > +RAW ASL|.aml
>> > +RAW ACPI   |.acpi
>> > +  }
>> > diff --git 
>> > a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf 
>> > b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
>> > new file mode 100644
>> > index 000..8732e10
>> > --- /dev/null
>> > +++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
>> > @@ -0,0 +1,61 @@
>> > +## @file
>> > +#  Component description file for PlatformAcpiTables module.
>> > +#
>> > +#  ACPI table data and ASL sources required to boot the platform.
>> > +#
>> > +#  Copyright (c) 2018, Linaro, Ltd. All rights reserved.
>> > +#  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
>> > +#
>> > +#  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
>> > +#  

Re: [edk2] [platforms: PATCH 7/9] Marvell/Armada70x0Db: Enable ACPI support

2018-08-06 Thread Marcin Wojtas
HI Ard,

pon., 6 sie 2018 o 13:54 Ard Biesheuvel  napisał(a):
>
> On 6 August 2018 at 01:28, Marcin Wojtas  wrote:
> > This patch introduces DSDT table and adds necessary
> > wiring in order to enable ACPI support on Armada 7040 DB.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Marcin Wojtas 
> > ---
> >  Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc |  14 ++
> >  Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc|   3 +
> >  Silicon/Marvell/Armada7k8k/Armada7k8k.fdf |  12 +
> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf |  61 
> > ++
> >  Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc|   5 +
> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl   | 229 
> > 
> >  Silicon/Marvell/Documentation/PortingGuide.txt|  22 ++
> >  7 files changed, 346 insertions(+)
> >  create mode 100644 
> > Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
> >  create mode 100644 
> > Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl
> >
> > diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc 
> > b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
> > index f1ccda0..d4c67a2 100644
> > --- a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
> > +++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
> > @@ -593,6 +593,20 @@
> >ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
> >  !endif #$(INCLUDE_TFTP_COMMAND)
> >
> > +[Components.AARCH64]
> > +  #
> > +  # Generic ACPI modules
> > +  #
> > +  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
> > +  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf {
> > +
> > +  
> > PlatformHasAcpiLib|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf
> > +
> > +
> > +  # support ACPI v5.0 or later
> > +  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20
> > +  }
> > +
> >  
> > [BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION]
> >GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> >
> > diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc 
> > b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
> > index d3dffb0..f6faff1 100644
> > --- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
> > +++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
> > @@ -51,6 +51,9 @@
> >  [Components.common]
> >Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
> >
> > +[Components.AARCH64]
> > +  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
> > +
> >  
> > 
> >  #
> >  # Pcd Section - list of all EDK II PCD Entries defined by this Platform
> > diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf 
> > b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
> > index 909ad3e..c064a43 100644
> > --- a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
> > +++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
> > @@ -215,6 +215,12 @@ FvNameGuid = 
> > 5eda4200-2c5f-43cb-9da3-0baf74b1b30c
> ># DTB
> >INF EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
> >
> > +!if $(ARCH) == AARCH64
> > +  # ACPI support
> > +  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
> > +  INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
> > +!endif
> > +
> >  !include $(BOARD_DXE_FV_COMPONENTS)
> >
> >  # PEI phase firmware volume
> > @@ -408,3 +414,9 @@ READ_LOCK_STATUS   = TRUE
> >FILE FREEFORM = $(NAMED_GUID) {
> >  RAW BIN|.dtb
> >}
> > +
> > +[Rule.Common.USER_DEFINED.ACPITABLE]
> > +  FILE FREEFORM = $(NAMED_GUID) {
> > +RAW ASL|.aml
> > +RAW ACPI   |.acpi
> > +  }
> > diff --git 
> > a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf 
> > b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
> > new file mode 100644
> > index 000..8732e10
> > --- /dev/null
> > +++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
> > @@ -0,0 +1,61 @@
> > +## @file
> > +#  Component description file for PlatformAcpiTables module.
> > +#
> > +#  ACPI table data and ASL sources required to boot the platform.
> > +#
> > +#  Copyright (c) 2018, Linaro, Ltd. All rights reserved.
> > +#  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
> > +#
> > +#  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 

Re: [edk2] [PATCH] MdeModulePkg: Remove dead code in .c and .h files

2018-08-06 Thread Ard Biesheuvel
On 6 August 2018 at 17:37, Laszlo Ersek  wrote:
> On 08/06/18 16:54, Gao, Liming wrote:
>> Laszlo: We manually search the unused functions in the module source
>> files, and also verify the build to make sure the unused functions are
>> real dead code.
>
> Works for me, but then the commit message should state exactly this.
> Such as:
>
> """
> Remove functions that have external linkage but are never called.
> (We have manually verified that no function removed in this patch is
> ever called.)
> """
>
> Because:
>
> * "Dead code" also means such code that is conditionally reachable (for
>   example, there is a conditional call to the function); however deeper
>   analysis reveals that the condition can never evaluate to TRUE.
>
>   A patch that eliminates code for this case must stand on its own,
>   because it needs non-mechanic review. From the commit message it
>   wasn't clear whether such changes were in scope, and it was difficult
>   to tell from the code (due to the size of the patch).
>
> * "External linkage" is relevant because it highlights that the current
>   situation is at least in part the result of tooling limitations.
>
>   A large number of functions in MdeModulePkg should be STATIC (= be
>   given internal linkage), but they are kept with external linkage
>   because some VS debugging tools cannot cope with STATIC functions (to
>   my understanding).
>

Could we *please* double check if this is still the case? Is this like
the ELILO thing, where nobody remembers what version exactly needed it
and we keep cargo culting (and duplicating) the fix ad inifitum?

IMO, STATIC is a fundamental part of careful structuring of your code,
and if the tooling cannot cope, it should be fixed.

>   In turn, because utility functions are never made STATIC, gcc cannot
>   emit warnings when some of those functions are never actually called
>   (if they were STATIC, gcc would abort the build with to warnings).
>   Obviously this doesn't apply to all utility functions (some may have
>   originally been called from multiple source files).
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] MdeModulePkg: Remove dead code in .c and .h files

2018-08-06 Thread Laszlo Ersek
On 08/06/18 16:54, Gao, Liming wrote:
> Laszlo: We manually search the unused functions in the module source
> files, and also verify the build to make sure the unused functions are
> real dead code.

Works for me, but then the commit message should state exactly this.
Such as:

"""
Remove functions that have external linkage but are never called.
(We have manually verified that no function removed in this patch is
ever called.)
"""

Because:

* "Dead code" also means such code that is conditionally reachable (for
  example, there is a conditional call to the function); however deeper
  analysis reveals that the condition can never evaluate to TRUE.

  A patch that eliminates code for this case must stand on its own,
  because it needs non-mechanic review. From the commit message it
  wasn't clear whether such changes were in scope, and it was difficult
  to tell from the code (due to the size of the patch).

* "External linkage" is relevant because it highlights that the current
  situation is at least in part the result of tooling limitations.

  A large number of functions in MdeModulePkg should be STATIC (= be
  given internal linkage), but they are kept with external linkage
  because some VS debugging tools cannot cope with STATIC functions (to
  my understanding).

  In turn, because utility functions are never made STATIC, gcc cannot
  emit warnings when some of those functions are never actually called
  (if they were STATIC, gcc would abort the build with to warnings).
  Obviously this doesn't apply to all utility functions (some may have
  originally been called from multiple source files).

> I agree to separate this patch as the module level. So, we can
> document which unused functions are removed in the driver.

Thanks -- given the explanation above, I'd be fine with just a commit
message update. Still, if Shenglei has the time, I think that
module-level patching would be far better.

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


Re: [edk2] Missing boot related measurements at TPM 2.0 PCRs 0-7 with OVMF

2018-08-06 Thread Zhang, Chao B
Hi Ricardo
   I double checked OVMF Debug Build. All the 2 PCDs are already built as 
Dynamic PCD. There should be no problem
Setting & Getting these PCD as Dynamic. We also verified this feature on 
several real hardware platforms with same configuration.
No issue reported.
   Can you share me the boot log?

From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo 
Ersek
Sent: Friday, August 3, 2018 10:46 PM
To: Ricardo Araújo ; Zhang, Chao B 

Cc: edk2-devel@lists.01.org; Zeng, Star ; Gao, Liming 

Subject: Re: [edk2] Missing boot related measurements at TPM 2.0 PCRs 0-7 with 
OVMF

On 08/03/18 15:39, Ricardo Araújo wrote:
> Hi folks, sorry for the delay!
>
> I've just applied the patch and got the same error message and empty PCRs.

Thanks for the feedback -- although it's not the kind I had hoped for :)

I have now filed "[regression] SecurityPkg commit f15cb995bb38 breaks
TPM2_ENABLE in OvmfPkg":

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

Ricardo, please consider registering in the TianoCore Bugzilla, and
adding yourself to the CC list of BZ#1075.

For now, I have assigned the BZ to Marc-André, for triaging / analysis.
swtpm is not set up on my end, and the TPM2 enablement for OvmfPkg was
contributed by Marc-André. Marc-André, are you OK with this? The BZ
assignment is about root-causing the issue, at the moment.

Once we know more closely what the problem is, we can decide what to do.
If it's hard to fix, my argument will be that we should roll back
SecurityPkg commit f15cb995bb38 first (it's a regression after all), and
re-apply it only when it no longer breaks OVMF. If the issue is not hard
to fix and we can commit the solution quickly, then I'll be fine with
leaving f15cb995bb38 applied.

Thanks,
Laszlo

>
> De: "Zhang, Chao B" mailto:chao.b.zh...@intel.com>>
> Para: "Laszlo Ersek" mailto:ler...@redhat.com>>, "Ricardo 
> Araújo" mailto:rica...@lsd.ufcg.edu.br>>, 
> "Marc-André Lureau" 
> mailto:marcandre.lur...@redhat.com>>
> Cc: edk2-devel@lists.01.org, "Gao, Liming" 
> mailto:liming@intel.com>>, "Zeng, Star" 
> mailto:star.z...@intel.com>>
> Enviadas: Quinta-feira, 2 de agosto de 2018 21:22:18
> Assunto: RE: [edk2] Missing boot related measurements at TPM 2.0 PCRs 0-7 
> with OVMF
>
>
>
> Tks Lazslo. And please make sure PcdLib is correctly lined in OVMF
>
>
>
>
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Thursday, August 2, 2018 9:14 PM
> To: Zhang, Chao B mailto:chao.b.zh...@intel.com>>; 
> Ricardo Araújo mailto:rica...@lsd.ufcg.edu.br>>; 
> Marc-André Lureau 
> mailto:marcandre.lur...@redhat.com>>
> Cc: edk2-devel@lists.01.org; Gao, Liming 
> mailto:liming@intel.com>>; Zeng, Star 
> mailto:star.z...@intel.com>>
> Subject: Re: [edk2] Missing boot related measurements at TPM 2.0 PCRs 0-7 
> with OVMF
>
>
>
>
> On 08/02/18 04:04, Zhang, Chao B wrote:
>> Hi Laszlo & Ricardo
>> The patch was intended to reduce the time to read TPM interface ID register. 
>> The interface type should not change within boot cycle according to PTP spec.
>> I agree to add some ASSERT after PCDSetxxsS.
>> But It is a core solution without platform change as PCD has been configured 
>> as DYN, DYNEx in DEC. I don’t know why you meet Set Failure
>> In OVMF. Here, I include PCD expert to explain this.
>
> As far as I recall, dynamic PCDs have never behaved as actually settable
> for me unless I added dynamic defaults for them in the OVMF DSC files.
>
> I never really researched why this was the case, I just accepted that
> the dynamic defaults were apparently necessary.
>
> Let's wait for Ricardo's response. Perhaps my analysis / suspicion were
> incorrect and it's not actually the "dynamism" of the PCD that's missing
> for OVMF. Ricardo's answer will tell us if there's another issue.
>
> Thanks
> Laszlo
>
>> From: Laszlo Ersek [ mailto:ler...@redhat.com ]
>> Sent: Thursday, August 2, 2018 5:49 AM
>> To: Ricardo Araújo < rica...@lsd.ufcg.edu.br 
>> >; Zhang, Chao B < chao.b.zh...@intel.com >; 
>> Marc-André Lureau < 
>> marcandre.lur...@redhat.com >
>> Cc: edk2-devel@lists.01.org
>> Subject: Re: [edk2] Missing boot related measurements at TPM 2.0 PCRs 0-7 
>> with OVMF
>>
>> On 08/01/18 19:50, Ricardo Araújo wrote:
>>> The commit I was referring to is:
>>> https://github.com/tianocore/edk2/commit/f15cb995bb3880b77e15afe6facd3da05e599a17
>>>
>>> Regards,
>>>
>>> Ricardo Araujo -
>>> www.lsd.ufcg.edu.br/~ricardo
>>>  >
>>>
>>> - Mensagem original -
>>> De: "Ricardo Araújo" < 
>>> rica...@lsd.ufcg.edu.br
>>>  >>
>>> Para: 
>>> 

Re: [edk2] [PATCH] MdeModulePkg: Remove dead code in .c and .h files

2018-08-06 Thread Gao, Liming
Laszlo:
  We manually search the unused functions in the module source files, and also 
verify the build to make sure the unused functions are real dead code. I agree 
to separate this patch as the module level. So, we can document which unused 
functions are removed in the driver. 

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo 
> Ersek
> Sent: Monday, August 6, 2018 9:12 PM
> To: Zhang, Shenglei ; edk2-devel@lists.01.org
> Cc: Dong, Eric ; Zeng, Star 
> Subject: Re: [edk2] [PATCH] MdeModulePkg: Remove dead code in .c and .h files
> 
> On 08/06/18 09:49, shenglei wrote:
> > Some dead code has been removed in .c and .h files.
> > https://bugzilla.tianocore.org/show_bug.cgi?id=1062
> >
> > Cc: Star Zeng 
> > Cc: Eric Dong 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: shenglei 
> > ---
> >  .../Application/CapsuleApp/CapsuleDump.c  |  31 ---
> >  MdeModulePkg/Application/UiApp/FrontPage.c|  40 ---
> >  MdeModulePkg/Application/UiApp/Ui.h   |  30 --
> >  .../Bus/Ata/AtaAtapiPassThru/AhciMode.c   | 104 ---
> >  .../Bus/Ata/AtaAtapiPassThru/IdeMode.c| 257 --
> >  .../Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c|  26 --
> >  .../Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h  |  12 -
> >  MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c  |  27 --
> >  MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.h  |  11 -
> >  MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.c|  44 ---
> >  .../Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 110 
> >  .../Bus/Pci/PciBusDxe/PciDeviceSupport.c  |  80 --
> >  .../Bus/Pci/PciBusDxe/PciDeviceSupport.h  |  17 --
> >  MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c|  41 ---
> >  MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.h|  21 --
> >  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c |  94 ---
> >  MdeModulePkg/Bus/Pci/UhciPei/DmaMem.c |  22 --
> >  MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c| 125 -
> >  MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.h|  78 --
> >  MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c|  66 -
> >  MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h|  28 --
> >  MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c   |  24 --
> >  MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c|  22 --
> >  MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h|  14 -
> >  .../Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c |  24 --
> >  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.c|  24 --
> >  .../Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c | 101 ---
> >  MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c |  24 --
> >  MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c   | 180 
> >  .../Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c   |  49 
> >  MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c| 190 -
> >  MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.h|  98 ---
> >  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c   |  68 -
> >  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c   | 146 --
> >  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.h   | 114 
> >  MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.c  |  39 ---
> >  MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.h  |  18 --
> >  MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c|  77 --
> >  MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.h|  35 ---
> >  MdeModulePkg/Core/Dxe/DxeMain.h   |  13 -
> >  MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c   |  23 --
> >  MdeModulePkg/Core/Dxe/Mem/HeapGuard.c |  78 --
> >  MdeModulePkg/Core/PiSmmCore/HeapGuard.c   | 166 ---
> >  .../Core/PiSmmCore/MemoryAttributesTable.c| 131 -
> >  MdeModulePkg/Core/PiSmmCore/Page.c| 121 -
> >  .../Universal/Console/TerminalDxe/Terminal.h  |  12 -
> >  .../Console/TerminalDxe/TerminalConIn.c   |  25 --
> >  .../Universal/HiiDatabaseDxe/ConfigRouting.c  |  47 
> >  .../Universal/Network/IScsiDxe/IScsiProto.c   |  31 ---
> >  .../Universal/Network/Ip4Dxe/Ip4Config2Impl.c |  16 --
> >  .../Universal/Network/Tcp4Dxe/SockImpl.c  |  35 ---
> >  .../Universal/Network/Tcp4Dxe/SockInterface.c |  41 ---
> >  .../Universal/Network/Tcp4Dxe/Socket.h|  32 ---
> >  .../Universal/Network/Tcp4Dxe/Tcp4Option.c|  28 --
> >  .../Universal/Network/Tcp4Dxe/Tcp4Option.h|  15 -
> >  .../Universal/SetupBrowserDxe/IfrParse.c  |  33 ---
> >  56 files changed, 3358 deletions(-)
> 
> Please split this patch up to a series so that *at the least* each
> module is covered by a separate patch. For example,
> 
>  1MdeModulePkg/Application/CapsuleApp
>  2MdeModulePkg/Application/UiApp
>  3MdeModulePkg/Bus/Ata/AtaAtapiPassThru
>  4MdeModulePkg/Bus/Isa/Ps2KeyboardDxe
>  5MdeModulePkg/Bus/Pci/EhciDxe
>  6MdeModulePkg/Bus/Pci/NvmExpressDxe
>  7MdeModulePkg/Bus/Pci/PciBusDxe
>  8MdeModulePkg/Bus/Pci/SdMmcPciHcDxe
>  9

Re: [edk2] PerformancePkg on multiple platform -

2018-08-06 Thread prabin ca
Hi Team

It’s got resolved now, thanks for kind support.
The link and documents mentioned help to resolve and understand the 
architecture as well 

Thanks for such kind support by Laszlo, Andrew and Dandan

> On 04-Aug-2018, at 3:41 PM, Bi, Dandan  wrote:
> 
> Hi Prabin,
> 
> Here is a simple introduction of current performance infrastructure in latest 
> Edk2 code base.
> Hope it can have some help when you enable it.
> https://github.com/dandanbi/edk2/wiki/Performance-Infrastructure
> 
> 
> Thanks,
> Dandan
> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of prabin 
> ca
> Sent: Saturday, August 04, 2018 1:20 PM
> To: Andrew Fish 
> Cc: edk2-devel ; Laszlo Ersek 
> Subject: Re: [edk2] PerformancePkg on multiple platform -
> 
> Hi Andrew,
> 
> I have already enabled that PCD in my DSC file, because of that its working 
> in some platform.
> 
> What I'm doing is building my DP.efi and DXE driver from that dsc file and 
> testing it from UEFI shell.
> 
> thanks for your help as well.
> 
>> On Sat, Aug 4, 2018 at 12:08 AM, Andrew Fish  wrote:
>> 
>> Prabin,
>> 
>> There is a PCD setting to configure performance collection.
>> 
>> PCDs are defined in the .DEC file and it looks like the default is 
>> zero and that means disabled.
>> MdePkg/MdePkg.dec
>> ...
>>  ## The mask is used to control PerformanceLib behavior.
>>  #  BIT0 - Enable Performance Measurement.
>>  # @Prompt Performance Measurement Property.
>>  # @Expression  0x8002 | (gEfiMdePkgTokenSpaceGuid.
>> PcdPerformanceLibraryPropertyMask & 0xFE) == 0
>>  gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyM
>> ask|0|UINT8|0x0009
>> 
>> If you search the code you will see some platforms enabling 
>> performance measurement in their DSC files.
>> 
>> /Volumes/Case/UDK2018(vUDK2018)>git grep gEfiMdePkgTokenSpaceGuid.
>> PcdPerformanceLibraryPropertyMask -- *.dsc
>> BeagleBoardPkg/BeagleBoardPkg.dsc:272:
>> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|1
>> EmbeddedPkg/EmbeddedPkg.dsc:175:
>> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0
>> QuarkPlatformPkg/Quark.dsc:373:
>> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0x1
>> QuarkPlatformPkg/Quark.dsc:376:
>> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0x00
>> QuarkPlatformPkg/QuarkMin.dsc:334:
>> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0x1
>> QuarkPlatformPkg/QuarkMin.dsc:337:
>> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0x00
>> Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:682:
>> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0x1
>> Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:682:
>> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0x1
>> Vlv2TbltDevicePkg/PlatformPkgX64.dsc:682:
>> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0x1
>> 
>> So I'd check that 1st. If that does not work I recommend adding 
>> -report-file=build.log to your build command. You can look at the 
>> given driver/app you care about and see what the PCD settings are and 
>> which instance of the PerformanceLib got linked.
>> 
>> Thanks,
>> 
>> Andrew Fish
>> 
>> On Aug 3, 2018, at 11:17 AM, Laszlo Ersek  wrote:
>> 
>> Hi Prabin,
>> 
>> On 08/03/18 09:29, prabin ca wrote:
>> 
>> Hi Team,
>> 
>> I’m new to uefi and edk. Currently I’m trying to get performance of my 
>> dxe driver using PerformancePkg of EDK source code.
>> 
>> I’m using perf_start and perf_end T respected check points, it’s hot 
>> build and tested well in 2/3 platform. It’s giving proper response.
>> 
>> But when I’m Checking with multiple platform, in some of platforms 
>> it’s not working and got hang in uefi she’ll itself.
>> 
>> Please help me to resolve asap, it will be really helpful.
>> 
>> 
>> I can only give you some hints, because thus far I have also failed to 
>> figure out how performance measurements should be enabled for a 
>> platform from scratch.
>> 
>> Earlier I thought that an interested platform should include modules 
>> from PerformancePkg. I got some good results that way; however:
>> 
>> - it wouldn't work for AARCH64, and so I filed  
>> 
>> 
>> - ultimately PerformancePkg was removed in commit 922c1e94e4bb  
>> completely. (And for that reason I now closed TianoCore#679 as
>> WONTFIX.)
>> 
>> Commit 922c1e94e4bb doesn't really give pointers for enabling 
>> performance measurements in a platform -- it refers the user to the DP 
>> shell command instead of the standalone DP application, but that's 
>> only for displaying the stats, not for recording them.
>> 
>> One document where I found information is the Intel whitepaper
>> 
>> A Tour Beyond BIOS
>> Implementing Profiling in with EDK II
>> 
>> (just google it). "Part III – Performance Profile" is relevant.
>> 
>> The first section of that talks about enabling ACPI FPDT (ACPI 
>> Firmware Performance Data Table) support in edk2, for 

Re: [edk2] [PATCH 0/6] BaseTools/Source/C: take EXTRA_OPTFLAGS and EXTRA_LDFLAGS from the caller

2018-08-06 Thread Gao, Liming
Laszlo:
  Thanks for your detail information. I understand EXTRA_OPTFLAGS. So, its name 
is OK to me. 

  On Pccts, it is the third party code. I would like to make the minimal 
change. So, I ask whether we not touch it. 

Thanks
Liming
> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Friday, August 3, 2018 1:41 AM
> To: Gao, Liming ; edk2-devel-01 
> 
> Cc: Zhu, Yonghong 
> Subject: Re: [PATCH 0/6] BaseTools/Source/C: take EXTRA_OPTFLAGS and 
> EXTRA_LDFLAGS from the caller
> 
> On 08/02/18 17:40, Gao, Liming wrote:
> > Laszlo:
> >   I understand this patch set is to provide the way to append compile and 
> > link option for BaseTools source build.
> 
> Yes.
> 
> > If so, the extend flag name may be EXTRA_CCFLAGS
> 
> I can rename EXTRA_OPTFLAGS to EXTRA_CCFLAGS, but in that case,
> internally we will have:
> 
>   BUILD_OPTFLAGS = -O2 $(EXTRA_CCFLAGS)
> 
> in "header.makefile". In that case, I expect to receive a comment that
> we shouldn't append a generic "CCFLAGS" variable to a more specialized
> "OPTFLAGS" variable.
> 
> Obviously, I can rename "BUILD_OPTFLAGS" to "BUILD_CCFLAGS" as well --
> but, in that case, I expect to receive a comment that we already have
> "BUILD_CFLAGS".
> 
> The variable (more precisely, "RPM macro") that the Fedora distribution
> will put into EXTRA_OPTFLAGS is also called %{optflags}. So I think
> EXTRA_OPTFLAGS is an appropriate name.
> 
> 
> If you still disagree, then can you please suggest a new name not just
> for EXTRA_OPTFLAGS (-->EXTRA_CCFLAGS), but also for BUILD_OPTFLAGS?
> Patch #3 explains why we need a separate BUILD_OPTFLAGS Makefile macro.
> 
> 
> > and EXTRA_LDFLAGS.
> 
> Right, that's the currently proposed name.
> 
> > And, the extend flags are appended in the tail.
> 
> Correct.
> 
> >   Besides, Pccts is the internal tool to generate VfrCompiler syntax source 
> > file. It is not used in build process. I am not sure why they
> also require the additional CC and LD flags.
> 
> It's a general policy thing; all native binaries should be built with
> the system-wide flags. Some of those flags will let the binaries detect
> some buffer overflows automatically, for example, which is helpful even
> if the utility is never installed / packaged, just used as a one-off
> build tool.
> 
> Thanks!
> Laszlo
> 
> >
> > Thanks
> > Liming
> >> -Original Message-
> >> From: Laszlo Ersek [mailto:ler...@redhat.com]
> >> Sent: Thursday, July 26, 2018 8:44 AM
> >> To: edk2-devel-01 
> >> Cc: Gao, Liming ; Zhu, Yonghong 
> >> 
> >> Subject: [PATCH 0/6] BaseTools/Source/C: take EXTRA_OPTFLAGS and 
> >> EXTRA_LDFLAGS from the caller
> >>
> >> Repo:   https://github.com/lersek/edk2.git
> >> Branch: extra_flags_rhbz1540244
> >>
> >> In the Fedora distribution, we'd like to pass system-wide flags related
> >> to optimization and linking when the C and C++ language base tools are
> >> built. This series lets the outermost "make" command push the
> >> EXTRA_OPTFLAGS and EXTRA_LDFLAGS macros into the BaseTools build.
> >>
> >> Cc: Liming Gao 
> >> Cc: Yonghong Zhu 
> >>
> >> Thanks
> >> Laszlo
> >>
> >> Laszlo Ersek (6):
> >>   BaseTools/footer.makefile: expand BUILD_CFLAGS last for C files too
> >>   BaseTools/header.makefile: remove "-c" from BUILD_CFLAGS
> >>   BaseTools/Source/C: split "-O2" to BUILD_OPTFLAGS
> >>   BaseTools/Pccts: clean up antlr and dlg makefiles
> >>   BaseTools/Source/C: take EXTRA_OPTFLAGS from the caller
> >>   BaseTools/Source/C: take EXTRA_LDFLAGS from the caller
> >>
> >>  BaseTools/Source/C/Makefiles/footer.makefile   |  2 +-
> >>  BaseTools/Source/C/Makefiles/header.makefile   | 16 ---
> >>  BaseTools/Source/C/VfrCompile/GNUmakefile  | 11 +---
> >>  BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile | 22 ++-
> >>  BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile   | 28 
> >> +---
> >>  5 files changed, 56 insertions(+), 23 deletions(-)
> >>
> >> --
> >> 2.14.1.3.gb7cf6e02401b
> >

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


Re: [edk2] [PATCH] IntelFrameworkModulePkg: Remove redundant definitions and functions

2018-08-06 Thread Laszlo Ersek
On 08/06/18 04:54, shenglei wrote:
> Some dead code functions and redundant definitions
> have been removed in inf, .c and .h files.
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1063
> 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: shenglei 
> ---
>  .../Bus/Isa/IsaIoDxe/IsaDriver.h  |   1 -
>  .../Bus/Isa/IsaIoDxe/IsaIoDxe.inf |   1 -
>  .../Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c|  18 --
>  .../Bus/Pci/IdeBusDxe/Ata.c   | 105 
>  .../Bus/Pci/IdeBusDxe/DriverConfiguration.c   | 156 --
>  .../Csm/BiosThunk/Snp16Dxe/PxeUndi.c  |  66 +---
>  .../Csm/LegacyBiosDxe/LegacyBiosDxe.inf   |   2 -
>  .../Csm/LegacyBiosDxe/LegacyBiosInterface.h   |   2 -
>  .../Universal/BdsDxe/BootMaint/BmLib.c|  24 ---
>  .../Universal/BdsDxe/BootMaint/BootOption.c   |  52 --
>  .../Universal/BdsDxe/BootMaint/Variable.c |  58 ---
>  .../Universal/BdsDxe/FrontPage.c  |  18 --
>  12 files changed, 1 insertion(+), 502 deletions(-)

Please split this patch to a series as well (see
 for
my reasoning).

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


Re: [edk2] [PATCH] MdeModulePkg: Remove dead code in .c and .h files

2018-08-06 Thread Laszlo Ersek
On 08/06/18 09:49, shenglei wrote:
> Some dead code has been removed in .c and .h files.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1062
> 
> Cc: Star Zeng 
> Cc: Eric Dong 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: shenglei 
> ---
>  .../Application/CapsuleApp/CapsuleDump.c  |  31 ---
>  MdeModulePkg/Application/UiApp/FrontPage.c|  40 ---
>  MdeModulePkg/Application/UiApp/Ui.h   |  30 --
>  .../Bus/Ata/AtaAtapiPassThru/AhciMode.c   | 104 ---
>  .../Bus/Ata/AtaAtapiPassThru/IdeMode.c| 257 --
>  .../Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c|  26 --
>  .../Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h  |  12 -
>  MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c  |  27 --
>  MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.h  |  11 -
>  MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.c|  44 ---
>  .../Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 110 
>  .../Bus/Pci/PciBusDxe/PciDeviceSupport.c  |  80 --
>  .../Bus/Pci/PciBusDxe/PciDeviceSupport.h  |  17 --
>  MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c|  41 ---
>  MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.h|  21 --
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c |  94 ---
>  MdeModulePkg/Bus/Pci/UhciPei/DmaMem.c |  22 --
>  MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c| 125 -
>  MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.h|  78 --
>  MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c|  66 -
>  MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h|  28 --
>  MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c   |  24 --
>  MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c|  22 --
>  MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h|  14 -
>  .../Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c |  24 --
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.c|  24 --
>  .../Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c | 101 ---
>  MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c |  24 --
>  MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c   | 180 
>  .../Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c   |  49 
>  MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c| 190 -
>  MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.h|  98 ---
>  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c   |  68 -
>  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c   | 146 --
>  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.h   | 114 
>  MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.c  |  39 ---
>  MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.h  |  18 --
>  MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c|  77 --
>  MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.h|  35 ---
>  MdeModulePkg/Core/Dxe/DxeMain.h   |  13 -
>  MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c   |  23 --
>  MdeModulePkg/Core/Dxe/Mem/HeapGuard.c |  78 --
>  MdeModulePkg/Core/PiSmmCore/HeapGuard.c   | 166 ---
>  .../Core/PiSmmCore/MemoryAttributesTable.c| 131 -
>  MdeModulePkg/Core/PiSmmCore/Page.c| 121 -
>  .../Universal/Console/TerminalDxe/Terminal.h  |  12 -
>  .../Console/TerminalDxe/TerminalConIn.c   |  25 --
>  .../Universal/HiiDatabaseDxe/ConfigRouting.c  |  47 
>  .../Universal/Network/IScsiDxe/IScsiProto.c   |  31 ---
>  .../Universal/Network/Ip4Dxe/Ip4Config2Impl.c |  16 --
>  .../Universal/Network/Tcp4Dxe/SockImpl.c  |  35 ---
>  .../Universal/Network/Tcp4Dxe/SockInterface.c |  41 ---
>  .../Universal/Network/Tcp4Dxe/Socket.h|  32 ---
>  .../Universal/Network/Tcp4Dxe/Tcp4Option.c|  28 --
>  .../Universal/Network/Tcp4Dxe/Tcp4Option.h|  15 -
>  .../Universal/SetupBrowserDxe/IfrParse.c  |  33 ---
>  56 files changed, 3358 deletions(-)

Please split this patch up to a series so that *at the least* each
module is covered by a separate patch. For example,

 1  MdeModulePkg/Application/CapsuleApp
 2  MdeModulePkg/Application/UiApp
 3  MdeModulePkg/Bus/Ata/AtaAtapiPassThru
 4  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe
 5  MdeModulePkg/Bus/Pci/EhciDxe
 6  MdeModulePkg/Bus/Pci/NvmExpressDxe
 7  MdeModulePkg/Bus/Pci/PciBusDxe
 8  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe
 9  MdeModulePkg/Bus/Pci/UhciPei
10  MdeModulePkg/Bus/Pci/XhciDxe
11  MdeModulePkg/Bus/Pci/XhciPei
12  MdeModulePkg/Bus/Sd/EmmcBlockIoPei
13  MdeModulePkg/Bus/Sd/SdBlockIoPei
14  MdeModulePkg/Bus/Ufs/UfsBlockIoPei
15  MdeModulePkg/Bus/Ufs/UfsPassThruDxe
16  MdeModulePkg/Bus/Usb/UsbBotPei
17  MdeModulePkg/Bus/Usb/UsbBusDxe
18  MdeModulePkg/Bus/Usb/UsbBusPei
19  MdeModulePkg/Core/Dxe
20  MdeModulePkg/Core/PiSmmCore
21  MdeModulePkg/Universal/Console/TerminalDxe
22  MdeModulePkg/Universal/HiiDatabaseDxe
23  MdeModulePkg/Universal/Network/IScsiDxe
24  MdeModulePkg/Universal/Network/Ip4Dxe
25  MdeModulePkg/Universal/Network/Tcp4Dxe
26  MdeModulePkg/Universal/SetupBrowserDxe

Removing 3358 lines, under a blanket "dead code" comment, across 26
drivers, is terribly bad 

Re: [edk2] [PATCH] IntelFrameworkModulePkg/Csm: Set CSM memory executable

2018-08-06 Thread Laszlo Ersek
On 08/06/18 12:20, Zeng, Star wrote:
> Cc Jian.

Right; I believe a non-empty commit message would be helpful. (Issue
description, circumstances of the failure, what the exact edk2 security
feature or setting is that the current LegacyBiosDxe code conflicts
with, ...)

Thanks,
Laszlo

> Thanks,
> Star
> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ruiyu 
> Ni
> Sent: Monday, August 6, 2018 5:57 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star 
> Subject: [edk2] [PATCH] IntelFrameworkModulePkg/Csm: Set CSM memory executable
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni 
> Cc: Star Zeng 
> ---
>  .../Csm/LegacyBiosDxe/LegacyBios.c | 22 
> +-
>  1 file changed, 17 insertions(+), 5 deletions(-)
> 
> diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c 
> b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
> index 8f14687b28..f86d00b53f 100644
> --- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
> +++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
> @@ -64,8 +64,9 @@ AllocateLegacyMemory (
>OUT EFI_PHYSICAL_ADDRESS  *Result
>)
>  {
> -  EFI_STATUSStatus;
> -  EFI_PHYSICAL_ADDRESS  MemPage;
> +  EFI_STATUS  Status;
> +  EFI_PHYSICAL_ADDRESSMemPage;
> +  EFI_GCD_MEMORY_SPACE_DESCRIPTOR MemDesc;
>  
>//
>// Allocate Pages of memory less <= StartPageAddress @@ -83,10 +84,21 @@ 
> AllocateLegacyMemory (
>//
>if (!EFI_ERROR (Status)) {
>  *Result = (EFI_PHYSICAL_ADDRESS) (UINTN) MemPage;
> +if (MemoryType != EfiBootServicesCode) {
> +  //
> +  // Make sure that the buffer can be used to store code.
> +  //
> +  Status = gDS->GetMemorySpaceDescriptor (MemPage, );
> +  if (!EFI_ERROR (Status) && (MemDesc.Attributes & EFI_MEMORY_XP) != 0) {
> +Status = gDS->SetMemorySpaceAttributes (
> +MemPage,
> +EFI_PAGES_TO_SIZE (Pages),
> +MemDesc.Attributes & (~EFI_MEMORY_XP)
> +);
> +  }
> +}
>}
> -  //
> -  // If reach here the status = EFI_SUCCESS
> -  //
> +
>return Status;
>  }
>  
> --
> 2.16.1.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> ___
> edk2-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] [platforms: PATCH 7/9] Marvell/Armada70x0Db: Enable ACPI support

2018-08-06 Thread Ard Biesheuvel
On 6 August 2018 at 01:28, Marcin Wojtas  wrote:
> This patch introduces DSDT table and adds necessary
> wiring in order to enable ACPI support on Armada 7040 DB.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marcin Wojtas 
> ---
>  Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc |  14 ++
>  Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc|   3 +
>  Silicon/Marvell/Armada7k8k/Armada7k8k.fdf |  12 +
>  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf |  61 
> ++
>  Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc|   5 +
>  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl   | 229 
> 
>  Silicon/Marvell/Documentation/PortingGuide.txt|  22 ++
>  7 files changed, 346 insertions(+)
>  create mode 100644 
> Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
>  create mode 100644 
> Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl
>
> diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc 
> b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
> index f1ccda0..d4c67a2 100644
> --- a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
> +++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
> @@ -593,6 +593,20 @@
>ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
>  !endif #$(INCLUDE_TFTP_COMMAND)
>
> +[Components.AARCH64]
> +  #
> +  # Generic ACPI modules
> +  #
> +  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
> +  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf {
> +
> +  
> PlatformHasAcpiLib|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf
> +
> +
> +  # support ACPI v5.0 or later
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20
> +  }
> +
>  
> [BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION]
>GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
>
> diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc 
> b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
> index d3dffb0..f6faff1 100644
> --- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
> +++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
> @@ -51,6 +51,9 @@
>  [Components.common]
>Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
>
> +[Components.AARCH64]
> +  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
> +
>  
> 
>  #
>  # Pcd Section - list of all EDK II PCD Entries defined by this Platform
> diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf 
> b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
> index 909ad3e..c064a43 100644
> --- a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
> +++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
> @@ -215,6 +215,12 @@ FvNameGuid = 5eda4200-2c5f-43cb-9da3-0baf74b1b30c
># DTB
>INF EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
>
> +!if $(ARCH) == AARCH64
> +  # ACPI support
> +  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
> +  INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
> +!endif
> +
>  !include $(BOARD_DXE_FV_COMPONENTS)
>
>  # PEI phase firmware volume
> @@ -408,3 +414,9 @@ READ_LOCK_STATUS   = TRUE
>FILE FREEFORM = $(NAMED_GUID) {
>  RAW BIN|.dtb
>}
> +
> +[Rule.Common.USER_DEFINED.ACPITABLE]
> +  FILE FREEFORM = $(NAMED_GUID) {
> +RAW ASL|.aml
> +RAW ACPI   |.acpi
> +  }
> diff --git 
> a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf 
> b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
> new file mode 100644
> index 000..8732e10
> --- /dev/null
> +++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
> @@ -0,0 +1,61 @@
> +## @file
> +#  Component description file for PlatformAcpiTables module.
> +#
> +#  ACPI table data and ASL sources required to boot the platform.
> +#
> +#  Copyright (c) 2018, Linaro, Ltd. All rights reserved.
> +#  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
> +#
> +#  This program and the accompanying materials
> +#  are licensed and made available under the terms and conditions of the BSD 
> License
> +#  which accompanies this distribution.  The full text of the license may be 
> found at
> +#  http://opensource.org/licenses/bsd-license.php
> +#
> +#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION= 0x0001001A
> +  BASE_NAME  = PlatformAcpiTables
> +  FILE_GUID  = 7E374E25-8E01-4FEE-87F2-390C23C606CD
> +  MODULE_TYPE= USER_DEFINED
> +  

Re: [edk2] [PATCH edk2-platforms v1 0/2] Modify following Switch generic PciHostBridge

2018-08-06 Thread Leif Lindholm
On Sun, Aug 05, 2018 at 10:38:53AM +0800, Ming Huang wrote:
> The major features of this patchset include:
> 1. Remove D02 platform;
> 2. Fix a D03 issue about switch generic PciHostBridge;
> 
> Code can also be found in github: 
> https://github.com/hisilicon/OpenPlatformPkg.git
> branch: rm-D02

This looks fine, but I think we also need a companion patch to delete
items only used by D02 from edk2-non-osi.

/
Leif

> Ming Huang (2):
>   Hisilicon/D02: Remove D02 platform
>   Platform/Hisilicon/D03: Fix PlatformPciLib path wrong issue
> 
>  Platform/Hisilicon/D02/Pv660D02.dec   |  44 --
>  Platform/Hisilicon/D02/Pv660D02.dsc   | 425 --
>  Platform/Hisilicon/D03/D03.dsc|   4 +-
>  Platform/Hisilicon/D02/Pv660D02.fdf   | 321 -
>  .../D02/EarlyConfigPeim/EarlyConfigPeim.inf   |  53 ---
>  .../D02/FdtUpdateLibD02/FdtUpdateLib.inf  |  43 --
>  .../Library/OemMiscLibD02/OemMiscLibD02.inf   |  45 --
>  .../Library/PlatformPciLib/PlatformPciLib.inf | 182 
>  .../D02/OemNicConfigD02/OemNicConfigD02.inf   |  50 ---
>  .../Hisilicon/D02/Include/Library/CpldD02.h   |  34 --
>  .../D02/OemNicConfigD02/OemNicConfig.h|  31 --
>  .../D02/EarlyConfigPeim/EarlyConfigPeim.c |  94 
>  .../D02/FdtUpdateLibD02/FdtUpdateLib.c| 341 --
>  .../Library/OemMiscLibD02/BoardFeatureD02.c   | 105 -
>  .../D02/Library/OemMiscLibD02/OemMiscLibD02.c |  77 
>  .../Library/PlatformPciLib/PlatformPciLib.c   | 147 --
>  .../D02/OemNicConfigD02/OemNicConfigD02.c | 173 ---
>  .../Drivers/AcpiPlatformDxe/EthMac.c  |   4 +-
>  .../OemMiscLibD02/BoardFeatureD02Strings.uni  | Bin 1796 -> 0 bytes
>  19 files changed, 3 insertions(+), 2170 deletions(-)
>  delete mode 100644 Platform/Hisilicon/D02/Pv660D02.dec
>  delete mode 100644 Platform/Hisilicon/D02/Pv660D02.dsc
>  delete mode 100644 Platform/Hisilicon/D02/Pv660D02.fdf
>  delete mode 100644 Platform/Hisilicon/D02/EarlyConfigPeim/EarlyConfigPeim.inf
>  delete mode 100644 Platform/Hisilicon/D02/FdtUpdateLibD02/FdtUpdateLib.inf
>  delete mode 100644 
> Platform/Hisilicon/D02/Library/OemMiscLibD02/OemMiscLibD02.inf
>  delete mode 100644 
> Platform/Hisilicon/D02/Library/PlatformPciLib/PlatformPciLib.inf
>  delete mode 100644 Platform/Hisilicon/D02/OemNicConfigD02/OemNicConfigD02.inf
>  delete mode 100644 Platform/Hisilicon/D02/Include/Library/CpldD02.h
>  delete mode 100644 Platform/Hisilicon/D02/OemNicConfigD02/OemNicConfig.h
>  delete mode 100644 Platform/Hisilicon/D02/EarlyConfigPeim/EarlyConfigPeim.c
>  delete mode 100644 Platform/Hisilicon/D02/FdtUpdateLibD02/FdtUpdateLib.c
>  delete mode 100644 
> Platform/Hisilicon/D02/Library/OemMiscLibD02/BoardFeatureD02.c
>  delete mode 100644 
> Platform/Hisilicon/D02/Library/OemMiscLibD02/OemMiscLibD02.c
>  delete mode 100644 
> Platform/Hisilicon/D02/Library/PlatformPciLib/PlatformPciLib.c
>  delete mode 100644 Platform/Hisilicon/D02/OemNicConfigD02/OemNicConfigD02.c
>  delete mode 100644 
> Platform/Hisilicon/D02/Library/OemMiscLibD02/BoardFeatureD02Strings.uni
> 
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH 0/2] Fix ESRT out of date

2018-08-06 Thread Star Zeng
Cc: Michael D Kinney 

Star Zeng (2):
  FmpDevicePkg FmpDxe: Need repopulate after SetImage is called
  MdeModulePkg ErstFmpDxe: Create ESRT in ReadyToBoot event

 FmpDevicePkg/FmpDxe/FmpDxe.c|  21 +--
 MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c | 239 
 2 files changed, 109 insertions(+), 151 deletions(-)

-- 
2.7.0.windows.1

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


[edk2] [PATCH 2/2] MdeModulePkg ErstFmpDxe: Create ESRT in ReadyToBoot event

2018-08-06 Thread Star Zeng
Current code just creates ESRT entry in FMP notification
and installs ESRT configuration table in ReadyToBoot event.

The LastAttemptVersion and LastAttemptStatus in ESRT will
be out of date after system continues to boot without reset
after capsule update (reset is required or capsule update
is failed).

This patches updates the code to create ESRT based on all
FMP instances in ReadyToBoot event.

Cc: Michael D Kinney 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng 
---
 MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c | 239 
 1 file changed, 103 insertions(+), 136 deletions(-)

diff --git a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c 
b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
index cc9dd63b53cd..219059760e97 100644
--- a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
+++ b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
@@ -55,47 +55,34 @@ PrintTable (
 //
 #define GROWTH_STEP  10
 
-//
-// Module globals.
-//
-EFI_EVENT  mEsrtReadyToBootEvent;
-EFI_SYSTEM_RESOURCE_TABLE  *mTable = NULL;
-BOOLEANmEsrtInstalled = FALSE;
-EFI_EVENT  mFmpInstallEvent;
-VOID   *mFmpInstallEventRegistration = NULL;
-
 /**
   Install EFI System Resource Table into the UEFI Configuration Table
 
+  @param[in] Table  Pointer to the ESRT.
+
   @return  Status code.
 
 **/
 EFI_STATUS
 InstallEfiSystemResourceTableInUefiConfigurationTable (
-   VOID
+  IN EFI_SYSTEM_RESOURCE_TABLE  *Table
   )
 {
   EFI_STATUS Status;
 
   Status = EFI_SUCCESS;
-  if (!mEsrtInstalled) {
-if (mTable == NULL) {
-  DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Can't install ESRT table because it is 
NULL. \n"));
-  Status = EFI_OUT_OF_RESOURCES;
-} else if (mTable->FwResourceCount == 0) {
-  DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Can't install ESRT table because it 
has zero Entries. \n"));
-  Status = EFI_UNSUPPORTED;
+  if (Table->FwResourceCount == 0) {
+DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Can't install ESRT table because it has 
zero Entries. \n"));
+Status = EFI_UNSUPPORTED;
+  } else {
+//
+// Install the pointer into config table
+//
+Status = gBS->InstallConfigurationTable (, 
Table);
+if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Can't install ESRT table.  Status: %r. 
\n", Status));
 } else {
-  //
-  // Install the pointer into config table
-  //
-  Status = gBS->InstallConfigurationTable (, 
mTable);
-  if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Can't install ESRT table.  Status: 
%r. \n", Status));
-  } else {
-DEBUG ((DEBUG_INFO, "EsrtFmpDxe: Installed ESRT table. \n"));
-mEsrtInstalled = TRUE;
-  }
+  DEBUG ((DEBUG_INFO, "EsrtFmpDxe: Installed ESRT table. \n"));
 }
   }
   return Status;
@@ -135,15 +122,18 @@ IsSystemFmp (
   given a FMP descriptor.  If the guid is already in the ESRT it
   will be ignored.  The ESRT will grow if it does not have enough room.
 
-  @param[in]  FmpImageInfoBufPointer to the EFI_FIRMWARE_IMAGE_DESCRIPTOR.
-  @param[in]  FmpVersion FMP Version.
+  @param[in, out] Table On input, pointer to the pointer to the 
ESRT.
+On output, same as input or pointer to the 
pointer
+to new enlarged ESRT.
+  @param[in]  FmpImageInfoBuf   Pointer to the 
EFI_FIRMWARE_IMAGE_DESCRIPTOR.
+  @param[in]  FmpVersionFMP Version.
 
   @return  Status code.
 
 **/
 EFI_STATUS
-EFIAPI
 CreateEsrtEntry (
+  IN OUT EFI_SYSTEM_RESOURCE_TABLE  **Table,
   IN EFI_FIRMWARE_IMAGE_DESCRIPTOR  *FmpImageInfoBuf,
   IN UINT32 FmpVersion
   )
@@ -156,18 +146,11 @@ CreateEsrtEntry (
   Index = 0;
   Entry = NULL;
 
-  //
-  // Get our ESRT table.  This should never be null at this point
-  //
-  if (mTable == NULL) {
-return EFI_DEVICE_ERROR;
-  }
-
-  Entry = (EFI_SYSTEM_RESOURCE_ENTRY *)(mTable + 1);
+  Entry = (EFI_SYSTEM_RESOURCE_ENTRY *)((*Table) + 1);
   //
   // Make sure Guid isn't already in the list
   //
-  for (Index = 0; Index < mTable->FwResourceCount; Index++) {
+  for (Index = 0; Index < (*Table)->FwResourceCount; Index++) {
 if (CompareGuid (>FwClass, >ImageTypeId)) {
   DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: ESRT Entry already exists for FMP 
Instance with GUID %g\n", >FwClass));
   return EFI_INVALID_PARAMETER;
@@ -178,18 +161,8 @@ CreateEsrtEntry (
   //
   // Grow table if needed
   //
-  if (mTable->FwResourceCount >= mTable->FwResourceCountMax) {
-//
-// Can't grow table after installed.
-// Only because didn't add support for this.
-// Would need to re-install ESRT in system table if wanted to support
-//
-if (mEsrtInstalled) {
-  DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failed to install entry because ESRT 
table needed to grow after table already installed. \n"));
-  return 

[edk2] [PATCH 1/2] FmpDevicePkg FmpDxe: Need repopulate after SetImage is called

2018-08-06 Thread Star Zeng
No need repopulate if SetImage is not called.
But need repopulate after SetImage is called to update
LastAttemptVersion and LastAttemptStatus

Cc: Michael D Kinney 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng 
---
 FmpDevicePkg/FmpDxe/FmpDxe.c | 21 ++---
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
index eb3a9b0e32c2..3794ac5008f9 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -906,9 +906,6 @@ SetTheImage (
   UINT32  AllHeaderSize;
   UINT32  IncommingFwVersion;
   UINT32  LastAttemptStatus;
-  EFI_STATUS  GetAttributesStatus;
-  UINT64  AttributesSupported;
-  UINT64  AttributesSetting;
   UINT32  Version;
   UINT32  LowestSupportedVersion;
 
@@ -1121,18 +1118,6 @@ SetTheImage (
 
   LastAttemptStatus = LAST_ATTEMPT_STATUS_SUCCESS;
 
-  //
-  // Set flag so the descriptor is repopulated
-  // This is only applied to devices that do not require reset
-  //
-  GetAttributesStatus = FmpDeviceGetAttributes (, 
);
-  if (!EFI_ERROR (GetAttributesStatus)) {
-if (((AttributesSupported & IMAGE_ATTRIBUTE_RESET_REQUIRED) == 0) ||
-((AttributesSetting & IMAGE_ATTRIBUTE_RESET_REQUIRED) == 0)) {
-  mDescriptorPopulated = FALSE;
-}
-  }
-
 cleanup:
   mProgressFunc = NULL;
   mProgressSupported = FALSE;
@@ -1145,6 +1130,12 @@ cleanup:
 Progress (100);
   }
 
+  //
+  // Need repopulate after SetImage is called to
+  // update LastAttemptVersion and LastAttemptStatus.
+  //
+  mDescriptorPopulated = FALSE;
+
   return Status;
 }
 
-- 
2.7.0.windows.1

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


Re: [edk2] [PATCH] IntelFrameworkModulePkg/Csm: Set CSM memory executable

2018-08-06 Thread Zeng, Star
Cc Jian.

Thanks,
Star

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ruiyu Ni
Sent: Monday, August 6, 2018 5:57 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star 
Subject: [edk2] [PATCH] IntelFrameworkModulePkg/Csm: Set CSM memory executable

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Star Zeng 
---
 .../Csm/LegacyBiosDxe/LegacyBios.c | 22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c 
b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
index 8f14687b28..f86d00b53f 100644
--- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
+++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
@@ -64,8 +64,9 @@ AllocateLegacyMemory (
   OUT EFI_PHYSICAL_ADDRESS  *Result
   )
 {
-  EFI_STATUSStatus;
-  EFI_PHYSICAL_ADDRESS  MemPage;
+  EFI_STATUS  Status;
+  EFI_PHYSICAL_ADDRESSMemPage;
+  EFI_GCD_MEMORY_SPACE_DESCRIPTOR MemDesc;
 
   //
   // Allocate Pages of memory less <= StartPageAddress @@ -83,10 +84,21 @@ 
AllocateLegacyMemory (
   //
   if (!EFI_ERROR (Status)) {
 *Result = (EFI_PHYSICAL_ADDRESS) (UINTN) MemPage;
+if (MemoryType != EfiBootServicesCode) {
+  //
+  // Make sure that the buffer can be used to store code.
+  //
+  Status = gDS->GetMemorySpaceDescriptor (MemPage, );
+  if (!EFI_ERROR (Status) && (MemDesc.Attributes & EFI_MEMORY_XP) != 0) {
+Status = gDS->SetMemorySpaceAttributes (
+MemPage,
+EFI_PAGES_TO_SIZE (Pages),
+MemDesc.Attributes & (~EFI_MEMORY_XP)
+);
+  }
+}
   }
-  //
-  // If reach here the status = EFI_SUCCESS
-  //
+
   return Status;
 }
 
--
2.16.1.windows.1

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


Re: [edk2] [PATCH edk2-non-osi v1 1/1] Hisilicon/D06: Add binary modules

2018-08-06 Thread Leif Lindholm
On Tue, Jul 24, 2018 at 03:28:16PM +0800, Ming Huang wrote:
> Add initial binary for D06.
> Build commit infomation:
> edk2: e73f499
> edk2-platforms: 7f223e6
> HwPkg: e0bf35e
> TrusedFirmware: 4eda1d1
> Tools: 6b286b1

The above information is all good, but can you add a summary
specifying what each driver is? Just a one-line description per module
should be enough.

For the .depex files - they get garbled by git format-patch.
Could you add a .gitattributes file in your edk2-non-osi root 
as per
https://www.mail-archive.com/edk2-devel@lists.01.org/msg13992.html
before regenerating a new set?

Actually, could you create that as a patch and send out with me, Mike,
Ard, Laszlo on cc? I think this topic is ready for another round of
discussions.

/
LEif

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Platform/Hisilicon/D06/Drivers/GetInfoFromBmc/GetInfoFromBmc.depex   
>   |   1 +
>  Platform/Hisilicon/D06/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi 
>   | Bin 0 -> 20384 bytes
>  Platform/Hisilicon/D06/Drivers/GetInfoFromBmc/GetInfoFromBmc.inf 
>   |  26 
>  Platform/Hisilicon/D06/Drivers/IoInitDxe/IoInitDxe.depex 
>   |   1 +
>  Platform/Hisilicon/D06/Drivers/IoInitDxe/IoInitDxe.efi   
>   | Bin 0 -> 228352 bytes
>  Platform/Hisilicon/D06/Drivers/IoInitDxe/IoInitDxe.inf   
>   |  27 
>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.depex  
>   |   1 +
>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.efi
>   | Bin 0 -> 29376 bytes
>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.inf
>   |  28 +
>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.depex  
>   |   1 +
>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi
>   | Bin 0 -> 21600 bytes
>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.inf
>   |  27 
>  Platform/Hisilicon/D06/Drivers/IpmiMiscOpDxe/IpmiMiscOp.depex
>   |   1 +
>  Platform/Hisilicon/D06/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi  
>   | Bin 0 -> 24672 bytes
>  Platform/Hisilicon/D06/Drivers/IpmiMiscOpDxe/IpmiMiscOpDxe.inf   
>   |  27 
>  Platform/Hisilicon/D06/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.depex 
>   |   1 +
>  Platform/Hisilicon/D06/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi   
>   | Bin 0 -> 20672 bytes
>  Platform/Hisilicon/D06/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.inf   
>   |  27 
>  Platform/Hisilicon/D06/Drivers/Net/SnpHi1620NewDxe/SnpDxe.inf
>   |  27 
>  Platform/Hisilicon/D06/Drivers/Net/SnpHi1620NewDxe/SnpPV600Dxe.efi   
>   | Bin 0 -> 74912 bytes
>  Platform/Hisilicon/D06/Drivers/PcieRasInitDxe/PcieRasInitDxe.depex   
>   | Bin 0 -> 36 bytes
>  Platform/Hisilicon/D06/Drivers/PcieRasInitDxe/PcieRasInitDxe.efi 
>   | Bin 0 -> 21184 bytes
>  Platform/Hisilicon/D06/Drivers/PcieRasInitDxe/PcieRasInitDxe.inf 
>   |  26 
>  Platform/Hisilicon/D06/Drivers/RasInitDxe/RasInitDxe.efi 
>   | Bin 0 -> 17920 bytes
>  Platform/Hisilicon/D06/Drivers/RasInitDxe/RasInitDxe.inf 
>   |  25 
>  Platform/Hisilicon/D06/Drivers/SFC/SFCDriver.depex   
>   | Bin 0 -> 36 bytes
>  Platform/Hisilicon/D06/Drivers/SFC/SFCDriver.efi 
>   | Bin 0 -> 262144 bytes
>  Platform/Hisilicon/D06/Drivers/SFC/SfcDxeDriver.inf  
>   |  27 
>  Platform/Hisilicon/D06/Drivers/Sas/SasDriverDxe.depex
>   | Bin 0 -> 216 bytes
>  Platform/Hisilicon/D06/Drivers/Sas/SasDriverDxe.efi  
>   | Bin 0 -> 221152 bytes
>  Platform/Hisilicon/D06/Drivers/Sas/SasDxeDriver.inf  
>   |  27 
>  Platform/Hisilicon/D06/Drivers/Sm750Dxe/SmiGraphicsOutput.efi
>   | Bin 0 -> 37856 bytes
>  Platform/Hisilicon/D06/Drivers/Sm750Dxe/UefiSmi.inf  
>   |  32 +++
>  Platform/Hisilicon/D06/Drivers/TransferSmbiosInfo/TransSmbiosInfo.depex  
>   |   1 +
>  Platform/Hisilicon/D06/Drivers/TransferSmbiosInfo/TransSmbiosInfo.efi
>   | Bin 0 -> 20224 bytes
>  Platform/Hisilicon/D06/Drivers/TransferSmbiosInfo/TransSmbiosInfo.inf
>   |  26 
>  Platform/Hisilicon/D06/Library/OemAddressMapD06/OemAddressMapD06.inf 
>   |  40 ++
>  

Re: [edk2] [PATCH edk2-platforms v1 38/38] Platform/Hisilicon/D0x: Update version string to 18.08

2018-08-06 Thread Leif Lindholm
On Tue, Jul 24, 2018 at 03:09:22PM +0800, Ming Huang wrote:
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Platform/Hisilicon/D03/D03.dsc | 2 +-
>  Platform/Hisilicon/D05/D05.dsc | 2 +-
>  Platform/Hisilicon/D06/D06.dsc | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/Platform/Hisilicon/D03/D03.dsc b/Platform/Hisilicon/D03/D03.dsc
> index 38548a0f23..8ed9c37a31 100644
> --- a/Platform/Hisilicon/D03/D03.dsc
> +++ b/Platform/Hisilicon/D03/D03.dsc
> @@ -174,7 +174,7 @@
>!ifdef $(FIRMWARE_VER)
>  
> gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)"
>!else
> -gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Development 
> build 18.02 for Hisilicon D03"
> +gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Development 
> build 18.08 for Hisilicon D03"
>!endif
>  
>gHisiTokenSpaceGuid.PcdBiosVersionString|L"10.01.01T18"
> diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
> index f2bbf27639..d9c0978f01 100644
> --- a/Platform/Hisilicon/D05/D05.dsc
> +++ b/Platform/Hisilicon/D05/D05.dsc
> @@ -192,7 +192,7 @@
>!ifdef $(FIRMWARE_VER)
>  
> gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)"
>!else
> -gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Development 
> build 18.02 for Hisilicon D05"
> +gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Development 
> build 18.08 for Hisilicon D05"
>!endif
>  
>gHisiTokenSpaceGuid.PcdBiosVersionString|L"10.01.01T18"
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index 9a3128048e..4388812d44 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -166,12 +166,12 @@
>!ifdef $(FIRMWARE_VER)
>  
> gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)"
>!else
> -gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Hisilicon D06 
> UEFI RC0 - B308 (V0.38)"
> +gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L""Development 
> build 18.08 for Hisilicon D06"

I pointed this out before, but just to get it with the actual patch:
there's an extra " in the line above that breaks the build when
FIRMWARE_VER is not specified.

Drop that and:
Reviewed-by: Leif Lindholm 


>!endif
>  
>gHisiTokenSpaceGuid.PcdBiosVersionString|L"10.01.01T18"
>  
> -  gHisiTokenSpaceGuid.PcdBiosVersionForBmc|L"0.38"
> +  gHisiTokenSpaceGuid.PcdBiosVersionForBmc|L"0.42"
>  
>gHisiTokenSpaceGuid.PcdSystemProductName|L"D06"
>gHisiTokenSpaceGuid.PcdSystemVersion|L"VER.A"
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v1 37/38] Hisilicon/D06: Add PciPlatformLib

2018-08-06 Thread Leif Lindholm
On Tue, Jul 24, 2018 at 03:09:21PM +0800, Ming Huang wrote:
> Add a Null PciPlatformLib for build D06.

Why? (Add some more detail to commit message, please.)

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> Signed-off-by: Heyi Guo 
> ---
>  Platform/Hisilicon/D06/D06.dsc   
>   |  1 +
>  Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.c 
>   | 69 
>  
> Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
>  | 30 +
>  3 files changed, 100 insertions(+)
> 
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index a5640771ad..9a3128048e 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -96,6 +96,7 @@
>FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
>  !endif
>PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
> +  
> PciPlatformLib|Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
>  
>  [LibraryClasses.common.SEC]
>
> ArmPlatformLib|Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibSec.inf
> diff --git 
> a/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.c
>  
> b/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.c
> new file mode 100644
> index 00..8f14117b09
> --- /dev/null
> +++ 
> b/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.c
> @@ -0,0 +1,69 @@
> +/** @file
> +*
> +*  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2018, Linaro 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 
> +
> +
> +/*++
> +
> +Routine Description:
> +
> +  Perform Platform initialization first in PciPlatform.
> +
> +Arguments:
> +
> +Returns:
> +
> + VOID.
> +
> +--*/
> +VOID
> +EFIAPI
> +PciInitPlatform (
> +  VOID
> +  )
> +{
> +

Drop blank line.

> +  return;
> +}
> +
> +/*++
> +
> +Routine Description:
> +
> +  Perform Platform initialization by the phase indicated.
> +
> +Arguments:
> +
> +  HostBridge-  The associated PCI host bridge handle.
> +  Phase -  The phase of the PCI controller enumeration.
> +  ChipsetPhase  -  Defines the execution phase of the PCI chipset driver.
> +
> +Returns:
> +
> +--*/
> +VOID
> +EFIAPI
> +PhaseNotifyPlatform (
> +  IN  EFI_HANDLE HostBridge,
> +  IN  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE  Phase,
> +  IN  EFI_PCI_CHIPSET_EXECUTION_PHASEChipsetPhase
> +  )
> +{
> +

Drop blank line.

> +  return ;

No space before ';'.

/
Leif

> +}
> +
> diff --git 
> a/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
>  
> b/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
> new file mode 100644
> index 00..7648322522
> --- /dev/null
> +++ 
> b/Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
> @@ -0,0 +1,30 @@
> +## @file
> +# PCI Segment Library for Hisilicon Hi1610/Hi1616 SoC with multiple RCs
> +#
> +# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
> +# Copyright (c) 2017 - 2018, Linaro Ltd. All rights reserved.
> +# Copyright (c) 2018, Hisilicon Ltd. All rights reserved.
> +#
> +#  This program and the accompanying materials
> +#  are licensed and made available under the terms and conditions of the BSD 
> License
> +#  which accompanies this distribution. The full text of the license may be 
> found at
> +#  http://opensource.org/licenses/bsd-license.php.
> +#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +#
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION= 0x0001001A
> +  BASE_NAME  = Hi1620PciPlatformLib
> +  FILE_GUID  = 29ba30da-68bc-46a5-888f-c65dabb67fd8
> +  MODULE_TYPE= BASE
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = PciPlatformLib
> +
> +[Sources]
> +  Hi1620PciPlatformLib.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v1 36/38] Silicon/Hisilicon/setup: Support SMMU switch

2018-08-06 Thread Leif Lindholm
On Tue, Jul 24, 2018 at 03:09:20PM +0800, Ming Huang wrote:
> Select without SMMU iort while SMMU item is disable,
> Select with SMMU iort while SMMU item is enable.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> Signed-off-by: Heyi Guo 
> ---
>  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c | 81 
> 
>  1 file changed, 81 insertions(+)
> 
> diff --git a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c 
> b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> index 32878ca4f9..4f0998dd24 100644
> --- a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> +++ b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/UpdateAcpiTable.c
> @@ -24,6 +24,83 @@
>  
>  #define CORECOUNT(X) ((X) * CORE_NUM_PER_SOCKET)
>  
> +#define FIELD_IORT_NODE_OFFSET 40
> +
> +typedef enum {
> +  NodeTypeIts = 0,
> +  NodeTypeNameComponent,
> +  NodeTypePciRC,
> +  NodeTypeSmmuV1,
> +  NodeTypeSmmuV3,
> +  NodeTypePMCG
> +} IORT_NODE_TYPE;
> +
> +#pragma pack(1)
> +typedef struct {
> +  UINT8   Type;
> +  UINT16  Length;
> +  UINT8   Revision;
> +  UINT32  Reserved;
> +  UINT32  IdMapNumber;
> +  UINT32  IdArrayOffset;
> +} IORT_NODE_HEAD;
> +#pragma pack()
> +
> +BOOLEAN
> +IsIortWithSmmu (
> +  IN EFI_ACPI_DESCRIPTION_HEADER  *TableHeader
> +  )
> +{
> +  UINT32   *NodeOffset;
> +  UINT32   NextOffset;
> +  IORT_NODE_HEAD   *Node;
> +
> +  NodeOffset = (UINT32 *)((UINT8 *)TableHeader + FIELD_IORT_NODE_OFFSET);
> +  NextOffset = *NodeOffset;
> +
> +  while (NextOffset < TableHeader->Length) {
> +Node = (IORT_NODE_HEAD *)((UINT8 *)TableHeader + NextOffset);
> +NextOffset += Node->Length;
> +
> +if ((Node->Type == NodeTypeSmmuV1) || (Node->Type == NodeTypeSmmuV3)) {
> +  return TRUE;
> +}
> +  }
> +
> +  return FALSE;
> +}
> +
> +EFI_STATUS
> +SelectIort (
> +  IN EFI_ACPI_DESCRIPTION_HEADER  *TableHeader
> +  )
> +{
> +  EFI_STATUS  Status;
> +  UINTN   Size;
> +  OEM_CONFIG_DATA Configuration;
> +
> +  Configuration.EnableSmmu = 0;
> +  Size = sizeof (OEM_CONFIG_DATA);
> +  Status = gRT->GetVariable (OEM_CONFIG_NAME, , NULL, , 
> );

Wrap long line.

> +  if (EFI_ERROR (Status)) {
> +DEBUG ((DEBUG_ERROR, "Get OemConfig variable (%r).\n", Status));
> +  }
> +
> +  Status =  EFI_SUCCESS;
> +  if (IsIortWithSmmu (TableHeader)) {
> +if (!Configuration.EnableSmmu) {
> +  Status = EFI_ABORTED;
> +}
> +  } else {
> +if (Configuration.EnableSmmu) {
> +  Status = EFI_ABORTED;
> +}
> +  }
> +  DEBUG ((DEBUG_INFO, "SmmuEnable=%x, return %r for Iort table.\n", 
> Configuration.EnableSmmu, Status));

Wrap long line.

/
Leif

> +
> +  return Status;
> +}
> +
>  STATIC
>  VOID
>  RemoveUnusedMemoryNode (
> @@ -151,6 +228,10 @@ UpdateAcpiTable (
>case EFI_ACPI_6_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE:
>  Status = UpdateSlit (TableHeader);
>  break;
> +
> +  case EFI_ACPI_6_2_IO_REMAPPING_TABLE_SIGNATURE:
> +Status = SelectIort (TableHeader);
> +break;
>case EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE:
>  Status = IsNeedSpcr (TableHeader);
>  break;
> -- 
> 2.17.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v1 03/38] Hisilicon/D06: Add several basal file for D06

2018-08-06 Thread Leif Lindholm
On Mon, Aug 06, 2018 at 11:01:04AM +0800, Ming wrote:
> >>> +  OUTPUT_DIRECTORY   = Build/$(PLATFORM_NAME)
> >>> +  SUPPORTED_ARCHITECTURES= AARCH64
> >>> +  BUILD_TARGETS  = DEBUG|RELEASE
> >>
> >> Can you also add NOOPT please?
> >> Between DEBUG and RELEASE.
> >>
> > 
> > Yes, I will add spaces between DEBUG and RELEASE.
> > 
> 
> I think that I made a mistake in last email. Do you mean add NOOPT
> targets?

Yes.

> DEBUG|NOOPT|RELEASE ?

Exactly.

> What is the NOOPT?

Built with -O0.
DEBUG is no longer built with -O0.

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


[edk2] [PATCH] IntelFrameworkModulePkg/Csm: Set CSM memory executable

2018-08-06 Thread Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Star Zeng 
---
 .../Csm/LegacyBiosDxe/LegacyBios.c | 22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c 
b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
index 8f14687b28..f86d00b53f 100644
--- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
+++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
@@ -64,8 +64,9 @@ AllocateLegacyMemory (
   OUT EFI_PHYSICAL_ADDRESS  *Result
   )
 {
-  EFI_STATUSStatus;
-  EFI_PHYSICAL_ADDRESS  MemPage;
+  EFI_STATUS  Status;
+  EFI_PHYSICAL_ADDRESSMemPage;
+  EFI_GCD_MEMORY_SPACE_DESCRIPTOR MemDesc;
 
   //
   // Allocate Pages of memory less <= StartPageAddress
@@ -83,10 +84,21 @@ AllocateLegacyMemory (
   //
   if (!EFI_ERROR (Status)) {
 *Result = (EFI_PHYSICAL_ADDRESS) (UINTN) MemPage;
+if (MemoryType != EfiBootServicesCode) {
+  //
+  // Make sure that the buffer can be used to store code.
+  //
+  Status = gDS->GetMemorySpaceDescriptor (MemPage, );
+  if (!EFI_ERROR (Status) && (MemDesc.Attributes & EFI_MEMORY_XP) != 0) {
+Status = gDS->SetMemorySpaceAttributes (
+MemPage,
+EFI_PAGES_TO_SIZE (Pages),
+MemDesc.Attributes & (~EFI_MEMORY_XP)
+);
+  }
+}
   }
-  //
-  // If reach here the status = EFI_SUCCESS
-  //
+
   return Status;
 }
 
-- 
2.16.1.windows.1

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


[edk2] [PATCH v2] IntelFrameworkModulePkg:Remove redundant definitions and comments

2018-08-06 Thread shenglei
Some redundant definitions adn comments
have been removed in .c and .h files.

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

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 .../Bus/Isa/IsaIoDxe/IsaDriver.h  |   1 -
 .../Bus/Isa/IsaIoDxe/IsaIoDxe.inf |   1 -
 .../Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c|  25 ---
 .../Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h  |  13 --
 .../Bus/Pci/IdeBusDxe/Ata.c   | 119 
 .../Bus/Pci/IdeBusDxe/DriverConfiguration.c   | 163 
 .../Bus/Pci/IdeBusDxe/Ide.h   |  24 ---
 .../Csm/BiosThunk/Snp16Dxe/BiosSnp16.h| 180 --
 .../Csm/BiosThunk/Snp16Dxe/PxeUndi.c  |  92 +
 .../Csm/LegacyBiosDxe/LegacyBiosDxe.inf   |   2 -
 .../Csm/LegacyBiosDxe/LegacyBiosInterface.h   |   2 -
 .../Universal/BdsDxe/BootMaint/BmLib.c|  36 
 .../Universal/BdsDxe/BootMaint/BootMaint.h|  53 --
 .../Universal/BdsDxe/BootMaint/BootOption.c   |  62 --
 .../BdsDxe/BootMaint/ConsoleOption.c  |  64 ---
 .../Universal/BdsDxe/BootMaint/Variable.c |  63 --
 .../Universal/BdsDxe/FrontPage.c  |  29 ---
 .../Universal/BdsDxe/FrontPage.h  |  17 --
 18 files changed, 1 insertion(+), 945 deletions(-)

diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h 
b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h
index 9639d18318..6b1aaeda0e 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h
+++ b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h
@@ -24,7 +24,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf 
b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf
index 6f02aea7af..247c66151b 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf
+++ b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf
@@ -62,7 +62,6 @@
   gEfiSioProtocolGuid   ## TO_START
   gEfiPciIoProtocolGuid ## TO_START
   gEfiDevicePathProtocolGuid## TO_START
-  gEfiGenericMemTestProtocolGuid## TO_START
 
 [Pcd]
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSupportedFeatures  ## 
CONSUMES
diff --git a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c 
b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
index 78c4e3b391..202588191e 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
+++ b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
@@ -1848,32 +1848,7 @@ Done:
 
 }
 
-/**
-  Disable the keyboard interface of the 8042 controller.
-
-  @param ConsoleIn   The device instance
-
-  @return status of issuing disable command
-
-**/
-EFI_STATUS
-DisableKeyboard (
-  IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
-  )
-{
-  EFI_STATUS  Status;
 
-  //
-  // Disable keyboard interface
-  //
-  Status = KeyboardCommand (ConsoleIn, 
KEYBOARD_8042_COMMAND_DISABLE_KEYBOARD_INTERFACE);
-  if (EFI_ERROR (Status)) {
-KeyboardError (ConsoleIn, L"\n\r");
-return EFI_DEVICE_ERROR;
-  }
-
-  return Status;
-}
 
 /**
   Check whether there is Ps/2 Keyboard device in system by 0xF4 Keyboard 
Command
diff --git a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h 
b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
index 613f176401..61c7252bc5 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
+++ b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
@@ -299,19 +299,6 @@ InitKeyboard (
   IN BOOLEAN ExtendedVerification
   );
 
-/**
-  Disable the keyboard interface of the 8042 controller.
-
-  @param ConsoleIn   - the device instance
-
-  @return status of issuing disable command
-
-**/
-EFI_STATUS
-DisableKeyboard (
-  IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
-  );
-
 /**
   Timer event handler: read a series of scancodes from 8042
   and put them into memory scancode buffer.
diff --git a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c 
b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
index 7819773f38..2ca06806d5 100644
--- a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
+++ b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
@@ -2676,124 +2676,5 @@ AtaNonDataCommandIn (
   return EFI_SUCCESS;
 }
 
-/**
-  Send ATA Ext command into device with NON_DATA protocol
-
-  @param  IdeDev Standard IDE device private data structure
-  @param  AtaCommand The ATA command to be sent
-  @param  Device The value in Device register
-  @param  Feature The value in Feature register
-  @param  SectorCount The value in SectorCount register
-  @param  LbaAddress The LBA address in 48-bit mode
-
-  @retval  EFI_SUCCESS Reading succeed
-  @retval  EFI_ABORTED Command failed
-  @retval  EFI_DEVICE_ERROR 

Re: [edk2] reg: HTTP Request Failure over Internet

2018-08-06 Thread Wu, Jiaxin
Is there any proxy or firewall block the connection? Once you set the static 
Ip4Gateway via ifconfig shell command, please try to ping the gateway/remote 
address to check the connection.

Thanks,
Jiaxin


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Sivaraman Nainar
> Sent: Saturday, August 4, 2018 5:46 PM
> To: Wu, Jiaxin ; Ye, Ting ; Laszlo
> Ersek ; edk2-devel@lists.01.org
> Subject: Re: [edk2] reg: HTTP Request Failure over Internet
> 
> Hello Jiaxin,
> 
> We have tried both the methods and both failed. Do you have any other
> recommendation?
> 
> -Siva
> -Original Message-
> From: Wu, Jiaxin [mailto:jiaxin...@intel.com]
> Sent: Tuesday, July 31, 2018 7:14 AM
> To: Sivaraman Nainar; Ye, Ting; Laszlo Ersek; edk2-devel@lists.01.org
> Subject: RE: [edk2] reg: HTTP Request Failure over Internet
> 
> Hi Siva,
> 
> Thanks the report.
> 
> From the code review, it does the problem for HTTP protocol to route the
> package over Internet.
> 
> But I'm confused with your patch that how can you get the RouterAddr since
> there is no interface for HTTP protocol to get the RouterAddr?
> 
> > +  HttpInstance->Tcp4->Routes (
> > +HttpInstance->Tcp4,
> > +FALSE,
> > +>RemoteAddr,
> > +>SubnetMask,
> > +>RouterAddr
> > +);
> > +
> 
> So, I prefer it's the UEFI Spec limitation that HTTP protocol doesn't provide 
> us
> the interface to set the router info instead of setting it during HTTP
> configuration. To mitigate the issue,  below two solution/workaround can be
> tried:
> 1) Ip4Config2 protocol can be leveraged by your HTTP application to register
> one valid Ip4Gateway into the default route table (just like HttpBootDxe --
> HttpBootRegisterIp4Gateway()). The IP policy will route the packet by using
> the instance's route table first, if not found, the default route table will 
> be
> tried.
> 2) Set the static Ip4Gateway via ifconfig shell command. The Ip4Gateway
> address also will be set to default route table.
> 
> Thanks,
> Jiaxin
> 
> 
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > Sivaraman Nainar
> > Sent: Wednesday, July 25, 2018 5:29 PM
> > To: Ye, Ting ; Laszlo Ersek ;
> > edk2- de...@lists.01.org
> > Subject: Re: [edk2] reg: HTTP Request Failure over Internet
> >
> > Ting:
> >
> > Please find the patch  for reference.
> >
> > Index: HttpProto.c
> >
> ==
> > =
> > --- HttpProto.c
> > +++ HttpProto.c
> > @@ -622,12 +622,20 @@
> >Status = HttpInstance->Tcp4->Configure (HttpInstance->Tcp4,
> Tcp4CfgData);
> >if (EFI_ERROR (Status)) {
> >  DEBUG ((EFI_D_ERROR, "HttpConfigureTcp4 - %r\n", Status));
> >  return Status;
> >}
> >
> > +  HttpInstance->Tcp4->Routes (
> > +HttpInstance->Tcp4,
> > +FALSE,
> > +>RemoteAddr,
> > +>SubnetMask,
> > +>RouterAddr
> > +);
> > +
> >Status = HttpCreateTcp4ConnCloseEvent (HttpInstance);
> >if (EFI_ERROR (Status)) {
> >  return Status;
> >}
> >
> >Status = HttpCreateTcp4TxEvent (Wrap);
> >
> > -Siva
> > -Original Message-
> > From: Ye, Ting [mailto:ting...@intel.com]
> > Sent: Wednesday, July 25, 2018 1:36 PM
> > To: Laszlo Ersek; Sivaraman Nainar; edk2-devel@lists.01.org
> > Subject: RE: [edk2] reg: HTTP Request Failure over Internet
> >
> > Hi Siva,
> >
> > I didn't receive your patch either. Thanks for reporting the issue, we
> > will try to reproduce it firstly.
> >
> > Thanks,
> > Ting
> >
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > Laszlo Ersek
> > Sent: Tuesday, July 24, 2018 8:43 PM
> > To: Sivaraman Nainar ;
> > edk2-devel@lists.01.org
> > Subject: Re: [edk2] reg: HTTP Request Failure over Internet
> >
> > On 07/24/18 14:05, Sivaraman Nainar wrote:
> > > Hello all,
> > >
> > > When an application tried to download the remote file over internet
> > > with
> > the HTTP Get Request it getting failed. If we try via the Intranet
> > then application downloads the target file.
> > >
> > > The remote file is available in the Apache server. With the attached
> > > patch
> > the download works fine in Internet and Intranet.
> > >
> > > Could you review the solution and feedback?
> >
> > The edk2-devel list software does not reflect attachments to subscribers.
> >
> > While I disagree with that practice in general -- it breaks
> > conversations where people justifiedly post small attachments, such as
> > PNG screenshots, compressed log files and such --, for posting patches
> > specifically, please use git-format-patch and git-send-email. The
> > patch should be in the body of the email (please do not copy the
> > patch though; that is guaranteed not to work -- please use the git tools).
> >
> > Official guidelines:
> >
> > 

[edk2] [PATCH] MdeModulePkg: Remove dead code in .c and .h files

2018-08-06 Thread shenglei
Some dead code has been removed in .c and .h files.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng 
Cc: Eric Dong 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 .../Application/CapsuleApp/CapsuleDump.c  |  31 ---
 MdeModulePkg/Application/UiApp/FrontPage.c|  40 ---
 MdeModulePkg/Application/UiApp/Ui.h   |  30 --
 .../Bus/Ata/AtaAtapiPassThru/AhciMode.c   | 104 ---
 .../Bus/Ata/AtaAtapiPassThru/IdeMode.c| 257 --
 .../Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c|  26 --
 .../Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h  |  12 -
 MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c  |  27 --
 MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.h  |  11 -
 MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.c|  44 ---
 .../Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 110 
 .../Bus/Pci/PciBusDxe/PciDeviceSupport.c  |  80 --
 .../Bus/Pci/PciBusDxe/PciDeviceSupport.h  |  17 --
 MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c|  41 ---
 MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.h|  21 --
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c |  94 ---
 MdeModulePkg/Bus/Pci/UhciPei/DmaMem.c |  22 --
 MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c| 125 -
 MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.h|  78 --
 MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c|  66 -
 MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h|  28 --
 MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c   |  24 --
 MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c|  22 --
 MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h|  14 -
 .../Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c |  24 --
 MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.c|  24 --
 .../Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c | 101 ---
 MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c |  24 --
 MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c   | 180 
 .../Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c   |  49 
 MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c| 190 -
 MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.h|  98 ---
 MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c   |  68 -
 MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c   | 146 --
 MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.h   | 114 
 MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.c  |  39 ---
 MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.h  |  18 --
 MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c|  77 --
 MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.h|  35 ---
 MdeModulePkg/Core/Dxe/DxeMain.h   |  13 -
 MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c   |  23 --
 MdeModulePkg/Core/Dxe/Mem/HeapGuard.c |  78 --
 MdeModulePkg/Core/PiSmmCore/HeapGuard.c   | 166 ---
 .../Core/PiSmmCore/MemoryAttributesTable.c| 131 -
 MdeModulePkg/Core/PiSmmCore/Page.c| 121 -
 .../Universal/Console/TerminalDxe/Terminal.h  |  12 -
 .../Console/TerminalDxe/TerminalConIn.c   |  25 --
 .../Universal/HiiDatabaseDxe/ConfigRouting.c  |  47 
 .../Universal/Network/IScsiDxe/IScsiProto.c   |  31 ---
 .../Universal/Network/Ip4Dxe/Ip4Config2Impl.c |  16 --
 .../Universal/Network/Tcp4Dxe/SockImpl.c  |  35 ---
 .../Universal/Network/Tcp4Dxe/SockInterface.c |  41 ---
 .../Universal/Network/Tcp4Dxe/Socket.h|  32 ---
 .../Universal/Network/Tcp4Dxe/Tcp4Option.c|  28 --
 .../Universal/Network/Tcp4Dxe/Tcp4Option.h|  15 -
 .../Universal/SetupBrowserDxe/IfrParse.c  |  33 ---
 56 files changed, 3358 deletions(-)

diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c 
b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
index 45c3ecd050..7a3eb94362 100644
--- a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
+++ b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
@@ -106,37 +106,6 @@ DumpUxCapsule (
   Print(L"  OffsetY  - 0x%x\n", DisplayCapsule->ImagePayload.OffsetY);
 }
 
-/**
-  Dump FMP image authentication information.
-
-  @param[in] Image  The FMP capsule image
-  @param[in] ImageSize  The size of the FMP capsule image in bytes.
-
-  @return the size of FMP authentication.
-**/
-UINTN
-DumpImageAuthentication (
-  IN VOID   *Image,
-  IN UINTN  ImageSize
-  )
-{
-  EFI_FIRMWARE_IMAGE_AUTHENTICATION *ImageAuthentication;
-
-  ImageAuthentication = Image;
-  if (CompareGuid(>AuthInfo.CertType, ) 
||
-  CompareGuid(>AuthInfo.CertType, 
)) {
-Print(L"[ImageAuthentication]\n");
-Print(L"  MonotonicCount   - 0x%lx\n", 
ImageAuthentication->MonotonicCount);
-Print(L"WIN_CERTIFICATE:\n");
-Print(L"  dwLength - 0x%x\n", 
ImageAuthentication->AuthInfo.Hdr.dwLength);
-Print(L"  wRevision- 0x%x\n", 
ImageAuthentication->AuthInfo.Hdr.wRevision);
-Print(L"  wCertificateType - 0x%x\n", 
ImageAuthentication->AuthInfo.Hdr.wCertificateType);
-Print(L"  CertType - %g\n", 
>AuthInfo.CertType);
-return sizeof(ImageAuthentication->MonotonicCount) + 

[edk2] [PATCH] ShellPkg/acpi: Fix XCODE5 X64 build failure

2018-08-06 Thread Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Dandan Bi 
---
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c | 2 +-
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c
index cca25fcce9..5b25c66f40 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c
@@ -33,7 +33,7 @@ STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
 /**
   Get the ACPI XSDT header info.
 **/
-CONST ACPI_DESCRIPTION_HEADER_INFO* CONST
+CONST ACPI_DESCRIPTION_HEADER_INFO *
 EFIAPI
 GetAcpiXsdtHeaderInfo (
   VOID
diff --git 
a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c
index a5e1412484..5fa28338ef 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c
@@ -32,7 +32,7 @@ STATIC CONST ACPI_PARSER XsdtParser[] = {
 /**
   Get the ACPI XSDT header info.
 **/
-CONST ACPI_DESCRIPTION_HEADER_INFO* CONST
+CONST ACPI_DESCRIPTION_HEADER_INFO *
 EFIAPI
 GetAcpiXsdtHeaderInfo (
   VOID
-- 
2.16.1.windows.1

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