Re: [edk2-devel] [PATCH v1 1/4] ShellPkg: acpiview: Improve PPTT table field validation

2019-07-01 Thread Gao, Zhichao
OK. Got it.
Series: Reviewed-by: Zhichao Gao 

Thanks,
Zhichao

> -Original Message-
> From: Krzysztof Koch [mailto:krzysztof.k...@arm.com]
> Sent: Monday, July 1, 2019 3:29 PM
> To: devel@edk2.groups.io; Gao, Zhichao 
> Cc: nd 
> Subject: RE: [edk2-devel] [PATCH v1 1/4] ShellPkg: acpiview: Improve PPTT
> table field validation
> 
> Hi Zhichao,
> 
> Thank you for the review. You can see my responses in line with your
> comments marked with [Krzysztof]
> 
> Kind regards,
> 
> Krzysztof
> 
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Gao,
> Zhichao via Groups.Io
> Sent: Monday, July 1, 2019 4:49
> To: Krzysztof Koch ; devel@edk2.groups.io
> Cc: Carsey, Jaben ; Ni, Ray ;
> Sami Mujawar ; Matteo Carlini
> ; nd 
> Subject: Re: [edk2-devel] [PATCH v1 1/4] ShellPkg: acpiview: Improve PPTT
> table field validation
> 
> Minor comment on ValidateCacheAssociativity:
> 
> > -Original Message-
> > From: Krzysztof Koch [mailto:krzysztof.k...@arm.com]
> > Sent: Friday, June 28, 2019 6:25 PM
> > To: devel@edk2.groups.io
> > Cc: Carsey, Jaben ; Ni, Ray
> > ; Gao, Zhichao ;
> > sami.muja...@arm.com; matteo.carl...@arm.com; n...@arm.com
> > Subject: [PATCH v1 1/4] ShellPkg: acpiview: Improve PPTT table field
> > validation
> >
> > Add Cache Structure (Type 1) 'Number of sets' and 'Associativity'
> > field validation in the acpiview Processor Properties Topology Table
> > (PPTT) parser.
> >
> > Replace literal values with precompiler macros for existing Cache
> > Structure validation functions.
> >
> > Signed-off-by: Krzysztof Koch 
> > ---
> >
> > Changes can be seen at:
> >
> https://github.com/KrzysztofKoch1/edk2/commit/014f98b8f1ba29607d8d46
> > 5cac779badc3c79982
> >
> > Notes:
> > v1:
> > - Use macros to define constant values used for validation [Krzysztof]
> > - Add two new PPTT Type 1 structure validation functions
> > [Krzysztof]
> >
> >
> >
> ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c
> > | 102 ++--
> >
> ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.h
> > |  38 
> >  2 files changed, 130 insertions(+), 10 deletions(-)
> >
> > diff --git
> >
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> > c
> >
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> > c
> > index
> >
> 71b6e7ae7c727ee0ea12f74e60c27c4c46e05872..cec57be55e77096f9448f637e
> > a129af2b42111ad 100644
> > ---
> >
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> > c
> > +++
> > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttPars
> > +++ er.c
> > @@ -5,12 +5,15 @@
> >SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >@par Reference(s):
> > -- ACPI 6.2 Specification - Errata A, September 2017
> > +- ACPI 6.3 Specification - January 2019
> > +- ARM Architecture Reference Manual ARMv8 (D.a)
> >  **/
> >
> >  #include 
> >  #include 
> >  #include "AcpiParser.h"
> > +#include "AcpiView.h"
> > +#include "PpttParser.h"
> >
> >  // Local variables
> >  STATIC CONST UINT8*  ProcessorTopologyStructureType; @@ -19,11
> +22,80
> > @@ STATIC CONST UINT32* NumberOfPrivateResources;  STATIC
> > ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
> >
> >  /**
> > -  An ACPI_PARSER array describing the ACPI PPTT Table.
> > +  This function validates the Cache Type Structure (Type 1) 'Number of
> sets'
> > +  field.
> > +
> > +  @param [in] Ptr   Pointer to the start of the field data.
> > +  @param [in] Context   Pointer to context specific information e.g. this
> > +could be a pointer to the ACPI table header.
> >  **/
> > -STATIC CONST ACPI_PARSER PpttParser[] = {
> > -  PARSE_ACPI_HEADER ()
> > -};
> > +STATIC
> > +VOID
> > +EFIAPI
> > +ValidateCacheNumberOfSets (
> > +  IN UINT8* Ptr,
> > +  IN VOID*  Context
> > +  )
> > +{
> > +  UINT32 NumberOfSets;
> > +  NumberOfSets = *(UINT32*)Ptr;
> > +
> > +  if (NumberOfSets == 0) {
> > +IncrementErrorCount ();
> > +Print (L"\nERROR: Cache number of sets must be greater than 0");
> > +return;
> > +  }
> > +
> > +#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
> > +  if (NumberOfSets >
> PPTT_ARM_CCIDX_CACHE_NUMBER_OF_SETS_MAX)
> > {
> > +IncrementErrorCount ();
> > +Print (
> > +  L"\nERROR: When ARMv8.3-CCIDX is implemented the maximum
> cache
> > number of "
> > +L"sets must be less than or equal to %d",
> > +  PPTT_ARM_CCIDX_CACHE_NUMBER_OF_SETS_MAX
> > +  );
> > +return;
> > +  }
> > +
> > +  if (NumberOfSets > PPTT_ARM_CACHE_NUMBER_OF_SETS_MAX) {
> > +IncrementWarningCount ();
> > +Print (
> > +  L"\nWARNING: Without ARMv8.3-CCIDX, the maximum cache number
> > of sets "
> > +L"must be less than or equal to %d. Ignore this message if "
> > +L"ARMv8.3-CCIDX is implemented",
> > +  PPTT_ARM_CACHE_NUMBER_OF_SETS_MAX
> > +  );
> > +return;
> > +  }
> > +#endif
> > +
> > +}
> > 

[edk2-devel] [PATCH] SecurityPkg: Don't Verify the enrolled PK in setup mode

2019-07-01 Thread derek . lin2
Patch is attached from group.io.
Since ECR785, which is added UEFI 2.3.1 errata A, enrolling a PK in setup mode 
doesn't need to verify the PK.
Below is the sentence about it in UEFI spec
```
3. If the firmware is in setup mode and the variable is one of:
- The global PK variable;
- The global KEK variable;
- The "db" variable with GUID EFI_IMAGE_SECURITY_DATABASE_GUID; or
- The "dbx" variable with GUID EFI_IMAGE_SECURITY_DATABASE_GUID,
then the firmware implementation shall consider the checks in the following 
steps 4 and 5 to
have passed, and proceed with updating the variable value as outlined below.
```
The step 4 is to verify the signature and the step 5 is to verify the cert.

After this change, when system is in Setup mode, setting a PK does not require 
authenticated variable descriptor.

Signed-off-by: Derek Lin 
Signed-off-by: cinnamon shia 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43150): https://edk2.groups.io/g/devel/message/43150
Mute This Topic: https://groups.io/mt/32283314/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



0001-SecurityPkg-Don-t-Verify-the-enrolled-PK-in-setup-mo.patch
Description: Binary data


Re: [edk2-devel] [PATCH v1] EmulatorPkg/MiscSubClassPlatformDxe: Remove this unused module

2019-07-01 Thread Ni, Ray
Reviewed-by: Ray Ni 

Because this patch doesn't cause any functionality issue (removing an unused 
module),
I pushed the patch directly.

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Wu, Hao
> A
> Sent: Tuesday, July 2, 2019 10:31 AM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A ; Justen, Jordan L
> ; Andrew Fish ; Ni, Ray
> 
> Subject: [edk2-devel] [PATCH v1] EmulatorPkg/MiscSubClassPlatformDxe:
> Remove this unused module
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1953
> 
> For commit 63f9b9b9312f3e08c92a2ea3cdbe01e723ef653b, the use of
> module
> EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf
> 
> was replaced by:
> EmulatorPkg/PlatformSmbiosDxe/PlatformSmbiosDxe.inf
> 
> in platform DSC/FDF files.
> 
> This commit will remove this unused module from EmulatorPkg.
> 
> Cc: Jordan Justen 
> Cc: Andrew Fish 
> Cc: Ray Ni 
> Signed-off-by: Hao A Wu 
> ---
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf   
>  |
> 98 -
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscDevicePath.h 
>  |
> 169 ---
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.h 
>  |
> 126 ---
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerData.c
> |  51 -
> 
> EmulatorPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerFunctio
> n.c   | 155 -
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscBiosVendorData.c
> |  82 ---
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscBiosVendorFunction.c
> | 190 
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscBootInformationData.c
> |  27 ---
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscBootInformationFunction.c
> |  62 --
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscChassisManufacturerData.c
> |  39 
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscChassisManufacturerFunction.c
> | 125 ---
> 
> EmulatorPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguages
> Data.c|  32 ---
> 
> EmulatorPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguages
> Function.c| 227 
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscOemStringData.c  
>  |
> 26 ---
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscOemStringFunction.c
> |  69 --
> 
> EmulatorPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignat
> orData.c |  93 
> 
> EmulatorPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignat
> orFunction.c | 166 --
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesData.c
> |  36 
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesFunction.c
> |  65 --
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscSubclassDriverDataTable.c
> |  72 ---
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c
> | 194 -
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringData.c
> |  27 ---
> 
> EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringFunction.
> c|  74 ---
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerData.c
> |  51 -
> 
> EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c
> | 129 ---
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemOptionStringData.c
> |  26 ---
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemOptionStringFunction.c
> |  71 --
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationData.c
> |  46 
> 
> EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationFunction
> .c   |  86 
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturer.uni
> |  19 --
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscBiosVendor.uni   
>  |
> 15 --
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscChassisManufacturer.uni
> |  16 --
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscOemString.uni
>  |
> 13 --
> 
> EmulatorPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignat
> or.uni   |  68 --
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.uni   
>  |
> 24 ---
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemLanguageString.uni
> |  13 --
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemManufacturer.uni
> |  16 --
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemOptionString.uni
> |  13 --
>  EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignation.uni
> |  14 --
>  39 files changed, 2825 deletions(-)
> 
> diff --git a/EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf
> b/EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf
> deleted file mode 100644
> index 79b8c20221..00
> --- a/EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf
> +++ /dev/null
> @@ -1,98 +0,0 @@
> -## @file
> -# Misc Sub class driver
> -#
> -# Parses the MiscSubclassDataTable and reports any generated data to the
> DataHub.
> -#  All .uni file who tagged with 

Re: [edk2-devel] [RFC][PATCH v1 0/3] Remove IntelFramework[Module]Pkg

2019-07-01 Thread Wu, Hao A
Hello all,

So far, this RFC series has received the below feedbacks:

* Ack tag from Laszlo Ersek:
https://edk2.groups.io/g/devel/message/42382

* Reviewed-by tag from Liming Gao:
https://edk2.groups.io/g/devel/message/43144


Also, the latest status is that all the known platforms/packages
dependencies on IntelFrameworkModulePkg & IntelFrameworkPkg have been
dropped.

If there is no other comments, I plan to push this series after 24 hours.

Best Regards,
Hao Wu


> -Original Message-
> From: Wu, Hao A
> Sent: Monday, May 27, 2019 2:48 PM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A; Gao, Liming; Ni, Ray; Andrew Fish; Laszlo Ersek; Leif Lindholm;
> Kinney, Michael D
> Subject: [RFC][PATCH v1 0/3] Remove IntelFramework[Module]Pkg
> 
> 
> '''
> Please note that this series will be hold until all the below requirements
> are met:
> 
> A. edk2-stable201905 is created;
> B. OvmfPkg has been updated to drop its dependency on
>IntelFramework[Module]Pkg; (Patches already been sent)
> C. Platforms in the edk2-platforms have been updated to drop their
>dependencies on IntelFramework[Module]Pkg. (Patches already been sent
>for all platforms except Intel Quark and Minnowboard)
> '''
> 
> The patches themselves will not be sent to the mailing list and are only
> available at:
> https://github.com/hwu25/edk2/commits/delete_framework
> 
> Cc: Liming Gao 
> Cc: Ray Ni 
> Cc: Andrew Fish 
> Cc: Laszlo Ersek 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> 
> 
> Hao A Wu (3):
>   Remove IntelFrameworkModulePkg
>   Remove IntelFrameworkPkg
>   Maintainers.txt: Remove information for IntelFramework[Module]Pkg
> 
>  IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
> |  241 --
>  IntelFrameworkPkg/IntelFrameworkPkg.dec
> |  182 -
>  IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
> |  178 -
>  IntelFrameworkPkg/IntelFrameworkPkg.dsc
> |   69 -
>  IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.inf
> |   67 -
>  IntelFrameworkModulePkg/Bus/Isa/IsaFloppyDxe/IsaFloppyDxe.inf
> |   72 -
>  IntelFrameworkModulePkg/Bus/Isa/IsaFloppyPei/IsaFloppyPei.inf
> |   66 -
>  IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf
> |   64 -
>  IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf
> |   74 -
>  IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf
> |   79 -
> 
> IntelFrameworkModulePkg/Bus/Isa/Ps2MouseAbsolutePointerDxe/Ps2Mou
> seAbsolutePointerDxe.inf   |   70 -
>  IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf
> |   69 -
>  IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf
> |   83 -
>  IntelFrameworkModulePkg/Bus/Pci/VgaMiniPortDxe/VgaMiniPortDxe.inf
> |   51 -
>  IntelFrameworkModulePkg/Csm/BiosThunk/BlockIoDxe/BlockIoDxe.inf
> |   58 -
>  IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/KeyboardDxe.inf
> |   72 -
>  IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/Snp16Dxe.inf
> |   66 -
>  IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf
> |   80 -
>  IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
> |  131 -
>  IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.inf
> |   49 -
> 
> IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/Dx
> eReportStatusCodeLib.inf  |   53 -
>  IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
> |  138 -
> 
> IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaint
> UiLib.inf   |   63 -
> 
> IntelFrameworkModulePkg/Library/LegacyBootManagerLib/LegacyBootMan
> agerLib.inf   |   58 -
> 
> IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaArchC
> ustomDecompressLib.inf |   63 -
> 
> IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCusto
> mDecompressLib.inf |   59 -
> 
> IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiD
> xeDebugLibReportStatusCode.inf   |   49 -
>  IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.inf
> |   45 -
>  IntelFrameworkModulePkg/Library/PeiS3Lib/PeiS3Lib.inf
> |   44 -
> 
> IntelFrameworkModulePkg/Library/PlatformBdsLibNull/PlatformBdsLibNull.i
> nf   |   41 -
> 
> IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFr
> amework/SmmRuntimeDxeReportStatusCodeLibFramework.inf |   68 -
> 
> IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3SaveDxe.i
> nf  |   74 -
> 
> IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportDx
> e.inf|   74 -
>  IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
> |  222 -
> 
> IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClassDxe.in
> f   |   58 -
>  

[edk2-devel] [PATCH v1] EmulatorPkg/MiscSubClassPlatformDxe: Remove this unused module

2019-07-01 Thread Wu, Hao A
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1953

For commit 63f9b9b9312f3e08c92a2ea3cdbe01e723ef653b, the use of module
EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf

was replaced by:
EmulatorPkg/PlatformSmbiosDxe/PlatformSmbiosDxe.inf

in platform DSC/FDF files.

This commit will remove this unused module from EmulatorPkg.

Cc: Jordan Justen 
Cc: Andrew Fish 
Cc: Ray Ni 
Signed-off-by: Hao A Wu 
---
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf 
   |  98 -
 EmulatorPkg/MiscSubClassPlatformDxe/MiscDevicePath.h   
   | 169 ---
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.h   
   | 126 ---
 EmulatorPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerData.c
   |  51 -
 EmulatorPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerFunction.c
   | 155 -
 EmulatorPkg/MiscSubClassPlatformDxe/MiscBiosVendorData.c   
   |  82 ---
 EmulatorPkg/MiscSubClassPlatformDxe/MiscBiosVendorFunction.c   
   | 190 
 EmulatorPkg/MiscSubClassPlatformDxe/MiscBootInformationData.c  
   |  27 ---
 EmulatorPkg/MiscSubClassPlatformDxe/MiscBootInformationFunction.c  
   |  62 --
 EmulatorPkg/MiscSubClassPlatformDxe/MiscChassisManufacturerData.c  
   |  39 
 EmulatorPkg/MiscSubClassPlatformDxe/MiscChassisManufacturerFunction.c  
   | 125 ---
 EmulatorPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesData.c 
   |  32 ---
 EmulatorPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesFunction.c 
   | 227 
 EmulatorPkg/MiscSubClassPlatformDxe/MiscOemStringData.c
   |  26 ---
 EmulatorPkg/MiscSubClassPlatformDxe/MiscOemStringFunction.c
   |  69 --
 EmulatorPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorData.c  
   |  93 
 
EmulatorPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorFunction.c
 | 166 --
 EmulatorPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesData.c
   |  36 
 EmulatorPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesFunction.c
   |  65 --
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSubclassDriverDataTable.c  
   |  72 ---
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c 
   | 194 -
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringData.c 
   |  27 ---
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringFunction.c 
   |  74 ---
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerData.c   
   |  51 -
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c   
   | 129 ---
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemOptionStringData.c   
   |  26 ---
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemOptionStringFunction.c   
   |  71 --
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationData.c
   |  46 
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationFunction.c
   |  86 
 EmulatorPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturer.uni  
   |  19 --
 EmulatorPkg/MiscSubClassPlatformDxe/MiscBiosVendor.uni 
   |  15 --
 EmulatorPkg/MiscSubClassPlatformDxe/MiscChassisManufacturer.uni
   |  16 --
 EmulatorPkg/MiscSubClassPlatformDxe/MiscOemString.uni  
   |  13 --
 EmulatorPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignator.uni
   |  68 --
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.uni 
   |  24 ---
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemLanguageString.uni   
   |  13 --
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemManufacturer.uni 
   |  16 --
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemOptionString.uni 
   |  13 --
 EmulatorPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignation.uni  
   |  14 --
 39 files changed, 2825 deletions(-)

diff --git a/EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf 
b/EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf
deleted file mode 100644
index 79b8c20221..00
--- a/EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf
+++ /dev/null
@@ -1,98 +0,0 @@
-## @file
-# Misc Sub class driver
-#
-# Parses the MiscSubclassDataTable and reports any generated data to the 
DataHub.
-#  All .uni file who tagged with "ToolCode="DUMMY"" in following file list is 
included by
-#  MiscSubclassDriver.uni file, the StrGather tool will expand 
MiscSubclassDriver.uni file
-#  and parse all .uni file.
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-#
-#  SPDX-License-Identifier: 

Re: [edk2-devel] [edk2-platforms Patch 4/4] QuarkPkatformPkg: Update MemoryTypeInformation to reduce reboots

2019-07-01 Thread Sun, Zailiang
Reviewed-By: Zailiang Sun 

> -Original Message-
> From: Kinney, Michael D
> Sent: Tuesday, July 2, 2019 7:01 AM
> To: devel@edk2.groups.io
> Cc: Sun, Zailiang ; Qian, Yi ; Ni,
> Ray ; Steele, Kelly 
> Subject: [edk2-platforms Patch 4/4] QuarkPkatformPkg: Update
> MemoryTypeInformation to reduce reboots
> 
> Adjust size of bins in Memory Type Information HOB to eliminate extra
> reboot after first boot.
> 
> Cc: Zailiang Sun 
> Cc: Yi Qian 
> Cc: Ray Ni 
> Cc: Kelly Steele 
> Signed-off-by: Michael D Kinney 
> ---
>  .../Platform/Pei/PlatformInit/MrcWrapper.h   | 9 -
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git
> a/Platform/Intel/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.
> h
> b/Platform/Intel/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.
> h
> index e24eb4b475..129330d954 100644
> ---
> a/Platform/Intel/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.
> h
> +++
> b/Platform/Intel/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapp
> +++ er.h
> @@ -1,7 +1,7 @@
>  /** @file
>  Framework PEIM to initialize memory on an DDR2 SDRAM Memory
> Controller.
> 
> -Copyright (c) 2013 - 2016 Intel Corporation.
> +Copyright (c) 2013 - 2019 Intel Corporation.
> 
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -16,12 +16,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  //  //
> Define the default memory areas required  //
> -#define EDKII_RESERVED_SIZE_PAGES 0x20
> -#define ACPI_NVS_SIZE_PAGES   0x60
> -#define RUNTIME_SERVICES_DATA_SIZE_PAGES  0x20
> +#define EDKII_RESERVED_SIZE_PAGES 0x40
> +#define ACPI_NVS_SIZE_PAGES   0x40
> +#define RUNTIME_SERVICES_DATA_SIZE_PAGES  0xC0
>  #define RUNTIME_SERVICES_CODE_SIZE_PAGES  0x80
>  #define ACPI_RECLAIM_SIZE_PAGES   0x20
> -#define EDKII_DXE_MEM_SIZE_PAGES  0x20
> 
>  //
>  // Maximum number of "Socket Sets", where a "Socket Set is a set of
> matching
> --
> 2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43146): https://edk2.groups.io/g/devel/message/43146
Mute This Topic: https://groups.io/mt/32280703/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platforms Patch 1/4] QuarkPlatformPkg: Update network library mappings

2019-07-01 Thread Sun, Zailiang
Reviewed-By: Zailiang Sun 

> -Original Message-
> From: Kinney, Michael D
> Sent: Tuesday, July 2, 2019 7:01 AM
> To: devel@edk2.groups.io
> Cc: Sun, Zailiang ; Qian, Yi ; Ni,
> Ray ; Steele, Kelly 
> Subject: [edk2-platforms Patch 1/4] QuarkPlatformPkg: Update network
> library mappings
> 
> Cc: Zailiang Sun 
> Cc: Yi Qian 
> Cc: Ray Ni 
> Cc: Kelly Steele 
> Signed-off-by: Michael D Kinney 
> ---
>  Platform/Intel/QuarkPlatformPkg/Quark.dsc| 8 
>  Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc | 8 
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/Platform/Intel/QuarkPlatformPkg/Quark.dsc
> b/Platform/Intel/QuarkPlatformPkg/Quark.dsc
> index a76d3f9356..8ca7dda286 100644
> --- a/Platform/Intel/QuarkPlatformPkg/Quark.dsc
> +++ b/Platform/Intel/QuarkPlatformPkg/Quark.dsc
> @@ -130,10 +130,10 @@ [LibraryClasses]
>S3PciLib|MdePkg/Library/BaseS3PciLib/BaseS3PciLib.inf
>UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
>UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
> -  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
> -  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
> -  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
> -  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
> +  NetLib|NetworkPkg/Library/DxeNetLib/DxeNetLib.inf
> +  IpIoLib|NetworkPkg/Library/DxeIpIoLib/DxeIpIoLib.inf
> +  UdpIoLib|NetworkPkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
> +  DpcLib|NetworkPkg/Library/DxeDpcLib/DxeDpcLib.inf
> 
> OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibN
> ull/OemHookStatusCodeLibNull.inf
> 
> SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchroniz
> ationLib.inf
> 
> SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementL
> ib/DxeSecurityManagementLib.inf
> diff --git a/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc
> b/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc
> index 520c006c9e..03f1a9f862 100644
> --- a/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc
> +++ b/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc
> @@ -118,10 +118,10 @@ [LibraryClasses]
>S3PciLib|MdePkg/Library/BaseS3PciLib/BaseS3PciLib.inf
>UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
>UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
> -  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
> -  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
> -  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
> -  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
> +  NetLib|NetworkPkg/Library/DxeNetLib/DxeNetLib.inf
> +  IpIoLib|NetworkPkg/Library/DxeIpIoLib/DxeIpIoLib.inf
> +  UdpIoLib|NetworkPkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
> +  DpcLib|NetworkPkg/Library/DxeDpcLib/DxeDpcLib.inf
> 
> OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibN
> ull/OemHookStatusCodeLibNull.inf
> 
> SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchroniz
> ationLib.inf
> 
> SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementL
> ib/DxeSecurityManagementLib.inf
> --
> 2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43145): https://edk2.groups.io/g/devel/message/43145
Mute This Topic: https://groups.io/mt/32280700/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [RFC][PATCH v1 0/3] Remove IntelFramework[Module]Pkg

2019-07-01 Thread Liming Gao
Hao:
  I am OK for this change. Reviewed-by: Liming Gao 

  Please submit this patch until all platforms have been updated to drop the 
dependency of IntelFramework[Module]Pkg.

Thanks
Liming
>-Original Message-
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Wu,
>Hao A
>Sent: Monday, May 27, 2019 2:48 PM
>To: devel@edk2.groups.io
>Cc: Wu, Hao A ; Gao, Liming ;
>Ni, Ray ; Andrew Fish ; Laszlo Ersek
>; Leif Lindholm ; Kinney,
>Michael D 
>Subject: [edk2-devel] [RFC][PATCH v1 0/3] Remove
>IntelFramework[Module]Pkg
>
>
>'''
>Please note that this series will be hold until all the below requirements
>are met:
>
>A. edk2-stable201905 is created;
>B. OvmfPkg has been updated to drop its dependency on
>   IntelFramework[Module]Pkg; (Patches already been sent)
>C. Platforms in the edk2-platforms have been updated to drop their
>   dependencies on IntelFramework[Module]Pkg. (Patches already been sent
>   for all platforms except Intel Quark and Minnowboard)
>'''
>
>The patches themselves will not be sent to the mailing list and are only
>available at:
>https://github.com/hwu25/edk2/commits/delete_framework
>
>Cc: Liming Gao 
>Cc: Ray Ni 
>Cc: Andrew Fish 
>Cc: Laszlo Ersek 
>Cc: Leif Lindholm 
>Cc: Michael D Kinney 
>
>
>Hao A Wu (3):
>  Remove IntelFrameworkModulePkg
>  Remove IntelFrameworkPkg
>  Maintainers.txt: Remove information for IntelFramework[Module]Pkg
>
> IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
>|  241 --
> IntelFrameworkPkg/IntelFrameworkPkg.dec
>|  182 -
> IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
>|  178 -
> IntelFrameworkPkg/IntelFrameworkPkg.dsc
>|   69 -
> IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.inf
>|   67 -
> IntelFrameworkModulePkg/Bus/Isa/IsaFloppyDxe/IsaFloppyDxe.inf
>|   72 -
> IntelFrameworkModulePkg/Bus/Isa/IsaFloppyPei/IsaFloppyPei.inf
>|   66 -
> IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf
>|   64 -
> IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf
>|   74 -
> IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf
>|   79 -
>
>IntelFrameworkModulePkg/Bus/Isa/Ps2MouseAbsolutePointerDxe/Ps2Mous
>eAbsolutePointerDxe.inf   |   70 -
> IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf
>|   69 -
> IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf
>|   83 -
> IntelFrameworkModulePkg/Bus/Pci/VgaMiniPortDxe/VgaMiniPortDxe.inf
>|   51 -
> IntelFrameworkModulePkg/Csm/BiosThunk/BlockIoDxe/BlockIoDxe.inf
>|   58 -
> IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/KeyboardDxe.inf
>|   72 -
> IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/Snp16Dxe.inf
>|   66 -
> IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf
>|   80 -
> IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
>|  131 -
> IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.inf
>|   49 -
>
>IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/Dxe
>ReportStatusCodeLib.inf  |   53 -
> IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
>|  138 -
>
>IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaint
>UiLib.inf   |   63 -
>
>IntelFrameworkModulePkg/Library/LegacyBootManagerLib/LegacyBootMana
>gerLib.inf   |   58 -
>
>IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaArchCu
>stomDecompressLib.inf |   63 -
>
>IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustom
>DecompressLib.inf |   59 -
>
>IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDx
>eDebugLibReportStatusCode.inf   |   49 -
> IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.inf
>|   45 -
> IntelFrameworkModulePkg/Library/PeiS3Lib/PeiS3Lib.inf
>|   44 -
>
>IntelFrameworkModulePkg/Library/PlatformBdsLibNull/PlatformBdsLibNull.in
>f   |   41 -
>
>IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFra
>mework/SmmRuntimeDxeReportStatusCodeLibFramework.inf |   68 -
>
>IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3SaveDxe.in
>f  |   74 -
>
>IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportDxe
>.inf|   74 -
> IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
>|  222 -
> IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClassDxe.inf
>|   58 -
> IntelFrameworkModulePkg/Universal/CpuIoDxe/CpuIoDxe.inf
>|   46 -
> IntelFrameworkModulePkg/Universal/DataHubDxe/DataHubDxe.inf
>|   76 -
>
>IntelFrameworkModulePkg/Universal/DataHubStdErrDxe/DataHubStdErrDxe.
>inf |   52 -
>
>IntelFrameworkModulePkg/Universal/FirmwareVolume/FwVolDxe/FwVolDx
>e.inf  |   68 -
>

Re: [edk2-devel] [edk2-platforms Patch 0/4] Quark*Pkg: Remove Intel Framework depenencies

2019-07-01 Thread Ni, Ray
Mike,
I gave the R-b and pushed all 4 patches.

Thanks,
Ray

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Michael
> D Kinney
> Sent: Tuesday, July 2, 2019 7:01 AM
> To: devel@edk2.groups.io
> Cc: Sun, Zailiang ; Qian, Yi ; Ni,
> Ray ; Steele, Kelly 
> Subject: [edk2-devel] [edk2-platforms Patch 0/4] Quark*Pkg: Remove Intel
> Framework depenencies
> 
> * QuarkPlatformPkg: Update network library mappings
> * QuarkSocPkg: Remove Intel Framework dependencies
> * QuarkPlatformPkg: Remove Intel Framework dependencies
> * QuarkPkatformPkg: Update MemoryTypeInformation to reduce reboots
> 
> Cc: Zailiang Sun 
> Cc: Yi Qian 
> Cc: Ray Ni 
> Cc: Kelly Steele 
> Signed-off-by: Michael D Kinney 
> 
> Michael D Kinney (4):
>   QuarkPlatformPkg: Update network library mappings
>   QuarkSocPkg: Remove Intel Framework dependencies
>   QuarkPlatformPkg: Remove Intel Framework dependencies
>   QuarkPkatformPkg: Update MemoryTypeInformation to reduce reboots
> 
>  .../BootScriptExecutorDxe.inf |   77 -
>  .../Dxe/BootScriptExecutorDxe/IA32/S3Asm.S|   44 -
>  .../Dxe/BootScriptExecutorDxe/IA32/S3Asm.asm  |   51 -
>  .../BootScriptExecutorDxe/IA32/SetIdtEntry.c  |   57 -
>  .../Dxe/BootScriptExecutorDxe/ScriptExecute.c |  379 ---
>  .../Dxe/BootScriptExecutorDxe/ScriptExecute.h |   70 -
>  .../Acpi/DxeSmm/AcpiSmm/AcpiSmmPlatform.h |4 +-
>  .../Acpi/DxeSmm/AcpiSmm/AcpiSmmPlatform.inf   |6 +-
>  .../QuarkPlatformPkg/Include/DataHubRecords.h | 2934
> +
>  .../PlatformBootManager.c |   11 +-
>  .../PlatformBootManager.h |3 +-
>  .../PlatformBootManagerLib.inf|7 +-
>  .../Dxe/MemorySubClass/MemorySubClass.h   |6 +-
>  .../Dxe/MemorySubClass/MemorySubClass.inf |3 +-
>  .../Platform/Dxe/SmbiosMiscDxe/CommonHeader.h |6 +-
>  .../Dxe/SmbiosMiscDxe/SmbiosMiscDxe.inf   |3 +-
>  .../Platform/Pei/PlatformInit/CommonHeader.h  |4 +-
>  .../Platform/Pei/PlatformInit/MrcWrapper.h|9 +-
>  .../Pei/PlatformInit/PlatformEarlyInit.inf|5 +-
>  Platform/Intel/QuarkPlatformPkg/Quark.dsc |   28 +-
>  Platform/Intel/QuarkPlatformPkg/Quark.fdf |7 +-
>  Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc  |   11 +-
>  .../QuarkPlatformPkg/QuarkPlatformPkg.dec |   16 +-
>  .../Include/Guid/SmramMemoryReserve.h |   54 +
>  .../Include/Protocol/SmmIchnDispatch.h|  183 +
>  .../Smm/Dxe/SmmAccessDxe/SmmAccess.inf|1 -
>  .../QncSmmDispatcher/QNCSmmDispatcher.inf |3 +-
>  .../Smm/Pei/SmmAccessPei/SmmAccessPei.inf |3 +-
>  Silicon/Intel/QuarkSocPkg/QuarkSocPkg.dec |4 +-
>  .../Library/I2cLib/I2cLib.inf |4 +-
>  30 files changed, 3235 insertions(+), 758 deletions(-)  delete mode 100644
> Platform/Intel/QuarkPlatformPkg/Acpi/Dxe/BootScriptExecutorDxe/BootScri
> ptExecutorDxe.inf
>  delete mode 100644
> Platform/Intel/QuarkPlatformPkg/Acpi/Dxe/BootScriptExecutorDxe/IA32/S3
> Asm.S
>  delete mode 100644
> Platform/Intel/QuarkPlatformPkg/Acpi/Dxe/BootScriptExecutorDxe/IA32/S3
> Asm.asm
>  delete mode 100644
> Platform/Intel/QuarkPlatformPkg/Acpi/Dxe/BootScriptExecutorDxe/IA32/Se
> tIdtEntry.c
>  delete mode 100644
> Platform/Intel/QuarkPlatformPkg/Acpi/Dxe/BootScriptExecutorDxe/ScriptEx
> ecute.c
>  delete mode 100644
> Platform/Intel/QuarkPlatformPkg/Acpi/Dxe/BootScriptExecutorDxe/ScriptEx
> ecute.h
>  create mode 100644
> Platform/Intel/QuarkPlatformPkg/Include/DataHubRecords.h
>  create mode 100644
> Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Guid/SmramMemory
> Reserve.h
>  create mode 100644
> Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Protocol/SmmIchnDis
> patch.h
> 
> --
> 2.21.0.windows.1
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43143): https://edk2.groups.io/g/devel/message/43143
Mute This Topic: https://groups.io/mt/32280701/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platforms Patch 4/4] QuarkPkatformPkg: Update MemoryTypeInformation to reduce reboots

2019-07-01 Thread Ni, Ray
Reviewed-by: Ray Ni 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Michael
> D Kinney
> Sent: Tuesday, July 2, 2019 7:01 AM
> To: devel@edk2.groups.io
> Cc: Sun, Zailiang ; Qian, Yi ; Ni,
> Ray ; Steele, Kelly 
> Subject: [edk2-devel] [edk2-platforms Patch 4/4] QuarkPkatformPkg:
> Update MemoryTypeInformation to reduce reboots
> 
> Adjust size of bins in Memory Type Information HOB to eliminate extra
> reboot after first boot.
> 
> Cc: Zailiang Sun 
> Cc: Yi Qian 
> Cc: Ray Ni 
> Cc: Kelly Steele 
> Signed-off-by: Michael D Kinney 
> ---
>  .../Platform/Pei/PlatformInit/MrcWrapper.h   | 9 -
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git
> a/Platform/Intel/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.
> h
> b/Platform/Intel/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.
> h
> index e24eb4b475..129330d954 100644
> ---
> a/Platform/Intel/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.
> h
> +++
> b/Platform/Intel/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapp
> +++ er.h
> @@ -1,7 +1,7 @@
>  /** @file
>  Framework PEIM to initialize memory on an DDR2 SDRAM Memory
> Controller.
> 
> -Copyright (c) 2013 - 2016 Intel Corporation.
> +Copyright (c) 2013 - 2019 Intel Corporation.
> 
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -16,12 +16,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  //  //
> Define the default memory areas required  //
> -#define EDKII_RESERVED_SIZE_PAGES 0x20
> -#define ACPI_NVS_SIZE_PAGES   0x60
> -#define RUNTIME_SERVICES_DATA_SIZE_PAGES  0x20
> +#define EDKII_RESERVED_SIZE_PAGES 0x40
> +#define ACPI_NVS_SIZE_PAGES   0x40
> +#define RUNTIME_SERVICES_DATA_SIZE_PAGES  0xC0
>  #define RUNTIME_SERVICES_CODE_SIZE_PAGES  0x80
>  #define ACPI_RECLAIM_SIZE_PAGES   0x20
> -#define EDKII_DXE_MEM_SIZE_PAGES  0x20
> 
>  //
>  // Maximum number of "Socket Sets", where a "Socket Set is a set of
> matching
> --
> 2.21.0.windows.1
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43141): https://edk2.groups.io/g/devel/message/43141
Mute This Topic: https://groups.io/mt/32280703/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platforms Patch 2/4] QuarkSocPkg: Remove Intel Framework dependencies

2019-07-01 Thread Ni, Ray
Reviewed-by: Ray Ni 

> -Original Message-
> From: Kinney, Michael D 
> Sent: Tuesday, July 2, 2019 7:01 AM
> To: devel@edk2.groups.io
> Cc: Sun, Zailiang ; Qian, Yi ; Ni,
> Ray ; Steele, Kelly 
> Subject: [edk2-platforms Patch 2/4] QuarkSocPkg: Remove Intel Framework
> dependencies
> 
> * Add SMRAM Memory Reserve GUID to QuarkSocPkg
> * Add SMM ICHN Dispatch Protocol to QuarkSocPkg
> 
> Cc: Zailiang Sun 
> Cc: Yi Qian 
> Cc: Ray Ni 
> Cc: Kelly Steele 
> Signed-off-by: Michael D Kinney 
> ---
>  .../Include/Guid/SmramMemoryReserve.h |  54 ++
>  .../Include/Protocol/SmmIchnDispatch.h| 183 ++
>  .../Smm/Dxe/SmmAccessDxe/SmmAccess.inf|   1 -
>  .../QncSmmDispatcher/QNCSmmDispatcher.inf |   3 +-
>  .../Smm/Pei/SmmAccessPei/SmmAccessPei.inf |   3 +-
>  Silicon/Intel/QuarkSocPkg/QuarkSocPkg.dec |   4 +-
>  .../Library/I2cLib/I2cLib.inf |   4 +-
>  7 files changed, 243 insertions(+), 9 deletions(-)  create mode 100644
> Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Guid/SmramMemory
> Reserve.h
>  create mode 100644
> Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Protocol/SmmIchnDis
> patch.h
> 
> diff --git
> a/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Guid/SmramMemo
> ryReserve.h
> b/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Guid/SmramMemo
> ryReserve.h
> new file mode 100644
> index 00..d57dfbebf3
> --- /dev/null
> +++
> b/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Guid/SmramMemo
> +++ ryReserve.h
> @@ -0,0 +1,54 @@
> +/** @file
> +  Definition of GUIDed HOB for reserving SMRAM regions.
> +
> +  This file defines:
> +  * the GUID used to identify the GUID HOB for reserving SMRAM regions.
> +  * the data structure of SMRAM descriptor to describe SMRAM candidate
> + regions
> +  * values of state of SMRAM candidate regions
> +  * the GUID specific data structure of HOB for reserving SMRAM regions.
> +  This GUIDed HOB can be used to convey the existence of the T-SEG
> + reservation and H-SEG usage
> +
> +Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +  @par Revision Reference:
> +  GUIDs defined in SmmCis spec version 0.9.
> +
> +**/
> +
> +#ifndef _EFI_SMM_PEI_SMRAM_MEMORY_RESERVE_H_
> +#define _EFI_SMM_PEI_SMRAM_MEMORY_RESERVE_H_
> +
> +#define EFI_SMM_PEI_SMRAM_MEMORY_RESERVE \
> +  { \
> +0x6dadf1d1, 0xd4cc, 0x4910, {0xbb, 0x6e, 0x82, 0xb1, 0xfd, 0x80,
> +0xff, 0x3d } \
> +  }
> +
> +/**
> +* GUID specific data structure of HOB for reserving SMRAM regions.
> +*
> +* Inconsistent with specification here:
> +* EFI_HOB_SMRAM_DESCRIPTOR_BLOCK has been changed to
> EFI_SMRAM_HOB_DESCRIPTOR_BLOCK.
> +* This inconsistency is kept in code in order for backward compatibility.
> +**/
> +typedef struct {
> +  ///
> +  /// Designates the number of possible regions in the system
> +  /// that can be usable for SMRAM.
> +  ///
> +  /// Inconsistent with specification here:
> +  /// In Framework SMM CIS 0.91 specification, it defines the field type as
> UINTN.
> +  /// However, HOBs are supposed to be CPU neutral, so UINT32 should be
> used instead.
> +  ///
> +  UINT32NumberOfSmmReservedRegions;
> +  ///
> +  /// Used throughout this protocol to describe the candidate
> +  /// regions for SMRAM that are supported by this platform.
> +  ///
> +  EFI_SMRAM_DESCRIPTOR  Descriptor[1];
> +} EFI_SMRAM_HOB_DESCRIPTOR_BLOCK;
> +
> +extern EFI_GUID gEfiSmmPeiSmramMemoryReserveGuid;
> +
> +#endif
> +
> diff --git
> a/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Protocol/SmmIchn
> Dispatch.h
> b/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Protocol/SmmIchn
> Dispatch.h
> new file mode 100644
> index 00..3cf86c0ff9
> --- /dev/null
> +++
> b/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Protocol/SmmIc
> +++ hnDispatch.h
> @@ -0,0 +1,183 @@
> +/** @file
> +  Provides the parent dispatch service for a given SMI source generator.
> +  The EFI_SMM_ICHN_DISPATCH_PROTOCOL provides the ability to install
> +child handlers for
> +  the given event types.
> +
> +Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +  @par Revision Reference:
> +  This Protocol is defined in Framework of EFI SMM Core Interface Spec
> + Version 0.9.
> +
> +**/
> +
> +#ifndef _EFI_SMM_ICHN_DISPATCH_H_
> +#define _EFI_SMM_ICHN_DISPATCH_H_
> +
> +
> +//
> +// Global ID for the ICH SMI Protocol
> +//
> +#define EFI_SMM_ICHN_DISPATCH_PROTOCOL_GUID \
> +  { \
> +0xc50b323e, 0x9075, 0x4f2a, {0xac, 0x8e, 0xd2, 0x59, 0x6a, 0x10,
> +0x85, 0xcc } \
> +  }
> +
> +typedef struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL
> +EFI_SMM_ICHN_DISPATCH_PROTOCOL;
> +
> +//
> +// Related Definitions
> +//
> +//
> +// ICHN Specific SMIs.  These are miscellaneous SMI sources that are
> +supported by the // ICHN specific SMI implementation.  These may change
> +over time.  

Re: [edk2-devel] [edk2-platforms Patch 1/4] QuarkPlatformPkg: Update network library mappings

2019-07-01 Thread Ni, Ray
Reviewed-by: Ray Ni 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Michael
> D Kinney
> Sent: Tuesday, July 2, 2019 7:01 AM
> To: devel@edk2.groups.io
> Cc: Sun, Zailiang ; Qian, Yi ; Ni,
> Ray ; Steele, Kelly 
> Subject: [edk2-devel] [edk2-platforms Patch 1/4] QuarkPlatformPkg: Update
> network library mappings
> 
> Cc: Zailiang Sun 
> Cc: Yi Qian 
> Cc: Ray Ni 
> Cc: Kelly Steele 
> Signed-off-by: Michael D Kinney 
> ---
>  Platform/Intel/QuarkPlatformPkg/Quark.dsc| 8 
>  Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc | 8 
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/Platform/Intel/QuarkPlatformPkg/Quark.dsc
> b/Platform/Intel/QuarkPlatformPkg/Quark.dsc
> index a76d3f9356..8ca7dda286 100644
> --- a/Platform/Intel/QuarkPlatformPkg/Quark.dsc
> +++ b/Platform/Intel/QuarkPlatformPkg/Quark.dsc
> @@ -130,10 +130,10 @@ [LibraryClasses]
>S3PciLib|MdePkg/Library/BaseS3PciLib/BaseS3PciLib.inf
>UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
>UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
> -  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
> -  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
> -  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
> -  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
> +  NetLib|NetworkPkg/Library/DxeNetLib/DxeNetLib.inf
> +  IpIoLib|NetworkPkg/Library/DxeIpIoLib/DxeIpIoLib.inf
> +  UdpIoLib|NetworkPkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
> +  DpcLib|NetworkPkg/Library/DxeDpcLib/DxeDpcLib.inf
> 
> OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibN
> ull/OemHookStatusCodeLibNull.inf
> 
> SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchroniz
> ationLib.inf
> 
> SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementL
> ib/DxeSecurityManagementLib.inf
> diff --git a/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc
> b/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc
> index 520c006c9e..03f1a9f862 100644
> --- a/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc
> +++ b/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc
> @@ -118,10 +118,10 @@ [LibraryClasses]
>S3PciLib|MdePkg/Library/BaseS3PciLib/BaseS3PciLib.inf
>UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
>UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
> -  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
> -  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
> -  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
> -  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
> +  NetLib|NetworkPkg/Library/DxeNetLib/DxeNetLib.inf
> +  IpIoLib|NetworkPkg/Library/DxeIpIoLib/DxeIpIoLib.inf
> +  UdpIoLib|NetworkPkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
> +  DpcLib|NetworkPkg/Library/DxeDpcLib/DxeDpcLib.inf
> 
> OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibN
> ull/OemHookStatusCodeLibNull.inf
> 
> SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchroniz
> ationLib.inf
> 
> SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementL
> ib/DxeSecurityManagementLib.inf
> --
> 2.21.0.windows.1
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43139): https://edk2.groups.io/g/devel/message/43139
Mute This Topic: https://groups.io/mt/32280700/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH] Platform/Intel:Change the way of getting the env file content

2019-07-01 Thread Zhang, Shenglei
From: "Fan, Zhiju" 

The env file content can not be retrieved by using the
original method, so we change the way to read the content.
And we change the env file to original format.

This patch is going to fix the issue.

Cc: Liming Gao 
Cc: Bob Feng 
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Signed-off-by: Zhiju.Fan 
---
 Platform/Intel/Tools/GenBiosId/BiosId.env   |  1 -
 Platform/Intel/Tools/GenBiosId/GenBiosId.py | 33 -
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/Platform/Intel/Tools/GenBiosId/BiosId.env 
b/Platform/Intel/Tools/GenBiosId/BiosId.env
index dfdeeb3107..614a66ddb8 100644
--- a/Platform/Intel/Tools/GenBiosId/BiosId.env
+++ b/Platform/Intel/Tools/GenBiosId/BiosId.env
@@ -18,7 +18,6 @@
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
-[config]
 BOARD_ID  = KBLRVP3
 BOARD_REV = 1
 BOARD_EXT = 000
diff --git a/Platform/Intel/Tools/GenBiosId/GenBiosId.py 
b/Platform/Intel/Tools/GenBiosId/GenBiosId.py
index 7e9d115f05..31abb24d31 100644
--- a/Platform/Intel/Tools/GenBiosId/GenBiosId.py
+++ b/Platform/Intel/Tools/GenBiosId/GenBiosId.py
@@ -16,7 +16,7 @@ import struct
 import datetime
 import argparse
 import platform
-
+from collections import OrderedDict
 try:
 from configparser import ConfigParser
 except:
@@ -24,8 +24,6 @@ except:
 
 # Config message
 _BIOS_Signature = "$IBIOSI$"
-_SectionKeyName = '__name__'
-_SectionName = 'config'
 
 _ConfigItem = {
 "BOARD_ID": {'Value': '', 'Length': 7},
@@ -121,20 +119,26 @@ def CheckOptions(Options):
 EdkLogger("GenBiosId", FILE_NOT_FOUND, ExtraData="Input file not 
found")
 return InputFile, OutputFile, OutputTextFile
 
+# Read input file and get config
+def ReadInputFile(InputFile):
+InputDict = OrderedDict()
+with open(InputFile) as File:
+FileLines = File.readlines()
+for Line in FileLines:
+if Line.strip().startswith('#'):
+continue
+if '=' in Line:
+Key, Value = Line.split('=')
+InputDict[Key.strip()] = Value.strip()
+return InputDict
+
 
 # Parse the input file and extract the information
-def ParserInputFile(InputFile):
-cf = ConfigParser()
-cf.optionxform = str
-cf.read(InputFile)
-if _SectionName not in cf._sections:
-EdkLogger("GenBiosId", FORMAT_NOT_SUPPORTED, 
ExtraData=_ConfigSectionNotDefine)
-for Item in cf._sections[_SectionName]:
-if Item == _SectionKeyName:
-continue
+def ParserInputFile(InputDict):
+for Item in InputDict:
 if Item not in _ConfigItem:
 EdkLogger("GenBiosId", FORMAT_INVALID, 
ExtraData=_ConfigItemInvalid % Item)
-_ConfigItem[Item]['Value'] = cf._sections[_SectionName][Item]
+_ConfigItem[Item]['Value'] = InputDict[Item]
 if len(_ConfigItem[Item]['Value']) != _ConfigItem[Item]['Length']:
 EdkLogger("GenBiosId", FORMAT_INVALID, ExtraData=_ConfigLenInvalid 
% Item)
 for Item in _ConfigItem:
@@ -168,7 +172,8 @@ def PrintOutputFile(OutputFile, OutputTextFile, Id_Str):
 def Main():
 Options = MyOptionParser()
 InputFile, OutputFile, OutputTextFile = CheckOptions(Options)
-Id_Str = ParserInputFile(InputFile)
+InputDict = ReadInputFile(InputFile)
+Id_Str = ParserInputFile(InputDict)
 PrintOutputFile(OutputFile, OutputTextFile, Id_Str)
 return 0
 
-- 
2.18.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43138): https://edk2.groups.io/g/devel/message/43138
Mute This Topic: https://groups.io/mt/32281635/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platforms Patch 00/14] Vlv2TbltDevicePkg: Remove Intel Framework dependencies

2019-07-01 Thread Michael D Kinney
Hi Gary,

I recommend you rebase on top of this series.

I have verified Linux boots and I have been working
on the GCC and Linux build scripts as well. 

Please let me know if you see any issues with this
series applied and I can help get them fixed.

Thanks,

Mike

> -Original Message-
> From: Gary Lin [mailto:g...@suse.com]
> Sent: Sunday, June 30, 2019 9:04 PM
> To: devel@edk2.groups.io; Kinney, Michael D
> 
> Cc: Qian, Yi ; Sun, Zailiang
> 
> Subject: Re: [edk2-devel] [edk2-platforms Patch 00/14]
> Vlv2TbltDevicePkg: Remove Intel Framework dependencies
> 
> On Sun, Jun 30, 2019 at 07:55:39PM -0700,  Michael D
> Kinney  wrote:
> > The following changes remove all dependencies on the
> IntelFrameworkPkg
> > and IntelFrameworkModulePkg from the Vlv2TbltDevicePkg
> platform
> > builds.  These changes do depend on updates binaries
> on the edk2-non-osi repository.
> >
> Hi Michael,
> 
> I am amending the bash scripts for gcc. The firmware I
> built is using the binaries from Development190216 and
> could boot into Linux successfully with some workarounds
> for Wpce791, Bds, and InteFspWrapper. The patches you
> posted eliminate those parts I have to work around.
> 
> Just want to know if you need any assistance for the gcc
> build? I could rebase my work upon your patches and send
> them later.
> 
> Thanks,
> 
> Gary Lin
> 
> > * Vlv2DeviceRefCodePkg: Add
> gEfiSmmIchnDispatchProtocolGuid
> > * Vlv2TbltDevicePkg: Reduce Intel Framework
> dependencies
> > * Vlv2TbltDevicePkg: Remove unused modules/libraries
> > * Vlv2TbltDevicePkg: Switch from ISA to SIO modules
> > * Vlv2TbltDevicePkg: Switch to CPU I/O 2 Protocol
> > * Vlv2TbltDevicePkg: Remove use of PS/2 Policy
> Protocol
> > * Vlv2TbltDevicePkg: Remove use of BIOS ID tools
> > * Vlv2TbltDevicePkg: Remove use of Data Hub Protocol
> > * Vlv2TbltDevicePkg: Use PI Spec SMBUS2 PPI
> > * Vlv2TbltDevicePkg: Switch to MdeModulePkg BdsDxe
> > * Vlv2TbltDevicePkg: Update boot mode/state behaviors
> > * Vlv2TbltDevicePkg/PlatformSmm: Switch to PI SMM
> Protocols
> > * Vlv2TbltDevicePkg: Change to PI Spec ACPI Table
> Protocol
> >
> > Cc: Zailiang Sun 
> > Cc: Yi Qian 
> > Signed-off-by: Michael D Kinney
> 
> >
> > Michael D Kinney (14):
> >   Vlv2DeviceRefCodePkg: Add
> gEfiSmmIchnDispatchProtocolGuid
> >   Vlv2TbltDevicePkg: Reduce Intel Framework
> dependencies
> >   Vlv2TbltDevicePkg: Remove unused modules/libraries
> >   Vlv2TbltDevicePkg: Switch from ISA to SIO modules
> >   Vlv2TbltDevicePkg: Switch to CPU I/O 2 Protocol
> >   Vlv2TbltDevicePkg: Remove use of PS/2 Policy
> Protocol
> >   Vlv2TbltDevicePkg: Remove use of BIOS ID tools
> >   Vlv2TbltDevicePkg: Remove use of Data Hub Protocol
> >   Vlv2TbltDevicePkg: Use PI Spec SMBUS2 PPI
> >   Vlv2TbltDevicePkg: Switch to MdeModulePkg BdsDxe
> >   Vlv2TbltDevicePkg: Update boot mode/state behaviors
> >   Vlv2TbltDevicePkg/PlatformSmm: Switch to PI SMM
> Protocols
> >   Vlv2TbltDevicePkg: Change to PI Spec ACPI Table
> Protocol
> >   Vlv2TbltDevicePkg/PlatformInitPei: Update
> MemoryTypeInformation
> >
> >  .../AcpiPlatform/AcpiPlatform.c   |  137
> +-
> >  .../AcpiPlatform/AcpiPlatform.h   |   11
> +-
> >  .../AcpiPlatform/AcpiPlatform.inf |   14
> +-
> >  Platform/Intel/Vlv2TbltDevicePkg/BiosIdD.env  |   25
> -
> >  Platform/Intel/Vlv2TbltDevicePkg/BiosIdR.env  |   25
> -
> >  .../Intel/Vlv2TbltDevicePkg/BiosIdx64D.env|   25
> -
> >  .../Intel/Vlv2TbltDevicePkg/BiosIdx64R.env|   25
> -
> >  .../BootScriptSaveDxe/BootScriptSaveDxe.inf   |   60
> -
> >  .../InternalBootScriptSave.h  |  102
> -
> >  .../BootScriptSaveDxe/ScriptSave.c|  626
> ---
> >  .../Intel/Vlv2TbltDevicePkg/Build_IFWI.bat|   33
> -
> >  .../Library/FmpDeviceLib/FmpDeviceLib.c   |   12
> +-
> >  .../FspAzaliaConfigData/AzaliaConfig.bin  |  Bin
> 3708 -> 0 bytes
> >  .../FspSupport/BootModePei/BootModePei.c  |   42
> -
> >  .../FspSupport/BootModePei/BootModePei.inf|   40
> -
> >  .../FspHobProcessLibVlv2.c|  421
> --
> >  .../FspHobProcessLibVlv2.inf  |   74
> -
> >  .../FspPlatformSecLibVlv2.c   |  144
> -
> >  .../FspPlatformSecLibVlv2.inf |   82
> -
> >  .../Ia32/AsmSaveSecContext.asm|   45
> -
> >  .../SecFspPlatformSecLibVlv2/Ia32/Fsp.inc |   45
> -
> >  .../Ia32/PeiCoreEntry.asm |  135
> -
> >  .../Ia32/SecEntry.asm |  338
> --
> >  .../SecFspPlatformSecLibVlv2/Ia32/Stack.S |   71
> -
> >  .../SecFspPlatformSecLibVlv2/Ia32/Stack.asm   |   76
> -
> >  .../SecFspPlatformSecLibVlv2/PlatformInit.c   |   36
> -
> >  .../SecFspPlatformSecLibVlv2/SaveSecContext.c |  108
> -
> >  .../SecGetPerformance.c   |   83
> -
> >  .../SecPlatformInformation.c  |   77
> -
> >  .../SecFspPlatformSecLibVlv2/SecRamInitData.c |   16
> -
> >  .../SecTempRamSupport.c   |  

[edk2-devel] [edk2-platforms Patch 1/4] QuarkPlatformPkg: Update network library mappings

2019-07-01 Thread Michael D Kinney
Cc: Zailiang Sun 
Cc: Yi Qian 
Cc: Ray Ni 
Cc: Kelly Steele 
Signed-off-by: Michael D Kinney 
---
 Platform/Intel/QuarkPlatformPkg/Quark.dsc| 8 
 Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc | 8 
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Platform/Intel/QuarkPlatformPkg/Quark.dsc 
b/Platform/Intel/QuarkPlatformPkg/Quark.dsc
index a76d3f9356..8ca7dda286 100644
--- a/Platform/Intel/QuarkPlatformPkg/Quark.dsc
+++ b/Platform/Intel/QuarkPlatformPkg/Quark.dsc
@@ -130,10 +130,10 @@ [LibraryClasses]
   S3PciLib|MdePkg/Library/BaseS3PciLib/BaseS3PciLib.inf
   UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
-  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
-  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
-  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
-  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
+  NetLib|NetworkPkg/Library/DxeNetLib/DxeNetLib.inf
+  IpIoLib|NetworkPkg/Library/DxeIpIoLib/DxeIpIoLib.inf
+  UdpIoLib|NetworkPkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
+  DpcLib|NetworkPkg/Library/DxeDpcLib/DxeDpcLib.inf
   
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
   
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
   
SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
diff --git a/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc 
b/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc
index 520c006c9e..03f1a9f862 100644
--- a/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc
+++ b/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc
@@ -118,10 +118,10 @@ [LibraryClasses]
   S3PciLib|MdePkg/Library/BaseS3PciLib/BaseS3PciLib.inf
   UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
-  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
-  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
-  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
-  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
+  NetLib|NetworkPkg/Library/DxeNetLib/DxeNetLib.inf
+  IpIoLib|NetworkPkg/Library/DxeIpIoLib/DxeIpIoLib.inf
+  UdpIoLib|NetworkPkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
+  DpcLib|NetworkPkg/Library/DxeDpcLib/DxeDpcLib.inf
   
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
   
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
   
SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43132): https://edk2.groups.io/g/devel/message/43132
Mute This Topic: https://groups.io/mt/32280700/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [edk2-platforms Patch 4/4] QuarkPkatformPkg: Update MemoryTypeInformation to reduce reboots

2019-07-01 Thread Michael D Kinney
Adjust size of bins in Memory Type Information HOB to eliminate
extra reboot after first boot.

Cc: Zailiang Sun 
Cc: Yi Qian 
Cc: Ray Ni 
Cc: Kelly Steele 
Signed-off-by: Michael D Kinney 
---
 .../Platform/Pei/PlatformInit/MrcWrapper.h   | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git 
a/Platform/Intel/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.h 
b/Platform/Intel/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.h
index e24eb4b475..129330d954 100644
--- a/Platform/Intel/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.h
+++ b/Platform/Intel/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.h
@@ -1,7 +1,7 @@
 /** @file
 Framework PEIM to initialize memory on an DDR2 SDRAM Memory Controller.
 
-Copyright (c) 2013 - 2016 Intel Corporation.
+Copyright (c) 2013 - 2019 Intel Corporation.
 
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -16,12 +16,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 //
 // Define the default memory areas required
 //
-#define EDKII_RESERVED_SIZE_PAGES 0x20
-#define ACPI_NVS_SIZE_PAGES   0x60
-#define RUNTIME_SERVICES_DATA_SIZE_PAGES  0x20
+#define EDKII_RESERVED_SIZE_PAGES 0x40
+#define ACPI_NVS_SIZE_PAGES   0x40
+#define RUNTIME_SERVICES_DATA_SIZE_PAGES  0xC0
 #define RUNTIME_SERVICES_CODE_SIZE_PAGES  0x80
 #define ACPI_RECLAIM_SIZE_PAGES   0x20
-#define EDKII_DXE_MEM_SIZE_PAGES  0x20
 
 //
 // Maximum number of "Socket Sets", where a "Socket Set is a set of matching
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43135): https://edk2.groups.io/g/devel/message/43135
Mute This Topic: https://groups.io/mt/32280703/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [edk2-platforms Patch 2/4] QuarkSocPkg: Remove Intel Framework dependencies

2019-07-01 Thread Michael D Kinney
* Add SMRAM Memory Reserve GUID to QuarkSocPkg
* Add SMM ICHN Dispatch Protocol to QuarkSocPkg

Cc: Zailiang Sun 
Cc: Yi Qian 
Cc: Ray Ni 
Cc: Kelly Steele 
Signed-off-by: Michael D Kinney 
---
 .../Include/Guid/SmramMemoryReserve.h |  54 ++
 .../Include/Protocol/SmmIchnDispatch.h| 183 ++
 .../Smm/Dxe/SmmAccessDxe/SmmAccess.inf|   1 -
 .../QncSmmDispatcher/QNCSmmDispatcher.inf |   3 +-
 .../Smm/Pei/SmmAccessPei/SmmAccessPei.inf |   3 +-
 Silicon/Intel/QuarkSocPkg/QuarkSocPkg.dec |   4 +-
 .../Library/I2cLib/I2cLib.inf |   4 +-
 7 files changed, 243 insertions(+), 9 deletions(-)
 create mode 100644 
Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Guid/SmramMemoryReserve.h
 create mode 100644 
Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Protocol/SmmIchnDispatch.h

diff --git 
a/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Guid/SmramMemoryReserve.h 
b/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Guid/SmramMemoryReserve.h
new file mode 100644
index 00..d57dfbebf3
--- /dev/null
+++ 
b/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Guid/SmramMemoryReserve.h
@@ -0,0 +1,54 @@
+/** @file
+  Definition of GUIDed HOB for reserving SMRAM regions.
+
+  This file defines:
+  * the GUID used to identify the GUID HOB for reserving SMRAM regions.
+  * the data structure of SMRAM descriptor to describe SMRAM candidate regions
+  * values of state of SMRAM candidate regions
+  * the GUID specific data structure of HOB for reserving SMRAM regions.
+  This GUIDed HOB can be used to convey the existence of the T-SEG reservation 
and H-SEG usage
+
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Revision Reference:
+  GUIDs defined in SmmCis spec version 0.9.
+
+**/
+
+#ifndef _EFI_SMM_PEI_SMRAM_MEMORY_RESERVE_H_
+#define _EFI_SMM_PEI_SMRAM_MEMORY_RESERVE_H_
+
+#define EFI_SMM_PEI_SMRAM_MEMORY_RESERVE \
+  { \
+0x6dadf1d1, 0xd4cc, 0x4910, {0xbb, 0x6e, 0x82, 0xb1, 0xfd, 0x80, 0xff, 
0x3d } \
+  }
+
+/**
+* GUID specific data structure of HOB for reserving SMRAM regions.
+*
+* Inconsistent with specification here:
+* EFI_HOB_SMRAM_DESCRIPTOR_BLOCK has been changed to 
EFI_SMRAM_HOB_DESCRIPTOR_BLOCK.
+* This inconsistency is kept in code in order for backward compatibility.
+**/
+typedef struct {
+  ///
+  /// Designates the number of possible regions in the system
+  /// that can be usable for SMRAM.
+  ///
+  /// Inconsistent with specification here:
+  /// In Framework SMM CIS 0.91 specification, it defines the field type as 
UINTN.
+  /// However, HOBs are supposed to be CPU neutral, so UINT32 should be used 
instead.
+  ///
+  UINT32NumberOfSmmReservedRegions;
+  ///
+  /// Used throughout this protocol to describe the candidate
+  /// regions for SMRAM that are supported by this platform.
+  ///
+  EFI_SMRAM_DESCRIPTOR  Descriptor[1];
+} EFI_SMRAM_HOB_DESCRIPTOR_BLOCK;
+
+extern EFI_GUID gEfiSmmPeiSmramMemoryReserveGuid;
+
+#endif
+
diff --git 
a/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Protocol/SmmIchnDispatch.h
 
b/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Protocol/SmmIchnDispatch.h
new file mode 100644
index 00..3cf86c0ff9
--- /dev/null
+++ 
b/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Include/Protocol/SmmIchnDispatch.h
@@ -0,0 +1,183 @@
+/** @file
+  Provides the parent dispatch service for a given SMI source generator.
+  The EFI_SMM_ICHN_DISPATCH_PROTOCOL provides the ability to install child 
handlers for
+  the given event types.
+
+Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Revision Reference:
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec
+  Version 0.9.
+
+**/
+
+#ifndef _EFI_SMM_ICHN_DISPATCH_H_
+#define _EFI_SMM_ICHN_DISPATCH_H_
+
+
+//
+// Global ID for the ICH SMI Protocol
+//
+#define EFI_SMM_ICHN_DISPATCH_PROTOCOL_GUID \
+  { \
+0xc50b323e, 0x9075, 0x4f2a, {0xac, 0x8e, 0xd2, 0x59, 0x6a, 0x10, 0x85, 
0xcc } \
+  }
+
+typedef struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL  EFI_SMM_ICHN_DISPATCH_PROTOCOL;
+
+//
+// Related Definitions
+//
+//
+// ICHN Specific SMIs.  These are miscellaneous SMI sources that are supported 
by the
+// ICHN specific SMI implementation.  These may change over time.  TrapNumber 
is only
+// valid if the Type is Trap.
+//
+typedef enum {
+  //
+  // NOTE: NEVER delete items from this list/enumeration!  Doing so will 
prevent other versions
+  // of the code from compiling.  If the ICH version your driver is written 
for doesn't support
+  // some of these SMIs, then simply return EFI_UNSUPPORTED when a 
child/client tries to register
+  // for them.
+  //
+  IchnMch,
+  IchnPme,
+  IchnRtcAlarm,
+  IchnRingIndicate,
+  IchnAc97Wake,
+  IchnSerialIrq,
+  IchnY2KRollover,
+  IchnTcoTimeout,
+  IchnOsTco,
+  IchnNmi,
+  IchnIntruderDetect,
+  IchnBiosWp,
+ 

[edk2-devel][staging/edk2-host-test] Announce to create edk2-host-test branch in edk2-staging.

2019-07-01 Thread Xiaoyu Lu
I have created a branch in my fork edk2-staging 
(https://github.com/xiaoyuxlu/edk2-staging/tree/edk2-host-test).
Edk2-host-test is separated from 
https://github.com/tianocore/edk2-staging/tree/HBFA.  You can refer this for 
detail:
https://github.com/xiaoyuxlu/edk2-staging/blob/edk2-host-test/README.md

We want this branch to store these unit tests or functional programs which can 
run directly in OS environment(host based).


Thanks,
Xiaoyu

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43129): https://edk2.groups.io/g/devel/message/43129
Mute This Topic: https://groups.io/mt/32273322/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] OvmfPkg/XenBusDxe: Don't call DisconnectController in Stop()

2019-07-01 Thread Laszlo Ersek
On 07/01/19 13:14, Anthony PERARD wrote:
> Calling DisconnectController() on children isn't part of the job of
> EFI_DRIVER_BINDING_PROTOCOL.Stop() as it only needs to deallocate
> resources allocated in Start(). The disconnection will happen when
> both DevicePath and XenBus protocols gets uninstalled.
> 
> Reported-by: Laszlo Ersek 
> Signed-off-by: Anthony PERARD 
> ---
> 
> Notes:
> Please apply this patch after:
> "OvmfPkg/XenBusDxe: Close XenIoProtocol openned by children"
> 
>  OvmfPkg/XenBusDxe/XenBusDxe.c | 6 --
>  1 file changed, 6 deletions(-)
> 
> diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.c b/OvmfPkg/XenBusDxe/XenBusDxe.c
> index 7c07a96650..634c7b71eb 100644
> --- a/OvmfPkg/XenBusDxe/XenBusDxe.c
> +++ b/OvmfPkg/XenBusDxe/XenBusDxe.c
> @@ -446,12 +446,6 @@ XenBusDxeDriverBindingStop (
>continue;
>  }
>  ChildData = XENBUS_PRIVATE_DATA_FROM_THIS (XenBusIo);
> -Status = gBS->DisconnectController (ChildData->Handle, NULL, NULL);
> -if (EFI_ERROR (Status)) {
> -  DEBUG ((EFI_D_ERROR, "XenBusDxe: error disconnecting child: %r\n",
> -  Status));
> -  continue;
> -}
>  
>  Status = gBS->CloseProtocol (Dev->ControllerHandle, ,
>  Dev->This->DriverBindingHandle, ChildData->Handle);
> 

Commit 6a1f06fadb26.

Thanks
Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43128): https://edk2.groups.io/g/devel/message/43128
Mute This Topic: https://groups.io/mt/32270256/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v2] OvmfPkg/XenBusDxe: Close XenIoProtocol openned by children

2019-07-01 Thread Laszlo Ersek
On 07/01/19 12:50, Anthony PERARD wrote:
> In XenBusDxe, the XenBusAddDevice() opens the gXenIoProtocolGuid on
> behalf of child controllers. It is never closed and prevents us from
> uninstalling the protocol.
> 
> Close it where we stop all the children in XenBusDxe->Stop().
> 
> Signed-off-by: Anthony PERARD 
> Reviewed-by: Laszlo Ersek 
> ---
>  OvmfPkg/XenBusDxe/XenBusDxe.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.c b/OvmfPkg/XenBusDxe/XenBusDxe.c
> index 0e63707f50..7c07a96650 100644
> --- a/OvmfPkg/XenBusDxe/XenBusDxe.c
> +++ b/OvmfPkg/XenBusDxe/XenBusDxe.c
> @@ -453,6 +453,10 @@ XenBusDxeDriverBindingStop (
>continue;
>  }
>  
> +Status = gBS->CloseProtocol (Dev->ControllerHandle, ,
> +Dev->This->DriverBindingHandle, ChildData->Handle);
> +ASSERT_EFI_ERROR (Status);
> +
>  Status = gBS->UninstallMultipleProtocolInterfaces (
> ChildData->Handle,
> , ChildData->DevicePath,
> 

Commit 64ef66ba8b41.

Thanks
Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43127): https://edk2.groups.io/g/devel/message/43127
Mute This Topic: https://groups.io/mt/32270096/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] OvmfPkg/XenBusDxe: Don't call DisconnectController in Stop()

2019-07-01 Thread Laszlo Ersek
On 07/01/19 13:14, Anthony PERARD wrote:
> Calling DisconnectController() on children isn't part of the job of
> EFI_DRIVER_BINDING_PROTOCOL.Stop() as it only needs to deallocate
> resources allocated in Start(). The disconnection will happen when
> both DevicePath and XenBus protocols gets uninstalled.

Correct. In the spec, UninstallMultipleProtocolInterfaces() refers to
UninstallProtocolInterface(), and the latter says,

[...] Before the protocol interface is removed, an attempt is made
to force all the drivers that are consuming the protocol interface
to stop consuming that protocol interface. This is done by calling
the boot service EFI_BOOT_SERVICES.DisconnectController() for the
driver that currently have the protocol interface open with an
attribute of EFI_OPEN_PROTOCOL_BY_DRIVER or
EFI_OPEN_PROTOCOL_BY_DRIVER | EFI_OPEN_PROTOCOL_EXCLUSIVE. [...]

And, the Driver Writer's Guide states, in a Note,

When an attempt is made to remove a protocol interface from a handle
in the handle database, the UEFI core firmware checks to see if any
other UEFI drivers are currently using the services of the protocol
to be removed. If UEFI drivers are using that protocol interface,
the UEFI core firmware attempts to stop those UEFI drivers with a
call to DisconnectController(). This is a quick, legal, and safe way
to shut down any protocols associated with this driver's stack.

> 
> Reported-by: Laszlo Ersek 
> Signed-off-by: Anthony PERARD 
> ---
> 
> Notes:
> Please apply this patch after:
> "OvmfPkg/XenBusDxe: Close XenIoProtocol openned by children"
> 
>  OvmfPkg/XenBusDxe/XenBusDxe.c | 6 --
>  1 file changed, 6 deletions(-)
> 
> diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.c b/OvmfPkg/XenBusDxe/XenBusDxe.c
> index 7c07a96650..634c7b71eb 100644
> --- a/OvmfPkg/XenBusDxe/XenBusDxe.c
> +++ b/OvmfPkg/XenBusDxe/XenBusDxe.c
> @@ -446,12 +446,6 @@ XenBusDxeDriverBindingStop (
>continue;
>  }
>  ChildData = XENBUS_PRIVATE_DATA_FROM_THIS (XenBusIo);
> -Status = gBS->DisconnectController (ChildData->Handle, NULL, NULL);
> -if (EFI_ERROR (Status)) {
> -  DEBUG ((EFI_D_ERROR, "XenBusDxe: error disconnecting child: %r\n",
> -  Status));
> -  continue;
> -}
>  
>  Status = gBS->CloseProtocol (Dev->ControllerHandle, ,
>  Dev->This->DriverBindingHandle, ChildData->Handle);
> 

Reviewed-by: Laszlo Ersek 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43126): https://edk2.groups.io/g/devel/message/43126
Mute This Topic: https://groups.io/mt/32270256/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 3/3] UefiCpuPkg/PiSmmCpu: Enable 5 level paging when CPU supports

2019-07-01 Thread Laszlo Ersek
On 06/28/19 08:47, Ni, Ray wrote:
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1946
>
> The patch changes SMM environment to use 5 level paging when CPU
> supports it.
>
> Signed-off-by: Ray Ni 
> Cc: Eric Dong 
> ---
>  .../PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c   |  20 +-
>  UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c| 272 ++
>  UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c   | 483 --
>  UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm   |  12 +
>  .../PiSmmCpuDxeSmm/X64/SmmProfileArch.c   |  72 ++-
>  5 files changed, 559 insertions(+), 300 deletions(-)

This patch does not build with GCC, because:

> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c 
> b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
> index 3d5d663d99..c088010327 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
> @@ -16,6 +16,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  LIST_ENTRY  mPagePool = 
> INITIALIZE_LIST_HEAD_VARIABLE (mPagePool);
>  BOOLEAN m1GPageTableSupport = FALSE;
>  BOOLEAN mCpuSmmStaticPageTable;
> +BOOLEAN m5LevelPagingSupport;

as-is, two translation units *define* (allocate) "m5LevelPagingSupport":
"PageTbl.c" above, and "SmiEntry.nasm". And that breaks the build with
GCC (it should break the build with VS as well, because it is a bug in
the code).

However, I'm not suggesting that we add "extern" to "PageTbl.c".

Because, I don't think we should reintroduce DBs into the PiSmmCpuDxeSmm
assembly code. That would be a regression for:

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

We should *especially* not reintroduce the dual use of a byte
- both for binary instruction encoding,
- and as a data value (for steering C-language code).

PiSmmCpuDxeSmm had that kind of code before, but I eliminated it. For
example, in commit 3c5ce64f23c4 ("UefiCpuPkg/PiSmmCpuDxeSmm: patch
"XdSupported" with PatchInstructionX86()", 2018-04-04).

Therefore, please incorporate the following update, into patch #3:

> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm 
> b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm
> index b5e0405b3b00..ae79bf024bf0 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm
> @@ -69,7 +69,7 @@ extern ASM_PFX(mXdSupported)
>  global ASM_PFX(gPatchXdSupported)
>  global ASM_PFX(gPatchSmiStack)
>  global ASM_PFX(gPatchSmiCr3)
> -global ASM_PFX(m5LevelPagingSupport)
> +global ASM_PFX(gPatch5LevelPagingSupport)
>  global ASM_PFX(gcSmiHandlerTemplate)
>  global ASM_PFX(gcSmiHandlerSize)
>
> @@ -126,8 +126,8 @@ ASM_PFX(gPatchSmiCr3):
>  mov cr3, rax
>  mov eax, 0x668   ; as cr4.PGE is not set here, 
> refresh cr3
>
> -DB  0xb1; mov cl, m5LevelPagingSupport
> -ASM_PFX(m5LevelPagingSupport): DB 0
> +mov cl, strict byte 0   ; source operand will be patched
> +ASM_PFX(gPatch5LevelPagingSupport):
>  cmp cl, 0
>  je  SkipEnable5LevelPaging
>  ;
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c 
> b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
> index c08801032766..c31160735a37 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
> @@ -17,6 +17,7 @@ LIST_ENTRY  mPagePool = 
> INITIALIZE_LIST_HEAD_VARIABLE (m
>  BOOLEAN m1GPageTableSupport = FALSE;
>  BOOLEAN mCpuSmmStaticPageTable;
>  BOOLEAN m5LevelPagingSupport;
> +X86_ASSEMBLY_PATCH_LABELgPatch5LevelPagingSupport;
>
>  /**
>Disable CET.
> @@ -337,6 +338,7 @@ SmmInitPageTable (
>m1GPageTableSupport= Is1GPageSupport ();
>m5LevelPagingSupport   = Is5LevelPagingSupport ();
>mPhysicalAddressBits   = CalculateMaximumSupportAddress ();
> +  PatchInstructionX86 (gPatch5LevelPagingSupport, m5LevelPagingSupport, 1);
>DEBUG ((DEBUG_INFO, "5LevelPaging Support - %d\n", 
> m5LevelPagingSupport));
>DEBUG ((DEBUG_INFO, "1GPageTable Support  - %d\n", 
> m1GPageTableSupport));
>DEBUG ((DEBUG_INFO, "PcdCpuSmmStaticPageTable - %d\n", 
> mCpuSmmStaticPageTable));

With this update, the build succeeds, and a quick regression-test has
passed for me (using OVMF/IA32X64).

I'll try to do deeper testing if you agree with this update.

Thanks,
Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43125): https://edk2.groups.io/g/devel/message/43125
Mute This Topic: https://groups.io/mt/32239521/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] Silicon/Tools: Replace white spaces with tabs in GNUmakefile

2019-07-01 Thread Liming Gao
Reviewed-by: Liming Gao 

>-Original Message-
>From: Zhang, Shenglei
>Sent: Monday, July 01, 2019 3:10 PM
>To: devel@edk2.groups.io
>Cc: Feng, Bob C ; Gao, Liming 
>Subject: [PATCH] Silicon/Tools: Replace white spaces with tabs in
>GNUmakefile
>
>The tools can't be complied successfully because of the white spaces
>in GNUmakefile. So replace them with tabs.
>
>Cc: Bob Feng 
>Cc: Liming Gao 
>Signed-off-by: Shenglei Zhang 
>---
> Silicon/Intel/Tools/GNUmakefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/Silicon/Intel/Tools/GNUmakefile
>b/Silicon/Intel/Tools/GNUmakefile
>index 20abf148b5..6910b6ad0f 100644
>--- a/Silicon/Intel/Tools/GNUmakefile
>+++ b/Silicon/Intel/Tools/GNUmakefile
>@@ -18,11 +18,11 @@ $(APPLICATIONS): $(MAKEROOT)/bin
> .PHONY: subdirs $(SUBDIRS)
> subdirs: $(SUBDIRS)
> $(SUBDIRS):
>-$(MAKE) -C $@
>+  $(MAKE) -C $@
>
> .PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
> $(patsubst %,%-clean,$(sort $(SUBDIRS))):
>--$(MAKE) -C $(@:-clean=) clean
>+  -$(MAKE) -C $(@:-clean=) clean
>
> clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
>
>--
>2.18.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43124): https://edk2.groups.io/g/devel/message/43124
Mute This Topic: https://groups.io/mt/32269137/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [Patch v3 0/3] BaseTools: Move FCE & FMMT tools to edk2 repo

2019-07-01 Thread Liming Gao
REF:FMMT(https://bugzilla.tianocore.org/show_bug.cgi?id=1847)
FCE(https://bugzilla.tianocore.org/show_bug.cgi?id=1848)

Changes are committed in forked repository:
https://github.com/shenglei10/edk2/commits/movetool

FCE & FMMT tools are in https://firmware.intel.com/develop 
Intel UEFI tools and utilities. Now, this patch moves them 
to edk2 repo BaseTools directory. Besides, this patch updates
their license header to BSD-2-Clause-Patent, and does some 
bug fixes.

In V2:
  Without ARM/AARCH64 Linux build verification, and give the 
  proposal to move it to edk2-platform Platform\Intel\Tools
  https://edk2.groups.io/g/devel/message/42545

In V3:
  Collect more feedback in edk2 community and Design Meeting.
  https://edk2.groups.io/g/announce/message/49
  One option is to ask help for the people who work on ARM/AARCH64 Linux
  to compile these patch set before those patches are pushed. 

Now, these patches have been reviewed and tested on IA32/X64.
I plan to push them on July 3rd (UTC+8 10AM). If you find any issue, 
please let me know. After push, if you find any break, please 
let me know.

Cc: Bob Feng 
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Cetola Stephano 

Shenglei Zhang (3):
  BaseTools/BfmLib: Add BfmLib to edk2/master
  BaseTools/FCE: Add FCE tool to edk2/master
  BaseTools/FMMT: Add a new tool FMMT

 BaseTools/Source/C/BfmLib/BfmLib.c | 4355 +
 BaseTools/Source/C/BfmLib/BinFileManager.c | 1024 
 BaseTools/Source/C/FCE/BinaryCreate.c  |  216 +
 BaseTools/Source/C/FCE/BinaryParse.c   | 1326 
 BaseTools/Source/C/FCE/Common.c| 2183 +++
 BaseTools/Source/C/FCE/Expression.c| 2367 +++
 BaseTools/Source/C/FCE/Fce.c   | 6449 
 BaseTools/Source/C/FCE/IfrParse.c  | 4836 +++
 BaseTools/Source/C/FCE/MonotonicBasedVariable.c|  874 +++
 BaseTools/Source/C/FCE/TimeBasedVariable.c |  878 +++
 BaseTools/Source/C/FCE/Variable.c  | 1091 
 BaseTools/Source/C/FMMT/FirmwareModuleManagement.c | 2559 
 BaseTools/Source/C/FMMT/FmmtLib.c  | 5051 +++
 BaseTools/Source/C/FMMT/Rebase.c   |  846 +++
 BaseTools/BinWrappers/PosixLike/BfmLib |   29 +
 BaseTools/BinWrappers/PosixLike/FCE|   29 +
 BaseTools/BinWrappers/PosixLike/FMMT   |   29 +
 BaseTools/Source/C/BfmLib/BinFileManager.h |  439 ++
 BaseTools/Source/C/BfmLib/GNUmakefile  |   15 +
 BaseTools/Source/C/BfmLib/Makefile |   17 +
 BaseTools/Source/C/FCE/BinaryCreate.h  |  157 +
 BaseTools/Source/C/FCE/BinaryParse.h   |  187 +
 BaseTools/Source/C/FCE/Common.h|  999 +++
 BaseTools/Source/C/FCE/Fce.h   |  447 ++
 BaseTools/Source/C/FCE/GNUmakefile |   55 +
 BaseTools/Source/C/FCE/IfrParse.h  |  789 +++
 BaseTools/Source/C/FCE/Makefile|   19 +
 BaseTools/Source/C/FCE/MonotonicBasedVariable.h|  162 +
 BaseTools/Source/C/FCE/TimeBasedVariable.h |  166 +
 BaseTools/Source/C/FCE/Variable.h  |  154 +
 BaseTools/Source/C/FCE/VariableCommon.h|   55 +
 BaseTools/Source/C/FMMT/FirmwareModuleManagement.h |  479 ++
 BaseTools/Source/C/FMMT/FmmtConf.ini   |6 +
 BaseTools/Source/C/FMMT/GNUmakefile|   16 +
 BaseTools/Source/C/FMMT/Makefile   |   17 +
 BaseTools/Source/C/FMMT/Rebase.h   |   31 +
 BaseTools/Source/C/GNUmakefile |5 +-
 BaseTools/Source/C/Makefile|5 +-
 38 files changed, 38360 insertions(+), 2 deletions(-)
 create mode 100644 BaseTools/Source/C/BfmLib/BfmLib.c
 create mode 100644 BaseTools/Source/C/BfmLib/BinFileManager.c
 create mode 100644 BaseTools/Source/C/FCE/BinaryCreate.c
 create mode 100644 BaseTools/Source/C/FCE/BinaryParse.c
 create mode 100644 BaseTools/Source/C/FCE/Common.c
 create mode 100644 BaseTools/Source/C/FCE/Expression.c
 create mode 100644 BaseTools/Source/C/FCE/Fce.c
 create mode 100644 BaseTools/Source/C/FCE/IfrParse.c
 create mode 100644 BaseTools/Source/C/FCE/MonotonicBasedVariable.c
 create mode 100644 BaseTools/Source/C/FCE/TimeBasedVariable.c
 create mode 100644 BaseTools/Source/C/FCE/Variable.c
 create mode 100644 BaseTools/Source/C/FMMT/FirmwareModuleManagement.c
 create mode 100644 BaseTools/Source/C/FMMT/FmmtLib.c
 create mode 100644 BaseTools/Source/C/FMMT/Rebase.c
 create mode 100755 BaseTools/BinWrappers/PosixLike/BfmLib
 create mode 100755 BaseTools/BinWrappers/PosixLike/FCE
 create mode 100755 BaseTools/BinWrappers/PosixLike/FMMT
 create mode 100644 BaseTools/Source/C/BfmLib/BinFileManager.h
 create mode 100644 BaseTools/Source/C/BfmLib/GNUmakefile
 create mode 100644 BaseTools/Source/C/BfmLib/Makefile
 create 

[edk2-devel] [PATCH] OvmfPkg/XenBusDxe: Don't call DisconnectController in Stop()

2019-07-01 Thread Anthony PERARD
Calling DisconnectController() on children isn't part of the job of
EFI_DRIVER_BINDING_PROTOCOL.Stop() as it only needs to deallocate
resources allocated in Start(). The disconnection will happen when
both DevicePath and XenBus protocols gets uninstalled.

Reported-by: Laszlo Ersek 
Signed-off-by: Anthony PERARD 
---

Notes:
Please apply this patch after:
"OvmfPkg/XenBusDxe: Close XenIoProtocol openned by children"

 OvmfPkg/XenBusDxe/XenBusDxe.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.c b/OvmfPkg/XenBusDxe/XenBusDxe.c
index 7c07a96650..634c7b71eb 100644
--- a/OvmfPkg/XenBusDxe/XenBusDxe.c
+++ b/OvmfPkg/XenBusDxe/XenBusDxe.c
@@ -446,12 +446,6 @@ XenBusDxeDriverBindingStop (
   continue;

 }

 ChildData = XENBUS_PRIVATE_DATA_FROM_THIS (XenBusIo);

-Status = gBS->DisconnectController (ChildData->Handle, NULL, NULL);

-if (EFI_ERROR (Status)) {

-  DEBUG ((EFI_D_ERROR, "XenBusDxe: error disconnecting child: %r\n",

-  Status));

-  continue;

-}

 

 Status = gBS->CloseProtocol (Dev->ControllerHandle, ,

 Dev->This->DriverBindingHandle, ChildData->Handle);

-- 
Anthony PERARD


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43119): https://edk2.groups.io/g/devel/message/43119
Mute This Topic: https://groups.io/mt/32270256/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 2/3] MdePkg/BaseLib: Base64Decode: Make DestinationSize complied to spec

2019-07-01 Thread Laszlo Ersek
On 06/28/19 05:57, Gao, Zhichao wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1891
> 
> DestinationSize is decripted as 'Set to bytes stored on return'.
> Before return the status, set its converted bytes to be complied
> to the decriptions.
> DestinationIndex may be overflow if the *DestinationSize is bigger
> than (MAX_ADDRESS - 1). Move its incrementation under condition
> 'DestinationIndex < *DestinationSize' to make sure it wouldn't be
> overflow.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Marvin Hauser 
> Cc: Laszlo Ersek 
> Signed-off-by: Zhichao Gao 
> ---
>  MdePkg/Library/BaseLib/String.c | 13 +++--
>  1 file changed, 11 insertions(+), 2 deletions(-)

I'm going to skip this patch because, as I stated under the blurb, I
believe that the basic approach of the function implementation is wrong.

Thanks
Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43117): https://edk2.groups.io/g/devel/message/43117
Mute This Topic: https://groups.io/mt/32238989/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 0/3] MdePkg/BaseLib: Base64Decode: Make it follow its specification

2019-07-01 Thread Laszlo Ersek
On 06/28/19 05:57, Gao, Zhichao wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1891
> 
> Adjust the coding style.
> Set DestinationSize before return.
> Add addition decription for the RETURN_SUCCESS case.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Marvin Hauser 
> Cc: Laszlo Ersek 
> 
> Zhichao Gao (3):
>   MdePkg/BaseLib: Adjust the coding style in Base64Decode
>   MdePkg/BaseLib: Base64Decode: Make DestinationSize complied to spec
>   MdePkg/BaseLib: Base64Decode: Add decription for RETURN_SUCCESS
> 
>  MdePkg/Library/BaseLib/String.c | 28 ++--
>  1 file changed, 18 insertions(+), 10 deletions(-)
> 

Issues that have not been addressed by this patch set, but should be:

(1) the leading comment says, "Produce Null-terminated binary data in
the output buffer". That's bogus, the binary output is never
NUL-terminated (nor should it be).


(2) One of the RETURN_INVALID_PARAMETER cases is documented as:

"If SourceLength or DestinationSize is bigger than (MAX_ADDRESS
-(UINTN)Destination )."

There are two problems with this.


(2a) SourceLength has nothing to do with Destination. The comment should
be updated -- making sure that (Source + SourceLength) do not overflow
MAX_ADDRESS is worthwhile, but the comment is misleading.


(2b) The code that actually performs the check is off by one. What we
need is that the byte *one past* each buffer still be expressible as a
valid address, so mathematically we need

  (UINTN)Buffer + BufferLength <= MAX_ADDRESS

If you reorder this for a C expression that cannot overflow, you get

  BufferLength <= MAX_ADDRESS - (UINTN)Buffer

If you negate this, to express the failure condition, you get

  BufferLength > MAX_ADDRESS - (UINTN)Buffer

Therefore, the comment for RETURN_INVALID_PARAMETER that says

  DestinationSize is bigger than (MAX_ADDRESS -(UINTN)Destination)

is correct; *however*, the code is wrong:

  *DestinationSize >= (MAX_ADDRESS - (UINTN)Destination)

This failure condition is too lax (IOW, the success condition is too
strict), and shuld be restricted (IOW the success condition should be
relaxed).


(3) Maintaining a signed integer (INTN) BufferSize, and then doing
arithmetic on it with UINTN values, is really bad practice. In
particular, the following expression makes me nervous:

  BufferSize += ActualSourceLength / 4 * 3;

A separate UINTN variable called "EqualSigns" should be introduced,
BufferSize should be made an UINTN, and the logic should be reworked
using those.


(4) "DecodingTable" should be called "mDecodingTable".


(5) The decoding loop checks

  (SourceIndex < SourceLength) && (DestinationIndex < *DestinationSize)

and we have an inner loop

  do {
Chr = DecodingTable[(UINT8) Source[SourceIndex++]];
  } while (Chr == BAD_V);

Now consider the following case. The caller passes in a valid
(*DestinationSize) that is larger than what is requried for the
decoding. In addition, assume that the input data (Source), which is
otherwise completely valid, is terminated with a space character (or
even with a NUL character, although NUL-termination is not required by
the function's specification).

In the above situation, the innermost loop, which scans for BAD_V, will
fall off the end of Source. The outermost loop condition will evaluate
to TRUE (we have some Source characters left -- namely, one space, or
NUL), and we have room in the Destination buffer too (the caller
specified / allocated a larger DestinationSize thatn what is required).
So we reach the innermost loop, and the space character (BAD_V) will
lead it right off the end of Source.

The outermost loop condition should be changed.

First, the SourceIndex subcondition should be dropped altogether.

Second, *DestinationSize should be set to the actual decoded data size
*before* starting the actual decoding. Then, if we still have output
bytes to produce, in the outermost loop, the Source scanning in the
innermost BAD_V loop is guaranteed to remain in-bounds.


... Honestly, at this point, I sort of wish we just rewrote this
function from zero. The current *approach* of the function is wrong. The
function currently forms a mental image of how the input data "should"
look, and tries to parse that -- it tries to shoehorn the input into the
"expected" format. If the input does not look like the expectation, we
run into gaps here and there.

Instead, the function should follow a state machine approach, where the
outermost loop scans input characters one by one, and makes *absolutely
no assumption* about the character that has just been found. Every UINT8
character in the input should be checked against the full possible UINT8
domain (valid BASE64 range, the equal sign, tolerated whitespace, and
the rest), and acted upon accordingly.

For example, valid BASE64 characters should be accumulated into a 24-bit
value, and flushed when the latter becomes full, and also at the end of
the scanning loop.

Counting vs. decoding can be implemented 

[edk2-devel] [PATCH v2] OvmfPkg/XenBusDxe: Close XenIoProtocol openned by children

2019-07-01 Thread Anthony PERARD
In XenBusDxe, the XenBusAddDevice() opens the gXenIoProtocolGuid on
behalf of child controllers. It is never closed and prevents us from
uninstalling the protocol.

Close it where we stop all the children in XenBusDxe->Stop().

Signed-off-by: Anthony PERARD 
Reviewed-by: Laszlo Ersek 
---
 OvmfPkg/XenBusDxe/XenBusDxe.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.c b/OvmfPkg/XenBusDxe/XenBusDxe.c
index 0e63707f50..7c07a96650 100644
--- a/OvmfPkg/XenBusDxe/XenBusDxe.c
+++ b/OvmfPkg/XenBusDxe/XenBusDxe.c
@@ -453,6 +453,10 @@ XenBusDxeDriverBindingStop (
   continue;

 }

 

+Status = gBS->CloseProtocol (Dev->ControllerHandle, ,

+Dev->This->DriverBindingHandle, ChildData->Handle);

+ASSERT_EFI_ERROR (Status);

+

 Status = gBS->UninstallMultipleProtocolInterfaces (

ChildData->Handle,

, ChildData->DevicePath,

-- 
Anthony PERARD


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43115): https://edk2.groups.io/g/devel/message/43115
Mute This Topic: https://groups.io/mt/32270096/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] OvmfPkg/XenBusDxe: Close XenIoProtocol openned by childs

2019-07-01 Thread Anthony PERARD
On Sun, Jun 30, 2019 at 12:56:57PM +0200, Laszlo Ersek wrote:
> (5) Side remark (no need to do anything about it in the scope of this
> patch): I think the DisconnectController() call in
> XenBusDxeDriverBindingStop() is superfluous. That kind of disconnection
> is not the job of EFI_DRIVER_BINDING_PROTOCOL.Stop().

That sounds good and works fine without the call, I'll send a separate
patch.

-- 
Anthony PERARD

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43114): https://edk2.groups.io/g/devel/message/43114
Mute This Topic: https://groups.io/mt/32243460/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] May I become a contributor in EmulatorPkg ?

2019-07-01 Thread Bob Feng
For the second issue, you have to set the NASM_PREFIX to a path which ends with 
a slash.

For the first one, could you provide the steps to reproduce it?

Thanks,
Bob

From: Ni, Ray
Sent: Sunday, June 30, 2019 9:23 PM
To: Feng, Bob C 
Cc: 戴,曉政 ; Justen, Jordan L 
; af...@apple.com; devel@edk2.groups.io
Subject: RE: May I become a contributor in EmulatorPkg ?

Bob,
Any comments?


From: 戴,曉政 [mailto:cloud0...@yahoo.com.tw]
Sent: Sunday, June 30, 2019 3:37 PM
To: Justen, Jordan L 
mailto:jordan.l.jus...@intel.com>>; 
af...@apple.com; Ni, Ray 
mailto:ray...@intel.com>>
Subject: May I become a contributor in EmulatorPkg ?

Dears,

I live in Taiwan so please forgive my English pool. I download edk2 source code 
from Github recently and I encounter two build error when I build EmulatorPkg 
(I use Visual Studio 2017 ). First is in GenPcdDb.py, this error means 
parameter used to unpack is zero, please refer below :

[cid:image001.jpg@01D53037.EAE294F0]

Second is in tools_def.txt, this error means there is missing slash before 
nasm.exe, please refer below :

[cid:image002.jpg@01D53037.EAE294F0]

You can search “clouddai-test” in Attachment so that you will easy understand 
what I say. If I need submit more official document for become a contributor 
please let me know, or if my modification need obey some rule please also let 
me know, I am waiting your response

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43113): https://edk2.groups.io/g/devel/message/43113
Mute This Topic: https://groups.io/mt/32260944/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [Patch 1/1] BaseTools: Fixed the issue of the CFlag for compile PcdValueInit.c

2019-07-01 Thread Bob Feng
This issue happens when using Structured PCD.
Build tool use set to store the cflags for compile PcdValueInit.c,
that is the order of cflags is disorder.

This patch make -U, /U flags appear before -D, /D

Cc: Liming Gao 
Signed-off-by: Bob Feng 
---
 BaseTools/Source/Python/Workspace/DscBuildData.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 9f65ad54257d..985f8775259d 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -2666,11 +2666,12 @@ class DscBuildData(PlatformBuildClassObject):
 if len(ArchBuildOptions.keys()) == 1:
 BuildOptions['COMMON'] |= (list(ArchBuildOptions.values())[0])
 elif len(ArchBuildOptions.keys()) > 1:
 CommonBuildOptions = reduce(lambda x,y: x, 
ArchBuildOptions.values())
 BuildOptions['COMMON'] |= CommonBuildOptions
-ValueList = list(BuildOptions['COMMON'])
+ValueList = [item for item in BuildOptions['COMMON'] if 
item.startswith((r"/U","-U"))]
+ValueList.extend([item for item in BuildOptions['COMMON'] if 
item.startswith((r"/D", "-D"))])
 CC_FLAGS += " ".join(ValueList)
 MakeApp += CC_FLAGS
 
 if sys.platform == "win32":
 MakeApp = MakeApp + PcdMakefileEnd
-- 
2.20.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43112): https://edk2.groups.io/g/devel/message/43112
Mute This Topic: https://groups.io/mt/32269915/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Add HOST_APPLICATION module type.

2019-07-01 Thread Liming Gao
Xiaoyu:
  This is a new module type. Please submit BZ for INF spec update first. 

  And, also submit BZ for code change. In BZ, please specify this type usage 
model. 

Thanks
Liming
>-Original Message-
>From: Lu, XiaoyuX
>Sent: Monday, July 01, 2019 6:13 PM
>To: devel@edk2.groups.io
>Cc: Lu, XiaoyuX ; Feng, Bob C ;
>Gao, Liming ; Yao, Jiewen 
>Subject: [PATCH v1 1/1] BaseTools: Add HOST_APPLICATION module type.
>
>From: Jiewen Yao 
>
>It can be used to indicate a module can be build to run
>as OS application and run in OS environment.
>
>Cc: Bob Feng 
>Cc: Liming Gao 
>Cc: Jiewen Yao 
>Signed-off-by: Xiaoyu Lu 
>---
> BaseTools/Conf/build_rule.template|  2 +-
> BaseTools/Source/Python/AutoGen/AutoGen.py|  6 ++---
> BaseTools/Source/Python/AutoGen/GenC.py   | 23 ++-
> BaseTools/Source/Python/Common/DataType.py|  3 ++-
> BaseTools/Source/Python/GenFds/FdfParser.py   |  2 +-
> .../Source/Python/GenFds/FfsInfStatement.py   |  7 +++---
> .../Source/Python/Workspace/InfBuildData.py   |  2 +-
> .../Python/Workspace/WorkspaceCommon.py   |  5 ++--
> 8 files changed, 27 insertions(+), 23 deletions(-)
>
>diff --git a/BaseTools/Conf/build_rule.template
>b/BaseTools/Conf/build_rule.template
>index 030e74c35a65..db06d3a6b45a 100755
>--- a/BaseTools/Conf/build_rule.template
>+++ b/BaseTools/Conf/build_rule.template
>@@ -321,7 +321,7 @@
> "$(OBJCOPY)" $(OBJCOPY_FLAGS) ${dst}
>
>
>-[Static-Library-File.USER_DEFINED]
>+[Static-Library-File.USER_DEFINED, Static-Library-File.HOST_APPLICATION]
> 
> *.lib
>
>diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
>b/BaseTools/Source/Python/AutoGen/AutoGen.py
>index e8e09dc8a366..32b5a5564827 100644
>--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
>+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
>@@ -2831,7 +2831,7 @@ class ModuleAutoGen(AutoGen):
> # the type of build module is USER_DEFINED.
> # All different DEPEX section tags would be copied into 
> the As Built
>INF file
> # and there would be separate DEPEX section tags
>-if self.ModuleType.upper() == SUP_MODULE_USER_DEFINED:
>+if self.ModuleType.upper() == SUP_MODULE_USER_DEFINED or
>self.ModuleType.upper() == SUP_MODULE_HOST_APPLICATION:
> if (Arch.upper() == self.Arch.upper()) and
>(ModuleType.upper() != TAB_ARCH_COMMON):
> DepexList.append({(Arch, ModuleType): DepexExpr})
> else:
>@@ -2841,7 +2841,7 @@ class ModuleAutoGen(AutoGen):
> DepexList.append({(Arch, ModuleType): DepexExpr})
>
> #the type of build module is USER_DEFINED.
>-if self.ModuleType.upper() == SUP_MODULE_USER_DEFINED:
>+if self.ModuleType.upper() == SUP_MODULE_USER_DEFINED or
>self.ModuleType.upper() == SUP_MODULE_HOST_APPLICATION:
> for Depex in DepexList:
> for key in Depex:
> DepexStr += '[Depex.%s.%s]\n' % key
>@@ -4082,7 +4082,7 @@ class ModuleAutoGen(AutoGen):
>
> for ModuleType in self.DepexList:
> # Ignore empty [depex] section or [depex] section for
>SUP_MODULE_USER_DEFINED module
>-if len(self.DepexList[ModuleType]) == 0 or ModuleType ==
>SUP_MODULE_USER_DEFINED:
>+if len(self.DepexList[ModuleType]) == 0 or ModuleType ==
>SUP_MODULE_USER_DEFINED or ModuleType ==
>SUP_MODULE_HOST_APPLICATION:
> continue
>
> Dpx = GenDepex.DependencyExpression(self.DepexList[ModuleType],
>ModuleType, True)
>diff --git a/BaseTools/Source/Python/AutoGen/GenC.py
>b/BaseTools/Source/Python/AutoGen/GenC.py
>index b527295c0253..4cb776206e90 100644
>--- a/BaseTools/Source/Python/AutoGen/GenC.py
>+++ b/BaseTools/Source/Python/AutoGen/GenC.py
>@@ -776,7 +776,8 @@ gModuleTypeHeaderFile = {
> SUP_MODULE_SMM_CORE  :   ["PiDxe.h", "Library/BaseLib.h",
>"Library/DebugLib.h", "Library/UefiDriverEntryPoint.h"],
> SUP_MODULE_MM_STANDALONE :   ["PiMm.h", "Library/BaseLib.h",
>"Library/DebugLib.h", "Library/StandaloneMmDriverEntryPoint.h"],
> SUP_MODULE_MM_CORE_STANDALONE :  ["PiMm.h", "Library/BaseLib.h",
>"Library/DebugLib.h", "Library/StandaloneMmCoreEntryPoint.h"],
>-SUP_MODULE_USER_DEFINED  :   [gBasicHeaderFile,
>"Library/DebugLib.h"]
>+SUP_MODULE_USER_DEFINED  :   [gBasicHeaderFile,
>"Library/DebugLib.h"],
>+SUP_MODULE_HOST_APPLICATION  :   [gBasicHeaderFile,
>"Library/DebugLib.h"]
> }
>
> ## Autogen internal worker macro to define DynamicEx PCD name includes
>both the TokenSpaceGuidName
>@@ -1339,7 +1340,7 @@ def CreateLibraryConstructorCode(Info, AutoGenC,
>AutoGenH):
> if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:
>
>ConstructorPrototypeString.Append(gLibraryStructorPrototype[SUP_MODUL
>E_BASE].Replace(Dict))
>
>ConstructorCallingString.Append(gLibraryStructorCall[SUP_MODULE_BASE].R
>eplace(Dict))

[edk2-devel] [PATCH v1 1/1] BaseTools: Add HOST_APPLICATION module type.

2019-07-01 Thread Xiaoyu Lu
From: Jiewen Yao 

It can be used to indicate a module can be build to run
as OS application and run in OS environment.

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Jiewen Yao 
Signed-off-by: Xiaoyu Lu 
---
 BaseTools/Conf/build_rule.template|  2 +-
 BaseTools/Source/Python/AutoGen/AutoGen.py|  6 ++---
 BaseTools/Source/Python/AutoGen/GenC.py   | 23 ++-
 BaseTools/Source/Python/Common/DataType.py|  3 ++-
 BaseTools/Source/Python/GenFds/FdfParser.py   |  2 +-
 .../Source/Python/GenFds/FfsInfStatement.py   |  7 +++---
 .../Source/Python/Workspace/InfBuildData.py   |  2 +-
 .../Python/Workspace/WorkspaceCommon.py   |  5 ++--
 8 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/BaseTools/Conf/build_rule.template 
b/BaseTools/Conf/build_rule.template
index 030e74c35a65..db06d3a6b45a 100755
--- a/BaseTools/Conf/build_rule.template
+++ b/BaseTools/Conf/build_rule.template
@@ -321,7 +321,7 @@
 "$(OBJCOPY)" $(OBJCOPY_FLAGS) ${dst}
 
 
-[Static-Library-File.USER_DEFINED]
+[Static-Library-File.USER_DEFINED, Static-Library-File.HOST_APPLICATION]
 
 *.lib
 
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index e8e09dc8a366..32b5a5564827 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -2831,7 +2831,7 @@ class ModuleAutoGen(AutoGen):
 # the type of build module is USER_DEFINED.
 # All different DEPEX section tags would be copied into 
the As Built INF file
 # and there would be separate DEPEX section tags
-if self.ModuleType.upper() == SUP_MODULE_USER_DEFINED:
+if self.ModuleType.upper() == SUP_MODULE_USER_DEFINED or 
self.ModuleType.upper() == SUP_MODULE_HOST_APPLICATION:
 if (Arch.upper() == self.Arch.upper()) and 
(ModuleType.upper() != TAB_ARCH_COMMON):
 DepexList.append({(Arch, ModuleType): DepexExpr})
 else:
@@ -2841,7 +2841,7 @@ class ModuleAutoGen(AutoGen):
 DepexList.append({(Arch, ModuleType): DepexExpr})
 
 #the type of build module is USER_DEFINED.
-if self.ModuleType.upper() == SUP_MODULE_USER_DEFINED:
+if self.ModuleType.upper() == SUP_MODULE_USER_DEFINED or 
self.ModuleType.upper() == SUP_MODULE_HOST_APPLICATION:
 for Depex in DepexList:
 for key in Depex:
 DepexStr += '[Depex.%s.%s]\n' % key
@@ -4082,7 +4082,7 @@ class ModuleAutoGen(AutoGen):
 
 for ModuleType in self.DepexList:
 # Ignore empty [depex] section or [depex] section for 
SUP_MODULE_USER_DEFINED module
-if len(self.DepexList[ModuleType]) == 0 or ModuleType == 
SUP_MODULE_USER_DEFINED:
+if len(self.DepexList[ModuleType]) == 0 or ModuleType == 
SUP_MODULE_USER_DEFINED or ModuleType == SUP_MODULE_HOST_APPLICATION:
 continue
 
 Dpx = GenDepex.DependencyExpression(self.DepexList[ModuleType], 
ModuleType, True)
diff --git a/BaseTools/Source/Python/AutoGen/GenC.py 
b/BaseTools/Source/Python/AutoGen/GenC.py
index b527295c0253..4cb776206e90 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -776,7 +776,8 @@ gModuleTypeHeaderFile = {
 SUP_MODULE_SMM_CORE  :   ["PiDxe.h", "Library/BaseLib.h", 
"Library/DebugLib.h", "Library/UefiDriverEntryPoint.h"],
 SUP_MODULE_MM_STANDALONE :   ["PiMm.h", "Library/BaseLib.h", 
"Library/DebugLib.h", "Library/StandaloneMmDriverEntryPoint.h"],
 SUP_MODULE_MM_CORE_STANDALONE :  ["PiMm.h", "Library/BaseLib.h", 
"Library/DebugLib.h", "Library/StandaloneMmCoreEntryPoint.h"],
-SUP_MODULE_USER_DEFINED  :   [gBasicHeaderFile, "Library/DebugLib.h"]
+SUP_MODULE_USER_DEFINED  :   [gBasicHeaderFile, "Library/DebugLib.h"],
+SUP_MODULE_HOST_APPLICATION  :   [gBasicHeaderFile, "Library/DebugLib.h"]
 }
 
 ## Autogen internal worker macro to define DynamicEx PCD name includes both 
the TokenSpaceGuidName
@@ -1339,7 +1340,7 @@ def CreateLibraryConstructorCode(Info, AutoGenC, 
AutoGenH):
 if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:
 
ConstructorPrototypeString.Append(gLibraryStructorPrototype[SUP_MODULE_BASE].Replace(Dict))
 
ConstructorCallingString.Append(gLibraryStructorCall[SUP_MODULE_BASE].Replace(Dict))
-if Info.ModuleType not in [SUP_MODULE_BASE, SUP_MODULE_USER_DEFINED]:
+if Info.ModuleType not in [SUP_MODULE_BASE, SUP_MODULE_USER_DEFINED, 
SUP_MODULE_HOST_APPLICATION]:
 if Lib.ModuleType in SUP_MODULE_SET_PEI:
 
ConstructorPrototypeString.Append(gLibraryStructorPrototype['PEI'].Replace(Dict))
 
ConstructorCallingString.Append(gLibraryStructorCall['PEI'].Replace(Dict))
@@ -1368,7 +1369,7 @@ def 

Re: [edk2-devel] [PATCH 3/3] MdePkg/BaseLib: Base64Decode: Add decription for RETURN_SUCCESS

2019-07-01 Thread Laszlo Ersek
On 06/28/19 05:57, Gao, Zhichao wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1891
> 
> While the convertion Base64 ascii string is null string (the
> string only contain white space would be regard as null string),
> there would be no decodeable data. Set *DestinationSize to zero
> and return RETURN_SUCCESS. But it is not mention in the comment
> of the function. So add this decription.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Laszlo Ersek 
> Signed-off-by: Zhichao Gao 
> ---
>  MdePkg/Library/BaseLib/String.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c
> index 7ebc2ecddd..8829d2cbbf 100644
> --- a/MdePkg/Library/BaseLib/String.c
> +++ b/MdePkg/Library/BaseLib/String.c
> @@ -1929,7 +1929,8 @@ Base64Encode (
>@param DestinationSize   Caller is responsible for passing in buffer of at 
> least DestinationSize.
> Set 0 to get the size needed. Set to bytes stored 
> on return.
>  
> -  @retval RETURN_SUCCESS When binary buffer is filled in.
> +  @retval RETURN_SUCCESS When binary buffer is filled in. Or if 
> the Base64 ascii string is empty, set
> + *DestinationSize to zero to indicate 
> this case.
>@retval RETURN_INVALID_PARAMETER   If Source is NULL or DestinationSize is 
> NULL.
>@retval RETURN_INVALID_PARAMETER   If SourceLength or DestinationSize is 
> bigger than (MAX_ADDRESS -(UINTN)Destination ).
>@retval RETURN_INVALID_PARAMETER   If there is any invalid character in 
> input stream.
> 

The new documentation points in the right direction, but it's not
entirely correct. The right language is, "if Source decodes to zero
output characters".

Thanks
Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43108): https://edk2.groups.io/g/devel/message/43108
Mute This Topic: https://groups.io/mt/32238990/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 1/3] MdePkg/BaseLib: Adjust the coding style in Base64Decode

2019-07-01 Thread Laszlo Ersek
On 06/28/19 05:57, Gao, Zhichao wrote:
> Adjust the code style for better view.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Signed-off-by: Zhichao Gao 
> ---
>  MdePkg/Library/BaseLib/String.c | 12 +---
>  1 file changed, 5 insertions(+), 7 deletions(-)

Sorry about sending individual emails about coding style problems. This code is 
quite rich in surprises. I'm not quoting any part of the patch because the line 
I'm about to highlight is not part of the context.

We have this line

if ((Chr != ' ') &&(Chr != '\t') &&(Chr != '\n') &&(Chr != '\r')) {

A space character is missing after each of the && operators.

Thanks
Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43109): https://edk2.groups.io/g/devel/message/43109
Mute This Topic: https://groups.io/mt/32238988/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 1/3] MdePkg/BaseLib: Adjust the coding style in Base64Decode

2019-07-01 Thread Laszlo Ersek
I have to revise my previous R-b for this patch. The patch is not wrong,
but it's not complete:

On 06/28/19 05:57, Gao, Zhichao wrote:
> Adjust the code style for better view.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Signed-off-by: Zhichao Gao 
> ---
>  MdePkg/Library/BaseLib/String.c | 12 +---
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c
> index 32e189791c..b86e7e9436 100644
> --- a/MdePkg/Library/BaseLib/String.c
> +++ b/MdePkg/Library/BaseLib/String.c
> @@ -1993,8 +1993,7 @@ Base64Decode (
>if (BufferSize < -2) {
>  return RETURN_INVALID_PARAMETER;
>}
> -}
> -else {
> +} else {
>Chr = Source[SourceIndex];
>if (BAD_V != DecodingTable[(UINT8) Chr]) {
>  
> @@ -2006,8 +2005,7 @@ Base64Decode (
>return RETURN_INVALID_PARAMETER;
>  }
>ActualSourceLength++;

The line above remains incorrectly indented.

Thanks
Laszlo

> -  }
> -else {
> +  } else {
>  
>  //
>  // The reset of the decoder will ignore all invalid characters 
> allowed here.
> @@ -2029,8 +2027,8 @@ Base64Decode (
>}
>  
>BufferSize += ActualSourceLength / 4 * 3;
> -if (BufferSize < 0) {
> -  return RETURN_INVALID_PARAMETER;
> +  if (BufferSize < 0) {
> +return RETURN_INVALID_PARAMETER;
>}
>  
>//
> @@ -2061,7 +2059,7 @@ Base64Decode (
>  //
>  for (Index = 0; Index < 4; Index++) {
>do {
> -  Chr = DecodingTable[(UINT8) Source[SourceIndex++]];
> +Chr = DecodingTable[(UINT8) Source[SourceIndex++]];
>} while (Chr == BAD_V);
>Value <<= 6;
>Value |= (UINT32)Chr;
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43107): https://edk2.groups.io/g/devel/message/43107
Mute This Topic: https://groups.io/mt/32238988/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] PciBusDxe: duplicate node insertion for every PPB device in the system

2019-07-01 Thread Wu, Hao A
> -Original Message-
> From: Wu, Hao A
> Sent: Tuesday, June 18, 2019 10:28 AM
> To: devel@edk2.groups.io; Wu, Hao A; Ni, Ray; Javeed, Ashraf
> Cc: Wang, Jian J
> Subject: RE: [edk2-devel] [PATCH] PciBusDxe: duplicate node insertion for
> every PPB device in the system
> 
> > -Original Message-
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > Wu, Hao A
> > Sent: Tuesday, June 18, 2019 10:24 AM
> > To: devel@edk2.groups.io; Ni, Ray; Javeed, Ashraf
> > Cc: Wang, Jian J
> > Subject: Re: [edk2-devel] [PATCH] PciBusDxe: duplicate node insertion for
> > every PPB device in the system
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf
> Of
> > Ni,
> > > Ray
> > > Sent: Monday, June 17, 2019 5:49 PM
> > > To: Javeed, Ashraf; devel@edk2.groups.io
> > > Cc: Wang, Jian J
> > > Subject: Re: [edk2-devel] [PATCH] PciBusDxe: duplicate node insertion
> for
> > > every PPB device in the system
> > >
> > > Reviewed-by: Ray Ni 
> >
> > Hello all,
> >
> > I did not see the origin patch being sent to the mailing list.
> > Maybe Ashraf has not subscribed the mailing list?
> 
> Sorry, saw it at:
> https://edk2.groups.io/g/devel/message/41418
> 
> Acked-by: Hao A Wu 


Pushed via commit 2603fce126.

Best Regards,
Hao Wu


> 
> Best Regards,
> Hao Wu
> 
> >
> > Best Regards,
> > Hao Wu
> >
> > >
> > > > -Original Message-
> > > > From: Javeed, Ashraf
> > > > Sent: Monday, May 27, 2019 6:24 PM
> > > > To: devel@edk2.groups.io
> > > > Cc: Javeed, Ashraf ; Wang, Jian J
> > > > ; Ni, Ray 
> > > > Subject: [PATCH] PciBusDxe: duplicate node insertion for every PPB
> > device
> > > in
> > > > the system
> > > >
> > > > https://bugzilla.tianocore.org/show_bug.cgi?id=1796
> > > > Bug fixed in PciBusDxe\PciLib.c.
> > > > Removed the redundant second call to PciSearchDevice sub-routine
> > when
> > > > the PCD for the Hot-Plug support is disabled.
> > > >
> > > > Signed-off-by: Ashraf Javeed 
> > > > Cc: Jian J Wang 
> > > > Cc: Ray Ni 
> > > > ---
> > > >  MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c | 19 +--
> > > >  1 file changed, 1 insertion(+), 18 deletions(-)
> > > >
> > > > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c
> > > > b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c
> > > > index f0d9f45c4a..5b55fb5d3b 100644
> > > > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c
> > > > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c
> > > > @@ -1114,24 +1114,7 @@ PciScanBus (
> > > >  //
> > > >  // For PPB
> > > >  //
> > > > -if (!FeaturePcdGet (PcdPciBusHotplugDeviceSupport)) {
> > > > -  //
> > > > -  // If Hot Plug is not supported,
> > > > -  // get the bridge information
> > > > -  //
> > > > -  Status = PciSearchDevice (
> > > > -Bridge,
> > > > -,
> > > > -StartBusNumber,
> > > > -Device,
> > > > -Func,
> > > > -
> > > > -);
> > > > -
> > > > -  if (EFI_ERROR (Status)) {
> > > > -return Status;
> > > > -  }
> > > > -} else {
> > > > +if (FeaturePcdGet (PcdPciBusHotplugDeviceSupport)) {
> > > >//
> > > >// If Hot Plug is supported,
> > > >// Get the bridge information
> > > > --
> > > > 2.21.0.windows.1
> > >
> > >
> > >
> >
> >
> > 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43105): https://edk2.groups.io/g/devel/message/43105
Mute This Topic: https://groups.io/mt/31810004/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v2] IntelFsp2Pkg: FSP Python scripts to support 3.x.

2019-07-01 Thread Zeng, Star
Reviewed-by: Star Zeng .

Thanks,
Star
-Original Message-
From: Chiu, Chasel 
Sent: Monday, July 1, 2019 2:20 PM
To: devel@edk2.groups.io
Cc: Ma, Maurice ; Desimone, Nathaniel L 
; Zeng, Star 
Subject: [PATCH v2] IntelFsp2Pkg: FSP Python scripts to support 3.x.

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

Updated FSP Python scripts to support both 2.x and 3.x.

Test:
  . Verified with Python 2.7.12 and 3.6.6.
  . Verified tool result is the same before the change.
  . Both py -2 and py -3 built binary can boot.

Cc: Maurice Ma 
Cc: Nate DeSimone 
Cc: Star Zeng 
Signed-off-by: Chasel Chiu 
---
 IntelFsp2Pkg/Tools/GenCfgOpt.py   | 61 
+++--
 IntelFsp2Pkg/Tools/PatchFv.py | 36 +++-
 IntelFsp2Pkg/Tools/SplitFspBin.py | 74 
+++---
 3 files changed, 109 insertions(+), 62 deletions(-)

diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt.py 
index 450c4e3eb9..c4e1e6239d 100644
--- a/IntelFsp2Pkg/Tools/GenCfgOpt.py
+++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py
@@ -1,6 +1,6 @@
 ## @ GenCfgOpt.py
 #
-# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2014 - 2019, Intel Corporation. All rights 
+reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ## @@ -10,6 +10,7 @@ import 
re  import sys  import struct
 from   datetime import date
+from functools import reduce
 
 # Generated file copyright header
 
@@ -90,11 +91,11 @@ class CLogicalExpression:
 self.string   = ''
 
 def errExit(self, err = ''):
-print "ERROR: Express parsing for:"
-print "   %s" % self.string
-print "   %s^" % (' ' * self.index)
+print ("ERROR: Express parsing for:")
+print ("   %s" % self.string)
+print ("   %s^" % (' ' * self.index))
 if err:
-print "INFO : %s" % err
+print ("INFO : %s" % err)
 raise SystemExit
 
 def getNonNumber (self, n1, n2):
@@ -338,15 +339,15 @@ EndList
 else:
 Error = 0
 if self.Debug:
-print "INFO : Macro dictionary:"
+print ("INFO : Macro dictionary:")
 for Each in self._MacroDict:
-print "   $(%s) = [ %s ]" % (Each , 
self._MacroDict[Each])
+print ("   $(%s) = [ %s ]" % (Each , 
self._MacroDict[Each]))
 return Error
 
 def EvaulateIfdef   (self, Macro):
 Result = Macro in self._MacroDict
 if self.Debug:
-print "INFO : Eval Ifdef [%s] : %s" % (Macro, Result)
+print ("INFO : Eval Ifdef [%s] : %s" % (Macro, Result))
 return  Result
 
 def ExpandMacros (self, Input):
@@ -359,7 +360,7 @@ EndList
   Line = Line.replace(Each, self._MacroDict[Variable])
   else:
   if self.Debug:
-  print "WARN : %s is not defined" % Each
+  print ("WARN : %s is not defined" % Each)
   Line = Line.replace(Each, Each[2:-1])
 return Line
 
@@ -372,7 +373,7 @@ EndList
   Line = Line.replace(PcdName, self._PcdsDict[PcdName])
   else:
   if self.Debug:
-  print "WARN : %s is not defined" % PcdName
+  print ("WARN : %s is not defined" % PcdName)
 return Line
 
 def EvaluateExpress (self, Expr):
@@ -381,7 +382,7 @@ EndList
 LogExpr = CLogicalExpression()
 Result  = LogExpr.evaluateExpress (ExpExpr)
 if self.Debug:
-print "INFO : Eval Express [%s] : %s" % (Expr, Result)
+print ("INFO : Eval Express [%s] : %s" % (Expr, Result))
 return Result
 
 def FormatListValue(self, ConfigDict):
@@ -406,7 +407,7 @@ EndList
 bytearray = []
 for each in dataarray:
 value = each
-for loop in xrange(unit):
+for loop in range(int(unit)):
 bytearray.append("0x%02X" % (value & 0xFF))
 value = value >> 8
 newvalue  = '{'  + ','.join(bytearray) + '}'
@@ -548,7 +549,7 @@ EndList
 if Match:
 self._MacroDict[Match.group(1)] = Match.group(2)
 if self.Debug:
-print "INFO : DEFINE %s = [ %s ]" % (Match.group(1), 
Match.group(2))
+print ("INFO : DEFINE %s = [ %s ]" % 
+ (Match.group(1), Match.group(2)))
 elif IsPcdSect:
 #gSiPkgTokenSpaceGuid.PcdTxtEnable|FALSE
 #gSiPkgTokenSpaceGuid.PcdOverclockEnable|TRUE
@@ -556,7 +557,7 @@ EndList
 if Match:
 self._PcdsDict[Match.group(1)] = Match.group(2)
 if self.Debug:
-print "INFO : PCD %s = [ %s ]" % (Match.group(1), 

Re: [edk2-devel] [PATCH v1 1/4] ShellPkg: acpiview: Improve PPTT table field validation

2019-07-01 Thread Krzysztof Koch
Hi Zhichao,

Thank you for the review. You can see my responses in line with your comments 
marked with [Krzysztof]

Kind regards,

Krzysztof

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Gao, Zhichao via 
Groups.Io
Sent: Monday, July 1, 2019 4:49
To: Krzysztof Koch ; devel@edk2.groups.io
Cc: Carsey, Jaben ; Ni, Ray ; Sami 
Mujawar ; Matteo Carlini ; nd 

Subject: Re: [edk2-devel] [PATCH v1 1/4] ShellPkg: acpiview: Improve PPTT table 
field validation

Minor comment on ValidateCacheAssociativity:

> -Original Message-
> From: Krzysztof Koch [mailto:krzysztof.k...@arm.com]
> Sent: Friday, June 28, 2019 6:25 PM
> To: devel@edk2.groups.io
> Cc: Carsey, Jaben ; Ni, Ray 
> ; Gao, Zhichao ; 
> sami.muja...@arm.com; matteo.carl...@arm.com; n...@arm.com
> Subject: [PATCH v1 1/4] ShellPkg: acpiview: Improve PPTT table field 
> validation
> 
> Add Cache Structure (Type 1) 'Number of sets' and 'Associativity'
> field validation in the acpiview Processor Properties Topology Table 
> (PPTT) parser.
> 
> Replace literal values with precompiler macros for existing Cache 
> Structure validation functions.
> 
> Signed-off-by: Krzysztof Koch 
> ---
> 
> Changes can be seen at:
> https://github.com/KrzysztofKoch1/edk2/commit/014f98b8f1ba29607d8d46
> 5cac779badc3c79982
> 
> Notes:
> v1:
> - Use macros to define constant values used for validation [Krzysztof]
> - Add two new PPTT Type 1 structure validation functions 
> [Krzysztof]
> 
>
> ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c
> | 102 ++--
> ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.h
> |  38 
>  2 files changed, 130 insertions(+), 10 deletions(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> c
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> c
> index
> 71b6e7ae7c727ee0ea12f74e60c27c4c46e05872..cec57be55e77096f9448f637e
> a129af2b42111ad 100644
> ---
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> c
> +++
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttPars
> +++ er.c
> @@ -5,12 +5,15 @@
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>@par Reference(s):
> -- ACPI 6.2 Specification - Errata A, September 2017
> +- ACPI 6.3 Specification - January 2019
> +- ARM Architecture Reference Manual ARMv8 (D.a)
>  **/
> 
>  #include 
>  #include 
>  #include "AcpiParser.h"
> +#include "AcpiView.h"
> +#include "PpttParser.h"
> 
>  // Local variables
>  STATIC CONST UINT8*  ProcessorTopologyStructureType; @@ -19,11 +22,80 
> @@ STATIC CONST UINT32* NumberOfPrivateResources;  STATIC 
> ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
> 
>  /**
> -  An ACPI_PARSER array describing the ACPI PPTT Table.
> +  This function validates the Cache Type Structure (Type 1) 'Number of sets'
> +  field.
> +
> +  @param [in] Ptr   Pointer to the start of the field data.
> +  @param [in] Context   Pointer to context specific information e.g. this
> +could be a pointer to the ACPI table header.
>  **/
> -STATIC CONST ACPI_PARSER PpttParser[] = {
> -  PARSE_ACPI_HEADER ()
> -};
> +STATIC
> +VOID
> +EFIAPI
> +ValidateCacheNumberOfSets (
> +  IN UINT8* Ptr,
> +  IN VOID*  Context
> +  )
> +{
> +  UINT32 NumberOfSets;
> +  NumberOfSets = *(UINT32*)Ptr;
> +
> +  if (NumberOfSets == 0) {
> +IncrementErrorCount ();
> +Print (L"\nERROR: Cache number of sets must be greater than 0");
> +return;
> +  }
> +
> +#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
> +  if (NumberOfSets > PPTT_ARM_CCIDX_CACHE_NUMBER_OF_SETS_MAX)
> {
> +IncrementErrorCount ();
> +Print (
> +  L"\nERROR: When ARMv8.3-CCIDX is implemented the maximum cache
> number of "
> +L"sets must be less than or equal to %d",
> +  PPTT_ARM_CCIDX_CACHE_NUMBER_OF_SETS_MAX
> +  );
> +return;
> +  }
> +
> +  if (NumberOfSets > PPTT_ARM_CACHE_NUMBER_OF_SETS_MAX) {
> +IncrementWarningCount ();
> +Print (
> +  L"\nWARNING: Without ARMv8.3-CCIDX, the maximum cache number
> of sets "
> +L"must be less than or equal to %d. Ignore this message if "
> +L"ARMv8.3-CCIDX is implemented",
> +  PPTT_ARM_CACHE_NUMBER_OF_SETS_MAX
> +  );
> +return;
> +  }
> +#endif
> +
> +}
> +
> +/**
> +  This function validates the Cache Type Structure (Type 1) 'Associativity'
> +  field.
> +
> +  @param [in] Ptr   Pointer to the start of the field data.
> +  @param [in] Context   Pointer to context specific information e.g. this
> +could be a pointer to the ACPI table header.
> +**/
> +STATIC
> +VOID
> +EFIAPI
> +ValidateCacheAssociativity (
> +  IN UINT8* Ptr,
> +  IN VOID*  Context
> +  )
> +{
> +  UINT8 Associativity;
> +  Associativity = *(UINT8*)Ptr;
> +
> +  if (Associativity == 0) {
> +IncrementErrorCount ();
> +Print (L"\nERROR: Cache associativity must be greater than 0");

[edk2-devel] [PATCH] Silicon/Tools: Replace white spaces with tabs in GNUmakefile

2019-07-01 Thread Zhang, Shenglei
The tools can't be complied successfully because of the white spaces
in GNUmakefile. So replace them with tabs.

Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Shenglei Zhang 
---
 Silicon/Intel/Tools/GNUmakefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Silicon/Intel/Tools/GNUmakefile b/Silicon/Intel/Tools/GNUmakefile
index 20abf148b5..6910b6ad0f 100644
--- a/Silicon/Intel/Tools/GNUmakefile
+++ b/Silicon/Intel/Tools/GNUmakefile
@@ -18,11 +18,11 @@ $(APPLICATIONS): $(MAKEROOT)/bin
 .PHONY: subdirs $(SUBDIRS)
 subdirs: $(SUBDIRS)
 $(SUBDIRS):
-$(MAKE) -C $@
+   $(MAKE) -C $@
 
 .PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
 $(patsubst %,%-clean,$(sort $(SUBDIRS))):
--$(MAKE) -C $(@:-clean=) clean
+   -$(MAKE) -C $(@:-clean=) clean
 
 clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
 
-- 
2.18.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43102): https://edk2.groups.io/g/devel/message/43102
Mute This Topic: https://groups.io/mt/32269137/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2] IntelFsp2Pkg: FSP Python scripts to support 3.x.

2019-07-01 Thread Chiu, Chasel
https://bugzilla.tianocore.org/show_bug.cgi?id=1930

Updated FSP Python scripts to support both 2.x and
3.x.

Test:
  . Verified with Python 2.7.12 and 3.6.6.
  . Verified tool result is the same before the change.
  . Both py -2 and py -3 built binary can boot.

Cc: Maurice Ma 
Cc: Nate DeSimone 
Cc: Star Zeng 
Signed-off-by: Chasel Chiu 
---
 IntelFsp2Pkg/Tools/GenCfgOpt.py   | 61 
+++--
 IntelFsp2Pkg/Tools/PatchFv.py | 36 +++-
 IntelFsp2Pkg/Tools/SplitFspBin.py | 74 
+++---
 3 files changed, 109 insertions(+), 62 deletions(-)

diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt.py
index 450c4e3eb9..c4e1e6239d 100644
--- a/IntelFsp2Pkg/Tools/GenCfgOpt.py
+++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py
@@ -1,6 +1,6 @@
 ## @ GenCfgOpt.py
 #
-# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -10,6 +10,7 @@ import re
 import sys
 import struct
 from   datetime import date
+from functools import reduce
 
 # Generated file copyright header
 
@@ -90,11 +91,11 @@ class CLogicalExpression:
 self.string   = ''
 
 def errExit(self, err = ''):
-print "ERROR: Express parsing for:"
-print "   %s" % self.string
-print "   %s^" % (' ' * self.index)
+print ("ERROR: Express parsing for:")
+print ("   %s" % self.string)
+print ("   %s^" % (' ' * self.index))
 if err:
-print "INFO : %s" % err
+print ("INFO : %s" % err)
 raise SystemExit
 
 def getNonNumber (self, n1, n2):
@@ -338,15 +339,15 @@ EndList
 else:
 Error = 0
 if self.Debug:
-print "INFO : Macro dictionary:"
+print ("INFO : Macro dictionary:")
 for Each in self._MacroDict:
-print "   $(%s) = [ %s ]" % (Each , 
self._MacroDict[Each])
+print ("   $(%s) = [ %s ]" % (Each , 
self._MacroDict[Each]))
 return Error
 
 def EvaulateIfdef   (self, Macro):
 Result = Macro in self._MacroDict
 if self.Debug:
-print "INFO : Eval Ifdef [%s] : %s" % (Macro, Result)
+print ("INFO : Eval Ifdef [%s] : %s" % (Macro, Result))
 return  Result
 
 def ExpandMacros (self, Input):
@@ -359,7 +360,7 @@ EndList
   Line = Line.replace(Each, self._MacroDict[Variable])
   else:
   if self.Debug:
-  print "WARN : %s is not defined" % Each
+  print ("WARN : %s is not defined" % Each)
   Line = Line.replace(Each, Each[2:-1])
 return Line
 
@@ -372,7 +373,7 @@ EndList
   Line = Line.replace(PcdName, self._PcdsDict[PcdName])
   else:
   if self.Debug:
-  print "WARN : %s is not defined" % PcdName
+  print ("WARN : %s is not defined" % PcdName)
 return Line
 
 def EvaluateExpress (self, Expr):
@@ -381,7 +382,7 @@ EndList
 LogExpr = CLogicalExpression()
 Result  = LogExpr.evaluateExpress (ExpExpr)
 if self.Debug:
-print "INFO : Eval Express [%s] : %s" % (Expr, Result)
+print ("INFO : Eval Express [%s] : %s" % (Expr, Result))
 return Result
 
 def FormatListValue(self, ConfigDict):
@@ -406,7 +407,7 @@ EndList
 bytearray = []
 for each in dataarray:
 value = each
-for loop in xrange(unit):
+for loop in range(int(unit)):
 bytearray.append("0x%02X" % (value & 0xFF))
 value = value >> 8
 newvalue  = '{'  + ','.join(bytearray) + '}'
@@ -548,7 +549,7 @@ EndList
 if Match:
 self._MacroDict[Match.group(1)] = Match.group(2)
 if self.Debug:
-print "INFO : DEFINE %s = [ %s ]" % (Match.group(1), 
Match.group(2))
+print ("INFO : DEFINE %s = [ %s ]" % (Match.group(1), 
Match.group(2)))
 elif IsPcdSect:
 #gSiPkgTokenSpaceGuid.PcdTxtEnable|FALSE
 #gSiPkgTokenSpaceGuid.PcdOverclockEnable|TRUE
@@ -556,7 +557,7 @@ EndList
 if Match:
 self._PcdsDict[Match.group(1)] = Match.group(2)
 if self.Debug:
-print "INFO : PCD %s = [ %s ]" % (Match.group(1), 
Match.group(2))
+print ("INFO : PCD %s = [ %s ]" % (Match.group(1), 
Match.group(2)))
 i = 0
 while i < len(BuildOptionPcd):
 Match = re.match("\s*([\w\.]+)\s*\=\s*(\w+)", 
BuildOptionPcd[i])
@@ 

[edk2-devel] [PATCH v2] MinPlatformPkg: FSP Python script to python 3.x.

2019-07-01 Thread Chiu, Chasel
https://bugzilla.tianocore.org/show_bug.cgi?id=1930

Updated FSP Python script to support both 2.x and
3.x.

Test:
  . Verified with Python 2.7.12 and 3.6.6.
  . Verified tool result is the same before the change.
  . Both py -2 and py -3 built binary can boot.

Cc: Michael Kubacki 
Cc: Nate DeSimone 
Cc: Liming Gao 
Signed-off-by: Chasel Chiu 
---
 Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py | 
34 +-
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git 
a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py 
b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py
index 167a0e0a4c..406e5ec130 100644
--- a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py
+++ b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py
@@ -10,16 +10,16 @@ import re
 import subprocess
 
 if len(sys.argv) not in [6,7]:
-  print "RebaseAndPatchFspBinBaseAddress.py - Error in number of arguments 
received"
-  print "Usage - RebaseAndPatchFspBinBaseAddress.py  
 \
-"
+  print ("RebaseAndPatchFspBinBaseAddress.py - Error in number of arguments 
received")
+  print ("Usage - RebaseAndPatchFspBinBaseAddress.py  
 \
+")
   exit(1)
 
 flashMapName  = sys.argv[1]
 fspBinPath= sys.argv[2]
 fspBinFile= sys.argv[3]
 targetDscFile = sys.argv[4]
-fvOffset  = long(sys.argv[5], 16)
+fvOffset  = int(sys.argv[5], 16)
 fspBinFileRebased = "Fsp_Rebased.fd"
 splitFspBinPath   = 
os.path.join("edk2","IntelFsp2Pkg","Tools","SplitFspBin.py")
 
@@ -30,21 +30,21 @@ if len(sys.argv) == 7:
 # Make sure argument passed or valid
 #
 if not os.path.exists(flashMapName):
-  print "WARNING!  " + str(flashMapName) + " is not found."
+  print ("WARNING!  " + str(flashMapName) + " is not found.")
   exit(1)
 fspBinFilePath = fspBinPath + os.sep + fspBinFile
 if not os.path.exists(fspBinFilePath):
-  print "WARNING!  " + str(fspBinFilePath) + " is not found."
+  print ("WARNING!  " + str(fspBinFilePath) + " is not found.")
   exit(1)
 if not os.path.exists(targetDscFile):
-  print "WARNING!  " + str(targetDscFile) + " is not found."
+  print ("WARNING!  " + str(targetDscFile) + " is not found.")
   exit(1)
 ext_file = str(os.path.splitext(targetDscFile)[-1]).lower()
 if ext_file != ".dsc":
-  print "WARNING!  " + str(targetDscFile) + " is not a dsc file"
+  print ("WARNING!  " + str(targetDscFile) + " is not a dsc file")
   exit(1)
 if not os.path.exists(splitFspBinPath):
-  print "WARNING!  " + str(splitFspBinPath) + " is not found."
+  print ("WARNING!  " + str(splitFspBinPath) + " is not found.")
   exit(1)
 
 #
@@ -54,7 +54,7 @@ file = open (flashMapName, "r")
 data = file.read ()
 
 # Get the Flash Base Address
-flashBase = long(data.split("FLASH_BASE")[1].split("=")[1].split()[0], 16)
+flashBase = int(data.split("FLASH_BASE")[1].split("=")[1].split()[0], 16)
 
 # Based on Build Target, select the section in the FlashMap file
 flashmap = data
@@ -62,11 +62,11 @@ flashmap = data
 # Get FSP-S & FSP-M & FSP-T offset & calculate the base
 for line in flashmap.split("\n"):
   if "PcdFlashFvFspSOffset" in line:
-fspSBaseOffset = long(line.split("=")[1].split()[0], 16)
+fspSBaseOffset = int(line.split("=")[1].split()[0], 16)
   if "PcdFlashFvFspMOffset" in line:
-fspMBaseOffset = long(line.split("=")[1].split()[0], 16)
+fspMBaseOffset = int(line.split("=")[1].split()[0], 16)
   if "PcdFlashFvFspTOffset" in line:
-fspTBaseOffset = long(line.split("=")[1].split()[0], 16)
+fspTBaseOffset = int(line.split("=")[1].split()[0], 16)
 file.close()
 
 #
@@ -78,10 +78,10 @@ if 'PYTHON_HOME' in os.environ:
 pythontool = os.environ['PYTHON_HOME'] + os.sep + 'python'
 Process = subprocess.Popen([pythontool, splitFspBinPath, 
"info","-f",fspBinFilePath], stdout=subprocess.PIPE)
 Output = Process.communicate()[0]
-FsptInfo = Output.rsplit("FSP_M", 1);
-for line in FsptInfo[1].split("\n"):
-  if "ImageSize" in line:
-fspMSize = long(line.split("=")[1], 16)
+FsptInfo = Output.rsplit(b"FSP_M", 1);
+for line in FsptInfo[1].split(b"\n"):
+  if b"ImageSize" in line:
+fspMSize = int(line.split(b"=")[1], 16)
 break
 
 # Calculate FSP-S/M/T base address, to which re-base has to be done
-- 
2.13.3.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43100): https://edk2.groups.io/g/devel/message/43100
Mute This Topic: https://groups.io/mt/32268933/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-