Re: [edk2-devel] [PATCH V2 00/10] Multiple Controllers Support solution

2019-08-11 Thread Liming Gao
Eric:
  Can you list the difference compared to version 1?

Thanks
Liming
>-Original Message-
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Eric
>Jin
>Sent: Monday, August 12, 2019 9:46 AM
>To: devel@edk2.groups.io
>Subject: [edk2-devel] [PATCH V2 00/10] Multiple Controllers Support solution
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525
>
>The patch set is to support drivers that manage multiple controllers and
>also provide a firmware update capability to each managed controller.
>
>The following modules are related to Multiple Controllers Support solution
>
>FmpDevicePkg\FmpDxe\FmpDxe.inf - Driver to manage multiple controllers
>and provide
>the firmware update capability to each managed controller.
>FmpDevicePkg\CapsuleUpdatePolicyDxe\CapsuleUpdatePolicyDxe.inf - Driver
>to produce
>the Capsule Update Policy Protocol using the services of the
>CapsuleUpdatePolicyLib
>class. The protocol is a private interface to the FmpDevicePkg
>FmpDevicePkg\Library\CapsuleUpdatePolicyLibOnProtocol\CapsuleUpdatePo
>licyLibOnProtocol.inf -
>CapsuleUpdatePolicyLib instance that uses the services of the Capsule Update
>Policy
>Protocol produced by CapsuleUpdatePolicyDxe
>FmpDevicePkg\Library\CapsuleUpdatePolicyLibNull\CapsuleUpdatePolicyLibN
>ull.inf -
>Null CapsuleUpdatePolicyLib instance and the template for platform specific
>implementation
>FmpDevicePkg\Library\FmpDeviceLibNull\FmpDeviceLibNull.inf - Null
>FmpDeviceLib
>instance and the template for platform specific implementation
>
>Eric Jin (10):
>  FmpDevicePkg: Add UEFI_DRIVER support
>  FmpDevicePkg: Add APIs to FmpDeviceLib
>  FmpDEvicePkg/FmpDeviceLibNull: Implement new APIs
>  FmpDevicePkg/FmpDxe: Use new FmpDeviceLib APIs
>  FmpDevicePkg/FmpDxe: Different variable for each FMP Descriptor
>  FmpDevicePkg: Add Capsule Update Policy Protocol
>  FmpDevicePkg/FmpDxe: Improve all DEBUG() messages
>  FmpDevicePkg/FmpDxe: Add PcdFmpDeviceImageTypeIdGuid
>  FmpDevicePkg/FmpDxe: Add PcdFmpDeviceStorageAccessEnable
>  FmpDevicePkg/FmpDxe: Remove use of CatSprint()
>
> .../CapsuleUpdatePolicyDxe.c  | 173 
> .../CapsuleUpdatePolicyDxe.h  | 140 +++
> .../CapsuleUpdatePolicyDxe.inf|  48 +
> .../CapsuleUpdatePolicyDxe.uni|  14 +
> .../CapsuleUpdatePolicyDxeExtra.uni   |  14 +
> FmpDevicePkg/FmpDevicePkg.dec |  43 +-
> FmpDevicePkg/FmpDevicePkg.dsc |  64 +-
> FmpDevicePkg/FmpDevicePkg.uni |  16 +-
> FmpDevicePkg/FmpDxe/DetectTestKey.c   |  16 +-
> FmpDevicePkg/FmpDxe/FmpDxe.c  | 792 ++--
> FmpDevicePkg/FmpDxe/FmpDxe.h  | 355 
> FmpDevicePkg/FmpDxe/FmpDxe.inf|   7 +-
> FmpDevicePkg/FmpDxe/FmpDxeLib.inf |   7 +-
> FmpDevicePkg/FmpDxe/VariableSupport.c | 844 +-
> FmpDevicePkg/FmpDxe/VariableSupport.h | 135 ++-
> FmpDevicePkg/Include/Library/FmpDeviceLib.h   | 104 ++-
> .../CapsuleUpdatePolicyLibOnProtocol.c| 171 
> .../CapsuleUpdatePolicyLibOnProtocol.inf  |  40 +
> .../CapsuleUpdatePolicyLibOnProtocol.uni  |  15 +
> .../Library/FmpDeviceLibNull/FmpDeviceLib.c   |  93 +-
> .../FmpDeviceLibNull/FmpDeviceLibNull.inf |   4 +-
> .../FmpPayloadHeaderLibV1.inf |   4 +-
> .../Library/FmpPayloadHeaderLib.h |   0
> .../Protocol/CapsuleUpdatePolicy.h| 132 +++
> 24 files changed, 2644 insertions(+), 587 deletions(-)
> create mode 100644
>FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.c
> create mode 100644
>FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.h
> create mode 100644
>FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.inf
> create mode 100644
>FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.uni
> create mode 100644
>FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxeExtra.uni
> create mode 100644 FmpDevicePkg/FmpDxe/FmpDxe.h
> create mode 100644
>FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePo
>licyLibOnProtocol.c
> create mode 100644
>FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePo
>licyLibOnProtocol.inf
> create mode 100644
>FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePo
>licyLibOnProtocol.uni
> rename FmpDevicePkg/{Include =>
>PrivateInclude}/Library/FmpPayloadHeaderLib.h (100%)
> create mode 100644
>FmpDevicePkg/PrivateInclude/Protocol/CapsuleUpdatePolicy.h
>
>--
>2.20.1.windows.1
>
>
>


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

View/Reply Online (#45395): https://edk2.groups.io/g/devel/message/45395
Mute This Topic: https://groups.io/mt/32836322/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] MdeModulePkg: Add missing header files in INF files

2019-08-11 Thread Zhang, Shenglei



> -Original Message-
> From: Wu, Hao A
> Sent: Monday, August 12, 2019 10:00 AM
> To: devel@edk2.groups.io; Zhang, Shenglei 
> Cc: Wang, Jian J ; Gao, Liming
> 
> Subject: RE: [edk2-devel] [PATCH 1/3] MdeModulePkg: Add missing header
> files in INF files
> 
> > -Original Message-
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > Zhang, Shenglei
> > Sent: Thursday, August 08, 2019 2:25 PM
> > To: devel@edk2.groups.io
> > Cc: Wang, Jian J; Wu, Hao A; Gao, Liming
> > Subject: [edk2-devel] [PATCH 1/3] MdeModulePkg: Add missing header
> files
> > in INF files
> >
> > The header files are used but missing in INF,which causes
> > generating warning message when building them.
> >
> > Cc: Jian J Wang 
> > Cc: Hao A Wu 
> > Cc: Liming Gao 
> > Signed-off-by: Shenglei Zhang 
> > ---
> >  MdeModulePkg/Universal/CapsulePei/CapsulePei.inf| 1 +
> >  MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf | 7 +++
> >  2 files changed, 8 insertions(+)
> >
> > diff --git a/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> > b/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> > index 786c41163304..adf9f1502d69 100644
> > --- a/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> > +++ b/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> > @@ -33,6 +33,7 @@ [Sources]
> >UefiCapsule.c
> >Capsule.h
> >Common/CapsuleCoalesce.c
> > +  Common/CommonHeader.h
> 
> 
> File 'Common/CapsuleCoalesce.c' is referring the header
> 'Common/CommonHeader.h'.
> 
> The patch updates CapsulePei.inf, but there is a similar case in
> CapsuleX64.inf as well.
> 
> Could you help to check whether such change is needed there?
> 
Good point! Indeed it looks strange to add 'Common/CommonHeader.h' only
in CapsulePei.inf but not in CapsuleX64.inf. I'll add it in v2 patch.

> 
> >
> >  [Packages]
> >MdePkg/MdePkg.dec
> > diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
> > b/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
> > index af002bd98e99..2a4e256063a6 100644
> > --- a/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
> > +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
> > @@ -28,6 +28,13 @@ [Sources]
> >EbcDebugger/EdbCommon.h
> >EbcDebugger/EdbSupportString.c
> >EbcDebugger/EdbSupport.h
> > +  EbcDebugger/EdbCommand.h
> > +  EbcDebugger/EdbHook.h
> > +  EbcDebugger/Edb.h
> > +  EbcDebugger/EdbDisasmSupport.h
> > +  EbcDebugger/EdbDisasm.h
> > +  EbcDebugger/EdbSymbol.h
> > +  EbcDebuggerHook.h
> 
> 
> Could you help to check whether the below 3 INF files within
> MdeModulePkg/Universal/EbcDxe have listed all used files in them?

I'll check them. Potential changes will be included in v2 patch.

Thanks,
Shenglei

> 
> (At least, I think there might be something missing in EbcDxe.inf)
> 
> Best Regards,
> Hao Wu
> 
> 
> >
> >  [Packages]
> >MdePkg/MdePkg.dec
> > --
> > 2.18.0.windows.1
> >
> >
> > 


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

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



Re: [edk2-devel] [PATCH v4 00/15] MdeModulePkg: Transfer reset data

2019-08-11 Thread Liming Gao
Zhichao:
  The change looks good. I have one comment to add more descriptions for new 
introduced two guids. 
  If so, the developer knows how to use them. 

  Besides, if this patch is for 201908 stable tag, please send RFC for this 
feature to annou...@edk2.groups.io and devel@edk2.groups.io to collect 
feedbacks. 

Thanks
Liming
>-Original Message-
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>Gao, Zhichao
>Sent: Monday, August 12, 2019 11:08 AM
>To: devel@edk2.groups.io
>Cc: Wang, Jian J ; Wu, Hao A ;
>Ni, Ray ; Zeng, Star ; Laszlo Ersek
>; Ard Biesheuvel ; Leif
>Lindholm ; Justen, Jordan L
>; Ma, Maurice ; Dong,
>Guo ; You, Benjamin ; Gao,
>Liming ; Kinney, Michael D
>; Sean Brogan ;
>Michael Turner ; Bret Barkelew
>; Chiu, Chasel 
>Subject: [edk2-devel] [PATCH v4 00/15] MdeModulePkg: Transfer reset data
>
>Indicate two guids gCapsuleArmedResetGuid and
>gCapsuleUpdateCompleteResetGuid
>for capsule update. And define a struct which start with a null string and
>followed by a EFI_GUID.
>
>V2:
>Add prefix Edkii to the new guids.
>Move the new struct definition to ResetSystemLib.h.
>Fix the wrong reset data to transfer.
>Fix the comment of EfiResetSystem in RuntimeLib base on UEFI spec 2.8.
>
>V3:
>Drop 'Move the new struct definition to ResetSystemLib.h.' because the
>structure
>would be only used in ResetUtilityLib
>Using the API ResetSystemWithSubtype in ResetUtilityLib to transfer
>a single GUID reset data.
>Add ResetUtilityLib to the dsc files that contain CapsuleRuntimeDxe and
>CapsuleLib (DxeCapsuleLib instance).
>
>V4:
>Format git config to show the [] section.
>Fixed incorrect location of ResetUtilityLib in OvmfPkgIa32X64.dsc.
>
>Cc: Jian J Wang 
>Cc: Hao Wu 
>Cc: Ray Ni 
>Cc: Star Zeng 
>Cc: Laszlo Ersek 
>Cc: Ard Biesheuvel 
>Cc: Leif Lindholm 
>Cc: Jordan Justen 
>Cc: Maurice Ma 
>Cc: Guo Dong 
>Cc: Benjamin You 
>Cc: Liming Gao 
>Cc: Michael D Kinney 
>Cc: Sean Brogan 
>Cc: Michael Turner 
>Cc: Bret Barkelew 
>Cc: Chasel Chiu 
>Signed-off-by: Zhichao Gao 
>
>
>Bret Barkelew (3):
>  MdeModulePkg: Add guids for capsule update
>  MdeModulePkg/CapsuleRuntimeDxe: Transfer reset data
>  MdeModulePkg/CapsuleLib: Transfer reset data
>
>Zhichao Gao (12):
>  MdeModulePkg: Add ResetUtilityLib to dsc file
>  ArmVirtPkg/ArmVirtQemu.dsc: Add ResetUtilityLib to dsc file
>  ArmVritPkg/ArmVirtQemuKernel.dsc: Add ResetUtilityLib to dsc file
>  ArmVirtPkg/ArmVirtXen.dsc: Add ResetUtilityLib to dsc file
>  EmulatorPkg/EmulatorPkg.dsc: Add ResetUtilityLib to dsc file
>  OvmfPkg/OvmfPkgIa32.dsc: Add ResetUtilityLib to dsc file
>  OvmfPkg/OvmfPkgIa32X64.dsc: Add ResetUtilityLib to dsc file
>  OvmfPkg/OvmfPkgX64.dsc: Add ResetUtilityLib to dsc file
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc: Add ResetUtilityLib to dsc file
>  UefiPayloadPkg: Add ResetUtilityLib to UefiPayloadPkgIa32X64.dsc
>  MdePkg/UefiRuntimeLib.h: Change the comment
>  MdePkg/UefiRuntimeLib: Change the comment
>
> ArmVirtPkg/ArmVirtQemu.dsc| 1 +
> ArmVirtPkg/ArmVirtQemuKernel.dsc  | 1 +
> ArmVirtPkg/ArmVirtXen.dsc | 1 +
> EmulatorPkg/EmulatorPkg.dsc   | 1 +
> MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf   | 2 ++
> .../Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c   | 3 ++-
> MdeModulePkg/MdeModulePkg.dec | 4 
> MdeModulePkg/MdeModulePkg.dsc | 1 +
> .../Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf | 2 ++
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c | 2 +-
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.h | 3 ++-
> MdePkg/Include/Library/UefiRuntimeLib.h   | 8 
> MdePkg/Library/UefiRuntimeLib/RuntimeLib.c| 8 
> OvmfPkg/OvmfPkgIa32.dsc   | 2 ++
> OvmfPkg/OvmfPkgIa32X64.dsc| 1 +
> OvmfPkg/OvmfPkgX64.dsc| 2 ++
> UefiPayloadPkg/UefiPayloadPkgIa32.dsc | 2 ++
> UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc  | 2 ++
> 18 files changed, 35 insertions(+), 11 deletions(-)
>
>--
>2.21.0.windows.1
>
>
>


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

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



Re: [edk2-devel] [Patch] MdeModulePkg DxeCore: Fix for missing MAT update

2019-08-11 Thread Wang, Jian J


Reviewed-by: Jian J Wang 


> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Liming Gao
> Sent: Saturday, August 10, 2019 10:10 PM
> To: devel@edk2.groups.io
> Cc: Mike Turner ; Wang, Jian J
> ; Wu, Hao A ; Bi, Dandan
> 
> Subject: [edk2-devel] [Patch] MdeModulePkg DxeCore: Fix for missing MAT
> update
> 
> From: Mike Turner 
> 
> The Fpdt driver (FirmwarePerformanceDxe) saves a memory address across
> reboots, and then does an AllocatePage for that memory address.
> If, on this boot, that memory comes from a Runtime memory bucket,
> the MAT table is not updated. This causes Windows to boot into Recovery.
> 
> This patch blocks the memory manager from changing the page
> from a special bucket to a different memory type.  Once the buckets are
> allocated, we freeze the memory ranges for the OS, and fragmenting
> the special buckets will cause errors resuming from hibernate.
> 
> This patch is cherry pick from Project Mu:
> https://github.com/microsoft/mu_basecore/commit/a9be767d9be96af94
> 016ebd391ea6f340920735a
> With the minor change,
> 1. Update commit message format to keep the message in 80 characters
> one line.
> 2. Remove // MU_CHANGE comments in source code.
> 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Dandan Bi 
> Signed-off-by: Liming Gao 
> ---
>  MdeModulePkg/Core/Dxe/Mem/Page.c | 43
> ++--
>  1 file changed, 37 insertions(+), 6 deletions(-)
> 
> diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c
> b/MdeModulePkg/Core/Dxe/Mem/Page.c
> index bd9e116aa5..637518889d 100644
> --- a/MdeModulePkg/Core/Dxe/Mem/Page.c
> +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c
> @@ -1265,12 +1265,13 @@ CoreInternalAllocatePages (
>IN BOOLEANNeedGuard
>)
>  {
> -  EFI_STATUS  Status;
> -  UINT64  Start;
> -  UINT64  NumberOfBytes;
> -  UINT64  End;
> -  UINT64  MaxAddress;
> -  UINTN   Alignment;
> +  EFI_STATUS   Status;
> +  UINT64   Start;
> +  UINT64   NumberOfBytes;
> +  UINT64   End;
> +  UINT64   MaxAddress;
> +  UINTNAlignment;
> +  EFI_MEMORY_TYPE  CheckType;
> 
>if ((UINT32)Type >= MaxAllocateType) {
>  return EFI_INVALID_PARAMETER;
> @@ -1321,6 +1322,7 @@ CoreInternalAllocatePages (
>// if (Start + NumberOfBytes) rolls over 0 or
>// if Start is above MAX_ALLOC_ADDRESS or
>// if End is above MAX_ALLOC_ADDRESS,
> +  // if Start..End overlaps any tracked MemoryTypeStatistics range
>// return EFI_NOT_FOUND.
>//
>if (Type == AllocateAddress) {
> @@ -1336,6 +1338,35 @@ CoreInternalAllocatePages (
>  (End > MaxAddress)) {
>return EFI_NOT_FOUND;
>  }
> +
> +// Problem summary
> +
> +/*
> +A driver is allowed to call AllocatePages using an AllocateAddress type.
> This type of
> +AllocatePage request the exact physical address if it is not used.  The
> existing code
> +will allow this request even in 'special' pages.  The problem with this 
> is
> that the
> +reason to have 'special' pages for OS hibernate/resume is defeated as
> memory is
> +fragmented.
> +*/
> +
> +for (CheckType = (EFI_MEMORY_TYPE) 0; CheckType <
> EfiMaxMemoryType; CheckType++) {
> +  if (MemoryType != CheckType &&
> +  mMemoryTypeStatistics[CheckType].Special &&
> +  mMemoryTypeStatistics[CheckType].NumberOfPages > 0) {
> +if (Start >= mMemoryTypeStatistics[CheckType].BaseAddress &&
> +Start <= mMemoryTypeStatistics[CheckType].MaximumAddress) {
> +  return EFI_NOT_FOUND;
> +}
> +if (End >= mMemoryTypeStatistics[CheckType].BaseAddress &&
> +End <= mMemoryTypeStatistics[CheckType].MaximumAddress) {
> +  return EFI_NOT_FOUND;
> +}
> +if (Start < mMemoryTypeStatistics[CheckType].BaseAddress &&
> +End   > mMemoryTypeStatistics[CheckType].MaximumAddress) {
> +  return EFI_NOT_FOUND;
> +}
> +  }
> +}
>}
> 
>if (Type == AllocateMaxAddress) {
> --
> 2.13.0.windows.1
> 
> 
> 


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

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



Re: [edk2-devel] [Patch] MdeModulePkg/RegularExpressionDxe: Add two missing null pointer checks

2019-08-11 Thread Wu, Hao A
> -Original Message-
> From: Gao, Liming
> Sent: Monday, August 12, 2019 10:52 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J; Wu, Hao A
> Subject: [Patch] MdeModulePkg/RegularExpressionDxe: Add two missing
> null pointer checks
> 
> After update Oniguruma from v6.9.0 to v6.9.3, two null pointer check
> should be added.
> This change bases on the patch
> https://edk2.groups.io/g/devel/message/45183.
> 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Signed-off-by: Liming Gao 
> ---
>  MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c |
> 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git
> a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
> b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
> index 4605d40bd1..2b121690e1 100644
> ---
> a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
> +++
> b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
> @@ -1955,6 +1955,7 @@ callout_tag_entry(ScanEnv* env, regex_t* reg,
> UChar* name, UChar* name_end,
> 
>ext = onig_get_regex_ext(reg);
>CHECK_NULL_RETURN_MEMERR(ext);
> +  CHECK_NULL_RETURN_MEMERR(ext->tag_table);
>r = callout_tag_entry_raw(env, ext->tag_table, name, name_end,
> entry_val);
> 
>e = onig_reg_callout_list_at(reg, (int )entry_val);
> @@ -3277,6 +3278,7 @@ node_new_str_raw_char(UChar c)
> 
>p[0] = c;
>node = node_new_str_raw(p, p + 1);
> +  CHECK_NULL_RETURN(node);


Reviewed-by: Hao A Wu 

Best Regards,
Hao Wu


> 
>/* clear buf tail */
>for (i = 1; i < NODE_STRING_BUF_SIZE; i++)
> --
> 2.13.0.windows.1


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

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



Re: [edk2-devel][edk2-platfoms][PATCH v2 06/22] Platform/CoreDxeInclude.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

> -Original Message-
> From: Gao, Zhichao
> Sent: Monday, August 12, 2019 11:05 AM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel ; Leif Lindholm
> ; Kinney, Michael D ;
> Kubacki, Michael A ; Chiu, Chasel
> ; Desimone, Nathaniel L
> ; Gao, Liming 
> Subject: [edk2-devel][edk2-platfoms][PATCH v2 06/22]
> Platform/CoreDxeInclude.dsc: Add ResetUtilityLib to dsc file
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772
> 
> ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
> So add it for the platform dsc file.
> 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Cc: Michael Kubacki 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Liming Gao 
> Signed-off-by: Zhichao Gao 
> ---
>  Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> index f0e578f8cceb..9d043953b327 100644
> --- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> +++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> @@ -58,7 +58,10 @@
>  !endif
>}
> 
> -  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> +  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf {
> +
> +
> ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
> +  }
> 
>#UefiCpuPkg/CpuDxe/CpuDxe.inf
> 
> --
> 2.21.0.windows.1


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

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



[edk2-devel] [PATCH v4 15/15] MdePkg/UefiRuntimeLib: Change the comment

2019-08-11 Thread Gao, Zhichao
Change the comment of EfiResetSystem base on the
UEFI spec 2.8

Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 MdePkg/Library/UefiRuntimeLib/RuntimeLib.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c 
b/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c
index 933e0099ceed..28cbf493b665 100644
--- a/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c
+++ b/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c
@@ -218,10 +218,10 @@ EfiGoneVirtual (
   @param  DataSizeThe size, in bytes, of ResetData.
   @param  ResetData   For a ResetType of EfiResetCold, EfiResetWarm, or 
EfiResetShutdown the data buffer starts with a
   Null-terminated Unicode string, optionally followed by 
additional binary data. The string is a
-  description that the caller may use to further indicate 
the reason for the system reset. ResetData
-  is only valid if ResetStatus is something other then 
EFI_SUCCESS. This pointer must be a physical
-  address. For a ResetType of EfiRestUpdate the data 
buffer also starts with a Null-terminated string
-  that is followed by a physical VOID * to an 
EFI_CAPSULE_HEADER.
+  description that the caller may use to further indicate 
the reason for the system reset. This
+  pointer must be a physical address. For a ResetType of 
EfiResetPlatformSpecific the data buffer
+  also starts with a Null-terminated string that is 
followed by an EFI_GUID that describes the
+  specific type of reset to perform.
 
 **/
 VOID
-- 
2.21.0.windows.1


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

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



[edk2-devel] [PATCH v4 09/15] OvmfPkg/OvmfPkgX64.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Jordan Justen 
Cc: Laszlo Ersek 
Cc: Ard Biesheuvel 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 OvmfPkg/OvmfPkgX64.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index fa98f16a3fb3..895c54b0edb9 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -189,6 +189,8 @@ [LibraryClasses]
 !endif
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 
   #
   # Network libraries
-- 
2.21.0.windows.1


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

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



[edk2-devel] [PATCH v4 11/15] UefiPayloadPkg: Add ResetUtilityLib to UefiPayloadPkgIa32X64.dsc

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Maurice Ma 
Cc: Guo Dong 
Cc: Benjamin You 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
Reviewed-by: Maurice Ma 
---
 UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc 
b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
index 5b7994a62cda..ec6d5b71621e 100644
--- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
@@ -205,6 +205,8 @@ [LibraryClasses]
   
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.IA32.SEC]
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel] [PATCH v4 10/15] UefiPayloadPkg/UefiPayloadPkgIa32.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Maurice Ma 
Cc: Guo Dong 
Cc: Benjamin You 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
Reviewed-by: Maurice Ma 
---
 UefiPayloadPkg/UefiPayloadPkgIa32.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc 
b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
index 11cf17ca0647..22bd9b8f7c60 100644
--- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
@@ -205,6 +205,8 @@ [LibraryClasses]
   
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.IA32.SEC]
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel] [PATCH v4 14/15] MdePkg/UefiRuntimeLib.h: Change the comment

2019-08-11 Thread Gao, Zhichao
Change the comment of EfiResetSystem base on the
UEFI spec 2.8

Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 MdePkg/Include/Library/UefiRuntimeLib.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/MdePkg/Include/Library/UefiRuntimeLib.h 
b/MdePkg/Include/Library/UefiRuntimeLib.h
index 8f13ca275d31..3962347d36bc 100644
--- a/MdePkg/Include/Library/UefiRuntimeLib.h
+++ b/MdePkg/Include/Library/UefiRuntimeLib.h
@@ -321,10 +321,10 @@ EfiGetNextHighMonotonicCount (
   @param  DataSizeThe size, in bytes, of ResetData.
   @param  ResetData   For a ResetType of EfiResetCold, EfiResetWarm, or 
EfiResetShutdown the data buffer starts with a
   Null-terminated Unicode string, optionally followed by 
additional binary data. The string is a
-  description that the caller may use to further indicate 
the reason for the system reset. ResetData
-  is only valid if ResetStatus is something other then 
EFI_SUCCESS. This pointer must be a physical
-  address. For a ResetType of EfiResetPlatformSpecific the 
data buffer also starts with a Null-terminated
-  string that is followed by an EFI_GUID that describes 
the specific type of reset to perform.
+  description that the caller may use to further indicate 
the reason for the system reset. This
+  pointer must be a physical address. For a ResetType of 
EfiResetPlatformSpecific the data buffer
+  also starts with a Null-terminated string that is 
followed by an EFI_GUID that describes the
+  specific type of reset to perform.
 **/
 VOID
 EFIAPI
-- 
2.21.0.windows.1


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

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



[edk2-devel] [PATCH v4 08/15] OvmfPkg/OvmfPkgIa32X64.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Jordan Justen 
Cc: Laszlo Ersek 
Cc: Ard Biesheuvel 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 OvmfPkg/OvmfPkgIa32X64.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index f163aa267132..a9f69eab8c06 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -189,6 +189,7 @@ [LibraryClasses]
 !endif
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
 
   #
   # Network libraries
-- 
2.21.0.windows.1


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

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



[edk2-devel] [PATCH v4 07/15] OvmfPkg/OvmfPkgIa32.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Jordan Justen 
Cc: Laszlo Ersek 
Cc: Ard Biesheuvel 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 OvmfPkg/OvmfPkgIa32.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 6ab730018694..3dd9c0a3cd70 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -184,6 +184,8 @@ [LibraryClasses]
 !endif
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 
   #
   # Network libraries
-- 
2.21.0.windows.1


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

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



[edk2-devel] [PATCH v4 00/15] MdeModulePkg: Transfer reset data

2019-08-11 Thread Gao, Zhichao
Indicate two guids gCapsuleArmedResetGuid and gCapsuleUpdateCompleteResetGuid
for capsule update. And define a struct which start with a null string and
followed by a EFI_GUID.

V2:
Add prefix Edkii to the new guids.
Move the new struct definition to ResetSystemLib.h.
Fix the wrong reset data to transfer.
Fix the comment of EfiResetSystem in RuntimeLib base on UEFI spec 2.8.

V3:
Drop 'Move the new struct definition to ResetSystemLib.h.' because the structure
would be only used in ResetUtilityLib
Using the API ResetSystemWithSubtype in ResetUtilityLib to transfer
a single GUID reset data.
Add ResetUtilityLib to the dsc files that contain CapsuleRuntimeDxe and
CapsuleLib (DxeCapsuleLib instance).

V4:
Format git config to show the [] section.
Fixed incorrect location of ResetUtilityLib in OvmfPkgIa32X64.dsc.

Cc: Jian J Wang 
Cc: Hao Wu 
Cc: Ray Ni 
Cc: Star Zeng 
Cc: Laszlo Ersek 
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Jordan Justen 
Cc: Maurice Ma 
Cc: Guo Dong 
Cc: Benjamin You 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Sean Brogan 
Cc: Michael Turner 
Cc: Bret Barkelew 
Cc: Chasel Chiu 
Signed-off-by: Zhichao Gao 


Bret Barkelew (3):
  MdeModulePkg: Add guids for capsule update
  MdeModulePkg/CapsuleRuntimeDxe: Transfer reset data
  MdeModulePkg/CapsuleLib: Transfer reset data

Zhichao Gao (12):
  MdeModulePkg: Add ResetUtilityLib to dsc file
  ArmVirtPkg/ArmVirtQemu.dsc: Add ResetUtilityLib to dsc file
  ArmVritPkg/ArmVirtQemuKernel.dsc: Add ResetUtilityLib to dsc file
  ArmVirtPkg/ArmVirtXen.dsc: Add ResetUtilityLib to dsc file
  EmulatorPkg/EmulatorPkg.dsc: Add ResetUtilityLib to dsc file
  OvmfPkg/OvmfPkgIa32.dsc: Add ResetUtilityLib to dsc file
  OvmfPkg/OvmfPkgIa32X64.dsc: Add ResetUtilityLib to dsc file
  OvmfPkg/OvmfPkgX64.dsc: Add ResetUtilityLib to dsc file
  UefiPayloadPkg/UefiPayloadPkgIa32.dsc: Add ResetUtilityLib to dsc file
  UefiPayloadPkg: Add ResetUtilityLib to UefiPayloadPkgIa32X64.dsc
  MdePkg/UefiRuntimeLib.h: Change the comment
  MdePkg/UefiRuntimeLib: Change the comment

 ArmVirtPkg/ArmVirtQemu.dsc| 1 +
 ArmVirtPkg/ArmVirtQemuKernel.dsc  | 1 +
 ArmVirtPkg/ArmVirtXen.dsc | 1 +
 EmulatorPkg/EmulatorPkg.dsc   | 1 +
 MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf   | 2 ++
 .../Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c   | 3 ++-
 MdeModulePkg/MdeModulePkg.dec | 4 
 MdeModulePkg/MdeModulePkg.dsc | 1 +
 .../Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf | 2 ++
 MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c | 2 +-
 MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.h | 3 ++-
 MdePkg/Include/Library/UefiRuntimeLib.h   | 8 
 MdePkg/Library/UefiRuntimeLib/RuntimeLib.c| 8 
 OvmfPkg/OvmfPkgIa32.dsc   | 2 ++
 OvmfPkg/OvmfPkgIa32X64.dsc| 1 +
 OvmfPkg/OvmfPkgX64.dsc| 2 ++
 UefiPayloadPkg/UefiPayloadPkgIa32.dsc | 2 ++
 UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc  | 2 ++
 18 files changed, 35 insertions(+), 11 deletions(-)

-- 
2.21.0.windows.1


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

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



[edk2-devel] [PATCH v4 02/15] MdeModulePkg: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Jian J Wang 
Cc: Hao Wu 
Cc: Ray Ni 
Cc: Star Zeng 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 MdeModulePkg/MdeModulePkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index 6ca7d9ade4e1..34e1910865f4 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -97,6 +97,7 @@ [LibraryClasses]
   BmpSupportLib|MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf
   SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
   
DisplayUpdateProgressLib|MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/DisplayUpdateProgressLibGraphics.inf
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
 
 [LibraryClasses.EBC.PEIM]
   IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel] [PATCH v4 06/15] EmulatorPkg/EmulatorPkg.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Jordan Justen 
Cc: Andrew Fish 
Cc: Ray Ni 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 EmulatorPkg/EmulatorPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index ea8b6ce76e24..4ec88569bca0 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -111,6 +111,7 @@ [LibraryClasses]
   SortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
   ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
   FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
 
 [LibraryClasses.common.SEC]
   PeiServicesLib|EmulatorPkg/Library/SecPeiServicesLib/SecPeiServicesLib.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel] [PATCH v4 01/15] MdeModulePkg: Add guids for capsule update

2019-08-11 Thread Gao, Zhichao
From: Bret Barkelew 

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

And add two guids gEdkiiCapsuleArmedResetGuid and
gEdkiiCapsuleUpdateCompleteResetGuid for capsule
Update.

Cc: Jian J Wang 
Cc: Hao Wu 
Cc: Ray Ni 
Cc: Star Zeng 
Cc: Liming Gao 
Cc: Sean Brogan 
Cc: Michael Turner 
Cc: Bret Barkelew 
Signed-off-by: Zhichao Gao 
---
 MdeModulePkg/MdeModulePkg.dec | 4 
 1 file changed, 4 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 12e0bbf57997..e7a71d3ab393 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -402,6 +402,10 @@ [Guids]
   ## GUID indicates the capsule is to store Capsule On Disk file names.
   gEdkiiCapsuleOnDiskNameGuid = { 0x98c80a4f, 0xe16b, 0x4d11, { 0x93, 0x9a, 
0xab, 0xe5, 0x61, 0x26, 0x3, 0x30 } }
 
+  ## Guid to use for gRT->ResetSystem () to indicate the type of reset that is 
being performed.
+  gEdkiiCapsuleArmedResetGuid= {0xc6b4eea7, 0xfce2, 0x4625, {0x9c, 
0x4f, 0xc4, 0xb0, 0x82, 0x37, 0xae, 0x23}}
+  gEdkiiCapsuleUpdateCompleteResetGuid   = {0x5d512714, 0xa4df, 0x4e46, {0xb6, 
0xc7, 0xbc, 0x9f, 0x97, 0x9d, 0x59, 0xa0}}
+
 [Ppis]
   ## Include/Ppi/AtaController.h
   gPeiAtaControllerPpiGuid   = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 
0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}
-- 
2.21.0.windows.1


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

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



[edk2-devel] [PATCH v4 04/15] ArmVritPkg/ArmVirtQemuKernel.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Laszlo Ersek 
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 ArmVirtPkg/ArmVirtQemuKernel.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index 3b0f04967a4b..87c37a06e7fc 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -73,6 +73,7 @@ [LibraryClasses.common]
   
PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
   
PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
 
 [LibraryClasses.common.DXE_DRIVER]
   
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 11/22] Platform/HiKey.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/Hisilicon/HiKey/HiKey.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/Hisilicon/HiKey/HiKey.dsc 
b/Platform/Hisilicon/HiKey/HiKey.dsc
index bcbe4fafce1a..8e875e193a80 100644
--- a/Platform/Hisilicon/HiKey/HiKey.dsc
+++ b/Platform/Hisilicon/HiKey/HiKey.dsc
@@ -62,6 +62,8 @@ [LibraryClasses.common]
   
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.SEC]
   PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
   
ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 18/22] Platform/QuarkMin.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Kelly Steele 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc 
b/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc
index 3dbf616c664d..937afd03c040 100644
--- a/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc
+++ b/Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc
@@ -195,6 +195,8 @@ [LibraryClasses]
   
PlatformPcieHelperLib|QuarkPlatformPkg/Library/PlatformPcieHelperLib/PlatformPcieHelperLib.inf
   
PlatformHelperLib|QuarkPlatformPkg/Library/PlatformHelperLib/DxePlatformHelperLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.SEC]
   #
   # SEC specific phase
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 20/22] Platform/RPi3.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/RaspberryPi/RPi3/RPi3.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc 
b/Platform/RaspberryPi/RPi3/RPi3.dsc
index 2b9e619ad55c..8490714b8ba9 100644
--- a/Platform/RaspberryPi/RPi3/RPi3.dsc
+++ b/Platform/RaspberryPi/RPi3/RPi3.dsc
@@ -158,6 +158,8 @@ [LibraryClasses.common]
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
   GpioLib|Silicon/Broadcom/Bcm283x/Library/GpioLib/GpioLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.SEC]
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 09/22] Platform/D06.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/Hisilicon/D06/D06.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
index 000a4eec21be..e94f5e0e3db9 100644
--- a/Platform/Hisilicon/D06/D06.dsc
+++ b/Platform/Hisilicon/D06/D06.dsc
@@ -78,6 +78,8 @@ [LibraryClasses.common]
   PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
   
PciPlatformLib|Silicon/Hisilicon/Hi1620/Library/Hi1620PciPlatformLib/Hi1620PciPlatformLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.SEC]
   
ArmPlatformLib|Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibSec.inf
 
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 13/22] Platform/Overdrive1000Board.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc 
b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
index 005ffad0e108..e4b5b54d67a7 100644
--- a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
+++ b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
@@ -143,6 +143,8 @@ [LibraryClasses.common]
   SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.SEC]
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
   
PeiServicesTablePointerLib|ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 17/22] Platform/Quark.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Kelly Steele 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/Intel/QuarkPlatformPkg/Quark.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/Intel/QuarkPlatformPkg/Quark.dsc 
b/Platform/Intel/QuarkPlatformPkg/Quark.dsc
index a02adb64e695..5b9d09a423c4 100644
--- a/Platform/Intel/QuarkPlatformPkg/Quark.dsc
+++ b/Platform/Intel/QuarkPlatformPkg/Quark.dsc
@@ -237,6 +237,8 @@ [LibraryClasses]
   
PlatformFlashAccessLib|QuarkPlatformPkg/Feature/Capsule/Library/PlatformFlashAccessLib/PlatformFlashAccessLibDxe.inf
   
DisplayUpdateProgressLib|MdeModulePkg/Library/DisplayUpdateProgressLibText/DisplayUpdateProgressLibText.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.SEC]
   #
   # SEC specific phase
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 15/22] Platform: Add ResetUtilityLib to vlv2 PlatformPkgIA32.dsc

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Zailiang Sun 
Cc: Yi Qian 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc 
b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
index 30b47d8f3284..c1565377862a 100644
--- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
+++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
@@ -248,6 +248,8 @@ [LibraryClasses.common]
   
EdkiiSystemCapsuleLib|SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.inf
 !endif
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.IA32.SEC]
 !if $(PERFORMANCE_ENABLE) == TRUE
   
PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 06/22] Platform/CoreDxeInclude.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Michael Kubacki 
Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc 
b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
index f0e578f8cceb..9d043953b327 100644
--- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
+++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
@@ -58,7 +58,10 @@
 !endif
   }
 
-  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
+  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf {
+
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+  }
 
   #UefiCpuPkg/CpuDxe/CpuDxe.inf
 
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 12/22] Platform/HiKey960.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/Hisilicon/HiKey960/HiKey960.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/Hisilicon/HiKey960/HiKey960.dsc 
b/Platform/Hisilicon/HiKey960/HiKey960.dsc
index 151c6312f87f..0eb6a777bf08 100644
--- a/Platform/Hisilicon/HiKey960/HiKey960.dsc
+++ b/Platform/Hisilicon/HiKey960/HiKey960.dsc
@@ -63,6 +63,8 @@ [LibraryClasses.common]
   
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.SEC]
   PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
   
ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 19/22] Platform/RDKQemu.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/Comcast/RDKQemu/RDKQemu.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/Comcast/RDKQemu/RDKQemu.dsc 
b/Platform/Comcast/RDKQemu/RDKQemu.dsc
index 440d2ace917c..8e950fe489aa 100644
--- a/Platform/Comcast/RDKQemu/RDKQemu.dsc
+++ b/Platform/Comcast/RDKQemu/RDKQemu.dsc
@@ -68,6 +68,8 @@ [LibraryClasses.common]
   
PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
   
RdkBootManagerLib|Platform/Comcast/Library/RdkBootManagerLib/RdkBootManagerLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.PEIM]
   
ArmVirtMemInfoLib|ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf
 
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 21/22] Platform/SgiPlatform.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/ARM/SgiPkg/SgiPlatform.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index a5b7eea1d3a8..81bb5c257f34 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -43,6 +43,8 @@ [LibraryClasses.common]
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
   
OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.SEC]
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
   
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 14/22] Platform/OverdriveBoard.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/AMD/OverdriveBoard/OverdriveBoard.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc 
b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
index 7369173cc125..6b3ebb764319 100644
--- a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
+++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
@@ -150,6 +150,8 @@ [LibraryClasses.common]
   
ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
   
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.SEC]
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
   
PeiServicesTablePointerLib|ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 16/22] Platform: Add ResetUtilityLib to vlv2 PlatformPkgX64.dsc

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Zailiang Sun 
Cc: Yi Qian 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc 
b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
index 57316d487bb4..98fbd5e2c574 100644
--- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
+++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
@@ -250,6 +250,8 @@ [LibraryClasses.common]
   
EdkiiSystemCapsuleLib|SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.inf
 !endif
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.IA32.SEC]
 !if $(PERFORMANCE_ENABLE) == TRUE
   
PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 04/22] Platform/BeagleBoardPkg.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.dsc 
b/Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.dsc
index dfc31ab4018b..03182134a8ca 100644
--- a/Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.dsc
+++ b/Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.dsc
@@ -137,6 +137,8 @@ [LibraryClasses.common]
 
   
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.SEC]
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   
ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 02/22] Platform/ArmVExpress-CTA15-A7.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc 
b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
index 2f8021d3eabc..c5dee0dcb650 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
@@ -48,6 +48,8 @@ [LibraryClasses.common]
 
   ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.DXE_RUNTIME_DRIVER]
   
ArmPlatformSysConfigLib|Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf
 
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 22/22] Platform/SynQuacerEvalBoard.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc 
b/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc
index ab1ab6f2de60..e5348a535d6b 100644
--- a/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc
+++ b/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc
@@ -123,6 +123,8 @@ [LibraryClasses.common]
 
   NorFlashInfoLib|EmbeddedPkg/Library/NorFlashInfoLib/NorFlashInfoLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.SEC]
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 00/22] Add ResetUtilityLib to dsc files that contian CapsuleRuntimeDxe

2019-08-11 Thread Gao, Zhichao
The ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it to the related platform dsc files.

V2:
Update the git config to show the specific [LibraryClasses.$(ARCH)] section
for every patch.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Michael Kubacki 
Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Zailiang Sun 
Cc: Yi Qian 
Cc: Kelly Steele 

Zhichao Gao (22):
  Platform/ARM/JunoPkg/ArmJuno.dsc: Add ResetUtilityLib to dsc file
  Platform/ArmVExpress-CTA15-A7.dsc: Add ResetUtilityLib to dsc file
  Platform/ArmVExpress-FVP-AArch64.dsc: Add ResetUtilityLib to dsc file
  Platform/BeagleBoardPkg.dsc: Add ResetUtilityLib to dsc file
  Platform/CelloBoard.dsc: Add ResetUtilityLib to dsc file
  Platform/CoreDxeInclude.dsc: Add ResetUtilityLib to dsc file
  Platform/D03.dsc: Add ResetUtilityLib to dsc file
  Platform/D05.dsc: Add ResetUtilityLib to dsc file
  Platform/D06.dsc: Add ResetUtilityLib to dsc file
  Platform/DeveloperBox.dsc: Add ResetUtilityLib to dsc file
  Platform/HiKey.dsc: Add ResetUtilityLib to dsc file
  Platform/HiKey960.dsc: Add ResetUtilityLib to dsc file
  Platform/Overdrive1000Board.dsc: Add ResetUtilityLib to dsc file
  Platform/OverdriveBoard.dsc: Add ResetUtilityLib to dsc file
  Platform: Add ResetUtilityLib to vlv2 PlatformPkgIA32.dsc
  Platform: Add ResetUtilityLib to vlv2 PlatformPkgX64.dsc
  Platform/Quark.dsc: Add ResetUtilityLib to dsc file
  Platform/QuarkMin.dsc: Add ResetUtilityLib to dsc file
  Platform/RDKQemu.dsc: Add ResetUtilityLib to dsc file
  Platform/RPi3.dsc: Add ResetUtilityLib to dsc file
  Platform/SgiPlatform.dsc: Add ResetUtilityLib to dsc file
  Platform/SynQuacerEvalBoard.dsc: Add ResetUtilityLib to dsc file

 Platform/AMD/OverdriveBoard/OverdriveBoard.dsc   | 2 ++
 Platform/ARM/JunoPkg/ArmJuno.dsc | 2 ++
 Platform/ARM/SgiPkg/SgiPlatform.dsc  | 2 ++
 Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc| 2 ++
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 2 ++
 Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.dsc   | 2 ++
 Platform/Comcast/RDKQemu/RDKQemu.dsc | 2 ++
 Platform/Hisilicon/D03/D03.dsc   | 2 ++
 Platform/Hisilicon/D05/D05.dsc   | 2 ++
 Platform/Hisilicon/D06/D06.dsc   | 2 ++
 Platform/Hisilicon/HiKey/HiKey.dsc   | 2 ++
 Platform/Hisilicon/HiKey960/HiKey960.dsc | 2 ++
 Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc | 5 -
 Platform/Intel/QuarkPlatformPkg/Quark.dsc| 2 ++
 Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc | 2 ++
 Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc | 2 ++
 Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc  | 2 ++
 Platform/LeMaker/CelloBoard/CelloBoard.dsc   | 2 ++
 Platform/RaspberryPi/RPi3/RPi3.dsc   | 2 ++
 Platform/Socionext/DeveloperBox/DeveloperBox.dsc | 2 ++
 Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc | 2 ++
 Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc  | 2 ++
 22 files changed, 46 insertions(+), 1 deletion(-)

-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 10/22] Platform/DeveloperBox.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/Socionext/DeveloperBox/DeveloperBox.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc 
b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
index 97fb8c410c60..b42cb3fe3e5b 100644
--- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
+++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
@@ -38,6 +38,8 @@ [LibraryClasses]
   PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
 !endif
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.SEC]
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 08/22] Platform/D05.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/Hisilicon/D05/D05.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
index 31c9fabb5237..fedcb2af1901 100644
--- a/Platform/Hisilicon/D05/D05.dsc
+++ b/Platform/Hisilicon/D05/D05.dsc
@@ -90,6 +90,8 @@ [LibraryClasses.common]
   
PciSegmentLib|Silicon/Hisilicon/Hi1610/Library/Hi161xPciSegmentLib/Hi161xPciSegmentLib.inf
   
PciPlatformLib|Silicon/Hisilicon/Hi1610/Library/Hi161xPciPlatformLib/Hi161xPciPlatformLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.SEC]
   
ArmPlatformLib|Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibSec.inf
 
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 03/22] Platform/ArmVExpress-FVP-AArch64.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc 
b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
index 63d79a488500..23b1c4bead0c 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
@@ -57,6 +57,8 @@ [LibraryClasses.common]
 
   
DtPlatformDtbLoaderLib|Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.DXE_RUNTIME_DRIVER]
   
ArmPlatformSysConfigLib|Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf
 
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 05/22] Platform/CelloBoard.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/LeMaker/CelloBoard/CelloBoard.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/LeMaker/CelloBoard/CelloBoard.dsc 
b/Platform/LeMaker/CelloBoard/CelloBoard.dsc
index 9ed4e03b2400..6152d68786cd 100644
--- a/Platform/LeMaker/CelloBoard/CelloBoard.dsc
+++ b/Platform/LeMaker/CelloBoard/CelloBoard.dsc
@@ -141,6 +141,8 @@ [LibraryClasses.common]
   OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.SEC]
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
   
PeiServicesTablePointerLib|ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel][edk2-platfoms][PATCH v2 01/22] Platform/ARM/JunoPkg/ArmJuno.dsc: Add ResetUtilityLib to dsc file

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/ARM/JunoPkg/ArmJuno.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index 954faca1bbfa..7995370f7e3f 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -54,6 +54,8 @@ [LibraryClasses.common]
   LcdHwLib|ArmPlatformPkg/Library/HdLcd/HdLcd.inf
 !endif
 
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+
 [LibraryClasses.common.SEC]
   PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
   
ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
-- 
2.21.0.windows.1


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

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



[edk2-devel] [Patch] MdeModulePkg/RegularExpressionDxe: Add two missing null pointer checks

2019-08-11 Thread Liming Gao
After update Oniguruma from v6.9.0 to v6.9.3, two null pointer check
should be added.
This change bases on the patch https://edk2.groups.io/g/devel/message/45183.

Cc: Jian J Wang 
Cc: Hao A Wu 
Signed-off-by: Liming Gao 
---
 MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c 
b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
index 4605d40bd1..2b121690e1 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
@@ -1955,6 +1955,7 @@ callout_tag_entry(ScanEnv* env, regex_t* reg, UChar* 
name, UChar* name_end,
 
   ext = onig_get_regex_ext(reg);
   CHECK_NULL_RETURN_MEMERR(ext);
+  CHECK_NULL_RETURN_MEMERR(ext->tag_table);
   r = callout_tag_entry_raw(env, ext->tag_table, name, name_end, entry_val);
 
   e = onig_reg_callout_list_at(reg, (int )entry_val);
@@ -3277,6 +3278,7 @@ node_new_str_raw_char(UChar c)
 
   p[0] = c;
   node = node_new_str_raw(p, p + 1);
+  CHECK_NULL_RETURN(node);
 
   /* clear buf tail */
   for (i = 1; i < NODE_STRING_BUF_SIZE; i++)
-- 
2.13.0.windows.1


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

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



Re: [edk2-devel] [PATCHv3 0/4] Add EDKII_UFS_HC_PLATFORM_PROTOCOL to support platform specific programming of UFS host controllers

2019-08-11 Thread Wu, Hao A
> -Original Message-
> From: Albecki, Mateusz
> Sent: Friday, August 09, 2019 10:36 PM
> To: devel@edk2.groups.io
> Cc: Albecki, Mateusz; Wu, Hao A
> Subject: [PATCHv3 0/4] Add EDKII_UFS_HC_PLATFORM_PROTOCOL to
> support platform specific programming of UFS host controllers
> 
> To cover additional host controller programming mentioned in the UFS
> specification we have added an additional protocol that allows the UEFI
> driver to give control to platform driver. This allows the platform to perform
> any additional steps needed for the stable operation.
> 
> Changes in v3:
> - UFS driver will abort initializaton when it fails to get host controler
> information
> - Fixed bug with calling post link startup callback on failed device detection
> 
> Test coverage:
> Tested on platform with UFS 2.1 host controller with Samsung UFS2.0 part
> with 3 LUs enabled All LUs have been enumerated in boot manager.
> Tested that enumeration works without platform protocol installed(on host
> controller that can support it) Tested that enumeration works with platform
> protocol installed and with additional programming steps after link
> startup(power mode change to GEAR2).
> 
> Cc: Hao A Wu  
> 
> Mateusz Albecki (4):
>   MdeModulePkg: Add definition of the
> EDKII_UFS_HC_PLATFORM_PROTOCOL
>   MdeModulePkg/UfsPassThruDxe: Refactor UfsExecUicCommand function
>   MdeModulePkg/UfsPassThruDxe: Refactor private data to use
> EDKII_UFS_HC_INFO
>   MdeModulePkg/UfsPassThruDxe: Implement
> EDKII_UFS_HC_PLATFORM_PROTOCOL


For the 3rd patch, in order to please the PatchCheck.py, I will change the
title a little bit to:
* MdeModulePkg/UfsPassThruDxe: Refactor private data to use UfsHcInfo

Other than that, for the series,
Reviewed-by: Hao A Wu 

Since there is already a confirmation from Laszlo for adding this feature in
the upcoming stable tag:
https://edk2.groups.io/g/devel/message/45217?p=,,,20,0,0,0::Created,,ufs,20,2,0,32784353

I plan to push the series tomorrow (after around 24 hours, in case if there
are additional feedbacks).

Best Regards,
Hao Wu


> 
>  MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c  |  26 +++-
>  MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h  |  44 +-
>  .../Bus/Ufs/UfsPassThruDxe/UfsPassThruDxe.inf  |   3 +-
>  .../Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c| 173 +++-
> -
>  .../Include/Protocol/UfsHostControllerPlatform.h   | 124 +++
>  MdeModulePkg/MdeModulePkg.dec  |   3 +
>  6 files changed, 324 insertions(+), 49 deletions(-)
>  create mode 100644
> MdeModulePkg/Include/Protocol/UfsHostControllerPlatform.h
> 
> --
> 2.14.1.windows.1


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

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



Re: [edk2-devel] [Patch] Vlv2TbltDevicePkg/VlvPlatformInitDxe: Avoid memset instrinsic

2019-08-11 Thread Gary Lin
On Fri, Aug 09, 2019 at 02:23:48PM -0700,  Kinney, Michael D  wrote:
> VS2017 builds for X64 are failing due to the use of the
> memset intrinsic.  The local variable GopVersion is an
> array that is initialied in the declaration.  Update to
> use ZeroMem() to intialize GopVersion.
> 
Looks reasonable to me.

Reviewed-by: Gary Lin 

> Cc: Zailiang Sun 
> Cc: Gary Lin 
> Signed-off-by: Michael D Kinney 
> ---
>  .../Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c   | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git 
> a/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c 
> b/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
> index fcd9e566ae..3815c8fa9c 100644
> --- a/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
> +++ b/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
> @@ -493,9 +493,10 @@ SetGOPVersionCallback (
>IN VOID  *Context
>)
>  {
> -  CHAR16GopVersion[16] = {0};
> +  CHAR16GopVersion[16];
>EFI_STATUSStatus;
>
> +  ZeroMem (GopVersion, sizeof (GopVersion));
>Status = GetGOPDriverVersion(GopVersion);
>if(!EFI_ERROR(Status)) {
>  StrCpy((CHAR16*)&(mIgdOpRegion.OpRegion->Header.GOPV[0]), GopVersion);
> -- 
> 2.21.0.windows.1
> 
> 

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

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



Re: [edk2-devel] [Patch] Vlv2Tbl2DevicePkg/PlatformSetupDxe: Fix setup info regression

2019-08-11 Thread Gary Lin
On Fri, Aug 09, 2019 at 12:34:03PM -0700,  Kinney, Michael D  wrote:
> The following commit removed the call to SetupInfo() from
> SystemConfigExtractConfig().  This caused the BIOS, Processor,
> Platform, and Memory information strings from being filled
> in with their proper values.
> 
> https://github.com/tianocore/edk2-platforms/commit/6738c654c8eddccc2a1230a4541bc2cb74c10ea5
> 
> The call to SetupInfo() is added back.
> 
The system info is back after applying this patch.

Tested-by: Gary Lin 

> Cc: Zailiang Sun 
> Cc: Gary Lin 
> Signed-off-by: Michael D Kinney 
> ---
>  .../Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.c  | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git 
> a/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.c 
> b/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.c
> index 7a4987f656..f3850b2aff 100644
> --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.c
> +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.c
> @@ -150,6 +150,7 @@ SystemConfigExtractConfig (
>OUT EFI_STRING *Results
>)
>  {
> +  SetupInfo();
>return EFI_UNSUPPORTED;
>  }
>
> -- 
> 2.21.0.windows.1
> 
> 

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

View/Reply Online (#45346): https://edk2.groups.io/g/devel/message/45346
Mute This Topic: https://groups.io/mt/32814191/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] Vlv2TbltDevicePkg/FmpDeviceLib: Implement new APIs

2019-08-11 Thread Sun, Zailiang
Reviewed-by: Zailiang Sun 

> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Eric Jin
> Sent: Monday, August 12, 2019 9:45 AM
> To: devel@edk2.groups.io
> Cc: Sun, Zailiang ; Qian, Yi ;
> Kinney, Michael D ; Gao, Liming
> 
> Subject: [edk2-devel] [edk2-platforms][PATCH]
> Vlv2TbltDevicePkg/FmpDeviceLib: Implement new APIs
> 
> Implement new APIs defined in FmpDeviceLib
> * RegisterFmpUninstaller()
> * FmpDeviceSetContext()
> * FmpDeviceGetHardwareInstance()
> 
> Cc: Zailiang Sun 
> Cc: Yi Qian 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Signed-off-by: Eric Jin 
> ---
>  .../Library/FmpDeviceLib/FmpDeviceLib.c   | 95 ++
>  .../Library/FmpDeviceLibSample/FmpDeviceLib.c | 99
> ++-
>  2 files changed, 192 insertions(+), 2 deletions(-)
> 
> diff --git
> a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/Library/FmpDeviceLib/
> FmpDeviceLib.c
> b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/Library/FmpDeviceLib
> /FmpDeviceLib.c
> index 57185d8d09..d8c9036012 100644
> ---
> a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/Library/FmpDeviceLib/
> FmpDeviceLib.c
> +++
> b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/Library/FmpDevice
> +++ Lib/FmpDeviceLib.c
> @@ -66,6 +66,73 @@ RegisterFmpInstaller (
>return EFI_UNSUPPORTED;
>  }
> 
> +/**
> +  Provide a function to uninstall the Firmware Management Protocol
> +instance from a
> +  device handle when the device is managed by a driver that follows the
> +UEFI
> +  Driver Model.  If the device is not managed by a driver that follows
> +the UEFI
> +  Driver Model, then EFI_UNSUPPORTED is returned.
> +
> +  @param[in] FmpUninstaller  Function that installs the Firmware
> Management
> + Protocol.
> +
> +  @retval EFI_SUCCESS  The device is managed by a driver that follows the
> +   UEFI Driver Model.  FmpUinstaller must be called 
> on
> +   each Driver Binding Stop().
> +  @retval EFI_UNSUPPORTED  The device is not managed by a driver that
> follows
> +   the UEFI Driver Model.
> +  @retval otherThe Firmware Management Protocol for this firmware
> +   device is not installed.  The firmware device is
> +   still locked using FmpDeviceLock().
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +RegisterFmpUninstaller (
> +  IN FMP_DEVICE_LIB_REGISTER_FMP_UNINSTALLER  FmpUninstaller
> +  )
> +{
> +  //
> +  // This is a system firmware update that does not use Driver Binding
> +Protocol
> +  //
> +  return EFI_UNSUPPORTED;
> +}
> +
> +/**
> +  Set the device context for the FmpDeviceLib services when the device
> +is
> +  managed by a driver that follows the UEFI Driver Model.  If the
> +device is not
> +  managed by a driver that follows the UEFI Driver Model, then
> +EFI_UNSUPPORTED
> +  is returned.  Once a device context is set, the FmpDeviceLib services
> +  operate on the currently set device context.
> +
> +  @param[in]  Handle   Device handle for the FmpDeviceLib services.
> +   If Handle is NULL, then Context is freed.
> +  @param[in, out] Context  Device context for the FmpDeviceLib services.
> +   If Context is NULL, then a new context is 
> allocated
> +   for Handle and the current device context is set 
> and
> +   returned in Context.  If Context is not NULL, then
> +   the current device context is set.
> +
> +  @retval EFI_SUCCESS  The device is managed by a driver that follows the
> +   UEFI Driver Model.
> +  @retval EFI_UNSUPPORTED  The device is not managed by a driver that
> follows
> +   the UEFI Driver Model.
> +  @retval otherThe Firmware Management Protocol for this firmware
> +   device is not installed.  The firmware device is
> +   still locked using FmpDeviceLock().
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +FmpDeviceSetContext (
> +  IN EFI_HANDLE  Handle,
> +  IN OUT VOID**Context
> +  )
> +{
> +  //
> +  // This is a system firmware update that does not use Driver Binding
> +Protocol
> +  //
> +  return EFI_UNSUPPORTED;
> +}
> 
>  /**
>Returns the size, in bytes, of the firmware image currently stored in the
> @@ -289,6 +356,34 @@ FmpDeviceGetVersion (
>return EFI_SUCCESS;
>  }
> 
> +/**
> +  Returns the value used to fill in the HardwareInstance field of the
> +  EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is returned by the
> +GetImageInfo()
> +  service of the Firmware Management Protocol.  If EFI_SUCCESS is
> +returned, then
> +  the firmware device supports a method to report the HardwareInstance
> value.
> +  If the value can not be reported for the firmware device, then
> +EFI_UNSUPPORTED
> +  must be returned.  EFI_DEVICE_ERROR is returned 

Re: [edk2-devel] [Patch V3 4/4] EmulatorPkg: Add support for NOOPT target

2019-08-11 Thread Wu, Hao A
> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Michael D Kinney
> Sent: Saturday, August 10, 2019 6:44 AM
> To: devel@edk2.groups.io
> Cc: Justen, Jordan L; Andrew Fish; Ni, Ray
> Subject: [edk2-devel] [Patch V3 4/4] EmulatorPkg: Add support for NOOPT
> target
> 
> Add NOOPT to BUILD_TARGETS in DSC file.
> 
> Cc: Jordan Justen 
> Cc: Andrew Fish 
> Cc: Ray Ni 
> Signed-off-by: Michael D Kinney 
> ---
>  EmulatorPkg/EmulatorPkg.dsc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
> index 529adfe1fa..0af2d1ff95 100644
> --- a/EmulatorPkg/EmulatorPkg.dsc
> +++ b/EmulatorPkg/EmulatorPkg.dsc
> @@ -19,7 +19,7 @@ [Defines]
>OUTPUT_DIRECTORY   = Build/Emulator$(ARCH)
> 
>SUPPORTED_ARCHITECTURES= X64|IA32
> -  BUILD_TARGETS  = DEBUG|RELEASE
> +  BUILD_TARGETS  = DEBUG|RELEASE|NOOPT


Reviewed-by: Hao A Wu 

Best Regards,
Hao Wu


>SKUID_IDENTIFIER   = DEFAULT
>FLASH_DEFINITION   = EmulatorPkg/EmulatorPkg.fdf
> 
> --
> 2.21.0.windows.1
> 
> 
> 


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

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



[edk2-devel] [Patch] Readme.md: Remove tag release from Readme

2019-08-11 Thread Liming Gao
The latest tag release can be found in Release Planning.
They are not required to be listed here.

Cc: Andrew Fish 
Cc: Laszlo Ersek 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Signed-off-by: Liming Gao 
---
 Readme.md | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/Readme.md b/Readme.md
index e564c6c09b..7c873759a5 100644
--- a/Readme.md
+++ b/Readme.md
@@ -28,9 +28,6 @@ are listed in [Maintainers.txt](Maintainers.txt).
 * [TianoCore Bugzilla](https://bugzilla.tianocore.org)
 * [How To 
Contribute](https://github.com/tianocore/tianocore.github.io/wiki/How-To-Contribute)
 * [Release 
Planning](https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning)
-* [UDK2017](https://github.com/tianocore/edk2/releases/tag/vUDK2017)
-* [UDK2018](https://github.com/tianocore/edk2/releases/tag/vUDK2018)
-* 
[edk2-stable201811](https://github.com/tianocore/edk2/releases/tag/edk2-stable201811)
 
 # Code Contributions
 To make a contribution to a TianoCore project, follow these steps.
-- 
2.13.0.windows.1


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

View/Reply Online (#45343): https://edk2.groups.io/g/devel/message/45343
Mute This Topic: https://groups.io/mt/32836513/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] Platform/Intel/KabylakeOpenBoardPkg: Fix build.

2019-08-11 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Nate DeSimone
> Sent: Friday, August 9, 2019 8:47 AM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Kubacki, Michael A
> 
> Subject: [edk2-devel] [edk2-platforms] [PATCH]
> Platform/Intel/KabylakeOpenBoardPkg: Fix build.
> 
> The build for KabylakeOpenBoardPkg is presently broken due to
> WORKSPACE_PLATFORM_BIN being defined to a marco of the same name in
> KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg
> 
> Setting this macro to an empty string resolves the issue.
> 
> Cc: Chasel Chiu 
> Cc: Michael Kubacki 
> Signed-off-by: Nate DeSimone 
> ---
>  .../Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg| 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg
> index bf89ea399c..ab1a9a61c2 100644
> --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg
> +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg
> @@ -7,7 +7,7 @@
> 
> 
>  [CONFIG]
> -WORKSPACE_PLATFORM_BIN = WORKSPACE_PLATFORM_BIN
> +WORKSPACE_PLATFORM_BIN =
>  EDK_SETUP_OPTION =
>  openssl_path =
>  PLATFORM_BOARD_PACKAGE = KabylakeOpenBoardPkg
> --
> 2.17.1.windows.2
> 
> 
> 


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

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



[edk2-devel] [PATCH V2 09/10] FmpDevicePkg/FmpDxe: Add PcdFmpDeviceStorageAccessEnable

2019-08-11 Thread Eric Jin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525

Add PCD PcdFmpDeviceStorageAccessEnable.  If this PCD is
TRUE, then the Firmware Management Protocol supports access
to the firmware storage device.  This is the default setting.
If FALSE, then Firmware Management Protocol services that
access the firmware storage device return EFI_UNSUPPORTED
except GetImageInfo().  Setting this value to FALSE produces
the smallest possible FmpDxe driver that still advertises the
updatable firmware component in the ESRT.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Liming Gao 
Signed-off-by: Michael D Kinney 
Reviewed-by: Eric Jin 
---
 FmpDevicePkg/FmpDevicePkg.dec | 12 
 FmpDevicePkg/FmpDevicePkg.dsc | 18 ++
 FmpDevicePkg/FmpDevicePkg.uni | 10 ++
 FmpDevicePkg/FmpDxe/FmpDxe.c  | 12 
 FmpDevicePkg/FmpDxe/FmpDxe.inf|  1 +
 FmpDevicePkg/FmpDxe/FmpDxeLib.inf |  1 +
 6 files changed, 54 insertions(+)

diff --git a/FmpDevicePkg/FmpDevicePkg.dec b/FmpDevicePkg/FmpDevicePkg.dec
index 56ed5fbb4a..8312b7cb22 100644
--- a/FmpDevicePkg/FmpDevicePkg.dec
+++ b/FmpDevicePkg/FmpDevicePkg.dec
@@ -52,6 +52,18 @@
   ## Capsule Update Policy Protocol
   gEdkiiCapuleUpdatePolicyProtocolGuid = { 0x487784c5, 0x6299, 0x4ba6, { 0xb0, 
0x96, 0x5c, 0xc5, 0x27, 0x7c, 0xf7, 0x57 } }
 
+[PcdsFeatureFlag]
+  ## Indicates if the Firmware Management Protocol supports access to
+  #  to a firmware storage device.  If set to FALSE, then only GetImageInfo()
+  #  is supported.  This is used by FMP drivers that require the samllest
+  #  possible Firmware Management Protocol implementation that supports
+  #  advertising the updatable firmware device in the ESRT.
+  #TRUE  - All Firmware Management Protocol services supported.
+  #FALSE - Firmware Management Protocol returns EFI_UNSUPPORTED for
+  #all services except GetImageInfo().
+  # @Prompt Firmware Device Storage Access Enabled.
+  
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceStorageAccessEnable|TRUE|BOOLEAN|0x4011
+
 [PcdsFixedAtBuild]
   ## The SHA-256 hash of a PKCS7 test key that is used to detect if a test key
   #  is being used to authenticate capsules.  Test key detection is disabled by
diff --git a/FmpDevicePkg/FmpDevicePkg.dsc b/FmpDevicePkg/FmpDevicePkg.dsc
index 4e2bd8de3d..bf283b93ea 100644
--- a/FmpDevicePkg/FmpDevicePkg.dsc
+++ b/FmpDevicePkg/FmpDevicePkg.dsc
@@ -29,6 +29,12 @@
   DEFINE SYSTEM_FMP_ESRT_GUID   = B461B3BD-E62A-4A71-841C-50BA4E500267
   DEFINE DEVICE_FMP_ESRT_GUID   = 226034C4-8B67-4536-8653-D6EE7CE5A316
 
+  #
+  # TRUE  - Build FmpDxe module for with storage access enabled
+  # FALSE - Build FmpDxe module for with storage access disabled
+  #
+  DEFINE DEVICE_FMP_STORAGE_ACCESS_ENABLE = TRUE
+
 [LibraryClasses]
   
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
   
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
@@ -118,11 +124,23 @@
   # FILE_GUID is used as ESRT GUID
   #
   FILE_GUID = $(DEVICE_FMP_ESRT_GUID)
+
+  
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceStorageAccessEnable|$(DEVICE_FMP_STORAGE_ACCESS_ENABLE)
 
+!if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == FALSE
+  #
+  # Disable test key detection
+  #
+  gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceTestKeySha256Digest|{0}
+!endif
   #
   # Unicode name string that is used to populate FMP Image Descriptor for 
this capsule update module
   #
+!if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == TRUE
   gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware 
Device"
+!else
+  gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware 
Device No Storage Access"
+!endif
   #
   # Certificates used to authenticate capsule update image
   #
diff --git a/FmpDevicePkg/FmpDevicePkg.uni b/FmpDevicePkg/FmpDevicePkg.uni
index b7fe643186..9e21130fae 100644
--- a/FmpDevicePkg/FmpDevicePkg.uni
+++ b/FmpDevicePkg/FmpDevicePkg.uni
@@ -16,6 +16,16 @@
 
 #string STR_PACKAGE_DESCRIPTION  #language en-US  "This package provides 
libraries that support the implementation of a module that produces the 
Firmware Management Protocol to support the update of a system firmware 
component."
 
+#string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceStorageAccessEnable_PROMPT 
 #language en-US "Firmware Device Storage Access Enabled."
+#string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceStorageAccessEnable_HELP   
 #language en-US "Indicates if the Firmware Management Protocol supports access 
to"
+   
 "to a firmware storage device.  If set to FALSE, then only 
GetImageInfo()"
+   
 "is supported.  This is used by FMP drivers that require the 
samllest"
+  

[edk2-devel] [PATCH V2 10/10] FmpDevicePkg/FmpDxe: Remove use of CatSprint()

2019-08-11 Thread Eric Jin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525

The size overhead for CatSPrint() is large.  This function
is only used to generate variable names with HardwareInstance
value appended.  Use UnicodeValueToStringS() instead that is
much smaller.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Liming Gao 
Signed-off-by: Michael D Kinney 
Reviewed-by: Eric Jin 
---
 FmpDevicePkg/FmpDxe/FmpDxe.h  |  1 +
 FmpDevicePkg/FmpDxe/FmpDxe.inf|  1 +
 FmpDevicePkg/FmpDxe/FmpDxeLib.inf |  1 +
 FmpDevicePkg/FmpDxe/VariableSupport.c | 19 ++-
 4 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.h b/FmpDevicePkg/FmpDxe/FmpDxe.h
index 28bfa41580..150f18b656 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.h
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.h
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.inf b/FmpDevicePkg/FmpDxe/FmpDxe.inf
index 5487123935..bec73aa8fb 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.inf
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.inf
@@ -45,6 +45,7 @@
   BaseMemoryLib
   UefiBootServicesTableLib
   MemoryAllocationLib
+  PrintLib
   UefiLib
   BaseCryptLib
   FmpAuthenticationLib
diff --git a/FmpDevicePkg/FmpDxe/FmpDxeLib.inf 
b/FmpDevicePkg/FmpDxe/FmpDxeLib.inf
index ba762b0b77..edc0cd66c1 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxeLib.inf
+++ b/FmpDevicePkg/FmpDxe/FmpDxeLib.inf
@@ -45,6 +45,7 @@
   BaseMemoryLib
   UefiBootServicesTableLib
   MemoryAllocationLib
+  PrintLib
   UefiLib
   BaseCryptLib
   FmpAuthenticationLib
diff --git a/FmpDevicePkg/FmpDxe/VariableSupport.c 
b/FmpDevicePkg/FmpDxe/VariableSupport.c
index 6c1ecf7df9..86dd5b203b 100644
--- a/FmpDevicePkg/FmpDxe/VariableSupport.c
+++ b/FmpDevicePkg/FmpDxe/VariableSupport.c
@@ -147,9 +147,15 @@ GenerateFmpVariableName (
   IN  CHAR16  *BaseVariableName
   )
 {
+  UINTN   Size;
   CHAR16  *VariableName;
 
-  VariableName = CatSPrint (NULL, BaseVariableName);
+  //
+  // Allocate Unicode string with room for BaseVariableName and a 16 digit
+  // hexadecimal value for the HardwareInstance value.
+  //
+  Size = StrSize (BaseVariableName) + 16 * sizeof (CHAR16);
+  VariableName = AllocateCopyPool (Size, BaseVariableName);
   if (VariableName == NULL) {
 DEBUG ((DEBUG_ERROR, "FmpDxe(%s): Failed to generate variable name %s.\n", 
mImageIdName, BaseVariableName));
 return VariableName;
@@ -157,10 +163,13 @@ GenerateFmpVariableName (
   if (HardwareInstance == 0) {
 return VariableName;
   }
-  VariableName = CatSPrint (VariableName, L"%016lx", HardwareInstance);
-  if (VariableName == NULL) {
-DEBUG ((DEBUG_ERROR, "FmpDxe(%s): Failed to generate variable name %s.\n", 
mImageIdName, BaseVariableName));
-  }
+  UnicodeValueToStringS (
+[StrLen(BaseVariableName)],
+Size,
+PREFIX_ZERO | RADIX_HEX,
+HardwareInstance,
+16
+);
   return VariableName;
 }
 
-- 
2.20.1.windows.1


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

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



[edk2-devel] [PATCH V2 08/10] FmpDevicePkg/FmpDxe: Add PcdFmpDeviceImageTypeIdGuid

2019-08-11 Thread Eric Jin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525

Add PCD PcdFmpDeviceImageTypeIdGuid that contains an Image
Type ID GUID value that is used if one is not provided by
FmpDeviceLib. If this PCD is not a valid GUID value,  then
gEfiCallerIdGuid is used.

Update FmpDevicePkg DSC to use PcdFmpDeviceImageTypeIdGuid
as a PatchableInModule PCD.

This content is based on the following commit.

https://github.com/microsoft/mu_tiano_plus/commit/a2c7da88d3a73dbe9b6b75952d6866179c905f28#diff-025d4889f6d3a482b49638a25e432d6d

Cc: Sean Brogan 
Cc: Michael Turner 
Cc: Bret Barkelew 
Cc: Liming Gao 
Signed-off-by: Michael D Kinney 
Reviewed-by: Eric Jin 
---
 FmpDevicePkg/FmpDevicePkg.dec |  5 +
 FmpDevicePkg/FmpDevicePkg.dsc | 25 +
 FmpDevicePkg/FmpDevicePkg.uni |  6 +-
 FmpDevicePkg/FmpDxe/FmpDxe.c  | 20 +++-
 FmpDevicePkg/FmpDxe/FmpDxe.inf|  1 +
 FmpDevicePkg/FmpDxe/FmpDxeLib.inf |  1 +
 6 files changed, 52 insertions(+), 6 deletions(-)

diff --git a/FmpDevicePkg/FmpDevicePkg.dec b/FmpDevicePkg/FmpDevicePkg.dec
index c68dbb7153..56ed5fbb4a 100644
--- a/FmpDevicePkg/FmpDevicePkg.dec
+++ b/FmpDevicePkg/FmpDevicePkg.dec
@@ -96,6 +96,11 @@
   # @Prompt Firmware Device Watchdog Time in Seconds.
   
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceProgressWatchdogTimeInSeconds|0x0|UINT8|0x400D
 
+  ## The Image Type ID to use if one is not provided by FmpDeviceLib. If this
+  #  PCD is not a valid GUID value, then gEfiCallerIdGuid is used.
+  # @Prompt Firmware Device Image Type ID
+  gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{0}|VOID*|0x4010
+
 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   ## One or more PKCS7 certificates used to verify a firmware device capsule
   #  update image.  Encoded using the Variable-Length Opaque Data format of RFC
diff --git a/FmpDevicePkg/FmpDevicePkg.dsc b/FmpDevicePkg/FmpDevicePkg.dsc
index 3356571fff..4e2bd8de3d 100644
--- a/FmpDevicePkg/FmpDevicePkg.dsc
+++ b/FmpDevicePkg/FmpDevicePkg.dsc
@@ -66,6 +66,9 @@
 [LibraryClasses.ARM]
   ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
 
+[PcdsPatchableInModule]
+  gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{0}
+
 [Components]
   #
   # Libraries
@@ -89,6 +92,17 @@
   # FILE_GUID is used as ESRT GUID
   #
   FILE_GUID = $(SYSTEM_FMP_ESRT_GUID)
+
+  #
+  # Unicode name string that is used to populate FMP Image Descriptor for 
this capsule update module
+  #
+  gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware 
Device"
+  #
+  # Certificates used to authenticate capsule update image
+  #
+  !include 
BaseTools/Source/Python/Pkcs7Sign/TestRoot.cer.gFmpDevicePkgTokenSpaceGuid.PcdFmpDevicePkcs7CertBufferXdr.inc
+
+  
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{GUID("$(SYSTEM_FMP_ESRT_GUID)")}
 
   #
   # Use CapsuleUpdatePolicyLib that calls the Capsule Update Policy 
Protocol.
@@ -104,6 +118,17 @@
   # FILE_GUID is used as ESRT GUID
   #
   FILE_GUID = $(DEVICE_FMP_ESRT_GUID)
+
+  #
+  # Unicode name string that is used to populate FMP Image Descriptor for 
this capsule update module
+  #
+  gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware 
Device"
+  #
+  # Certificates used to authenticate capsule update image
+  #
+  !include 
BaseTools/Source/Python/Pkcs7Sign/TestRoot.cer.gFmpDevicePkgTokenSpaceGuid.PcdFmpDevicePkcs7CertBufferXdr.inc
+
+  
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{GUID("$(DEVICE_FMP_ESRT_GUID)")}
 
   #
   # Directly use a platform specific CapsuleUpdatePolicyLib instance.
diff --git a/FmpDevicePkg/FmpDevicePkg.uni b/FmpDevicePkg/FmpDevicePkg.uni
index cf27ed5316..b7fe643186 100644
--- a/FmpDevicePkg/FmpDevicePkg.uni
+++ b/FmpDevicePkg/FmpDevicePkg.uni
@@ -6,7 +6,7 @@
 // Capsules.  The behavior of the Firmware Management Protocol instance is
 // customized using libraries and PCDs.
 //
-// Copyright (c) 2018, Intel Corporation. All rights reserved.
+// Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
 //
 // SPDX-License-Identifier: BSD-2-Clause-Patent
 //
@@ -53,6 +53,10 @@

   "value of 0 disables the watchdog timer.  The 
default value is 0 (watchdog"

   "disabled)."
 
+#string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceImageTypeIdGuid_PROMPT  
#language en-US "Firmware Device Image Type ID."
+#string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceImageTypeIdGuid_HELP
#language en-US "The Image Type ID to use if one is not provided by 
FmpDeviceLib. If this"
+   
 "PCD 

[edk2-devel] [PATCH V2 07/10] FmpDevicePkg/FmpDxe: Improve all DEBUG() messages

2019-08-11 Thread Eric Jin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525

Update all DEBUG() messages to include the name of the
FMP device from PcdFmpDeviceImageIdName.

Based on content from the following commit, but expanded
to cover all DEBUG() messages.

https://github.com/microsoft/mu_tiano_plus/commit/a2c7da88d3a73dbe9b6b75952d6866179c905f28#diff-025d4889f6d3a482b49638a25e432d6d

Cc: Sean Brogan 
Cc: Michael Turner 
Cc: Bret Barkelew 
Cc: Liming Gao 
Signed-off-by: Michael D Kinney 
Reviewed-by: Eric Jin 
---
 FmpDevicePkg/FmpDxe/DetectTestKey.c   |  16 +--
 FmpDevicePkg/FmpDxe/FmpDxe.c  | 134 --
 FmpDevicePkg/FmpDxe/FmpDxe.h  |   7 ++
 FmpDevicePkg/FmpDxe/VariableSupport.c |  71 --
 4 files changed, 115 insertions(+), 113 deletions(-)

diff --git a/FmpDevicePkg/FmpDxe/DetectTestKey.c 
b/FmpDevicePkg/FmpDxe/DetectTestKey.c
index e697a08489..0e10d5ee17 100644
--- a/FmpDevicePkg/FmpDxe/DetectTestKey.c
+++ b/FmpDevicePkg/FmpDxe/DetectTestKey.c
@@ -1,19 +1,13 @@
 /** @file
   Detects if PcdFmpDevicePkcs7CertBufferXdr contains a test key.
 
-  Copyright (c) 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include "FmpDxe.h"
 
 /**
   Check to see if any of the keys in PcdFmpDevicePkcs7CertBufferXdr matches
@@ -39,7 +33,7 @@ DetectTestKey (
   UINTNTestKeyDigestSize;
 
   //
-  // If PcdFmpDeviceTestKeySha256Digest is not exacty SHA256_DIGEST_SIZE bytes,
+  // If PcdFmpDeviceTestKeySha256Digest is not exactly SHA256_DIGEST_SIZE 
bytes,
   // then skip the test key detection.
   //
   TestKeyDigestSize = PcdGetSize (PcdFmpDeviceTestKeySha256Digest);
@@ -143,9 +137,9 @@ DetectTestKey (
   // set PcdTestKeyUsed to TRUE.
   //
   if (TestKeyUsed) {
-DEBUG ((DEBUG_INFO, "FmpDxe: Test key detected in 
PcdFmpDevicePkcs7CertBufferXdr.\n"));
+DEBUG ((DEBUG_INFO, "FmpDxe(%s): Test key detected in 
PcdFmpDevicePkcs7CertBufferXdr.\n", mImageIdName));
 PcdSetBoolS (PcdTestKeyUsed, TRUE);
   } else {
-DEBUG ((DEBUG_INFO, "FmpDxe: No test key detected in 
PcdFmpDevicePkcs7CertBufferXdr.\n"));
+DEBUG ((DEBUG_INFO, "FmpDxe(%s): No test key detected in 
PcdFmpDevicePkcs7CertBufferXdr.\n", mImageIdName));
   }
 }
diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
index 1574425fd6..b160e0f542 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -164,12 +164,12 @@ GetImageTypeIdGuid (
   Status = FmpDeviceGetImageTypeIdGuidPtr ();
   if (EFI_ERROR (Status)) {
 if (Status != EFI_UNSUPPORTED) {
-  DEBUG ((DEBUG_ERROR, "FmpDxe: FmpDeviceLib GetImageTypeIdGuidPtr() 
returned invalid error %r\n", Status));
+  DEBUG ((DEBUG_ERROR, "FmpDxe(%s): FmpDeviceLib GetImageTypeIdGuidPtr() 
returned invalid error %r\n", mImageIdName, Status));
 }
 return 
   }
   if (FmpDeviceLibGuid == NULL) {
-DEBUG ((DEBUG_ERROR, "FmpDxe: FmpDeviceLib GetImageTypeIdGuidPtr() 
returned invalid GUID\n"));
+DEBUG ((DEBUG_ERROR, "FmpDxe(%s): FmpDeviceLib GetImageTypeIdGuidPtr() 
returned invalid GUID\n", mImageIdName));
 return 
   }
   return FmpDeviceLibGuid;
@@ -299,7 +299,7 @@ PopulateDescriptor (
 //
 // Unexpected error.   Use default version.
 //
-DEBUG ((DEBUG_ERROR, "FmpDxe: GetVersion() from FmpDeviceLib (%s) returned 
%r\n", GetImageTypeNameString(), Status));
+DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetVersion() from FmpDeviceLib (%s) 
returned %r\n", mImageIdName, GetImageTypeNameString(), Status));
 Private->Descriptor.Version = DEFAULT_VERSION;
   }
 
@@ -317,13 +317,13 @@ PopulateDescriptor (
   //
   Status = FmpDeviceGetVersionString (>Descriptor.VersionName);
   if (Status == EFI_UNSUPPORTED) {
-DEBUG ((DEBUG_INFO, "FmpDxe: GetVersionString() unsupported in 
FmpDeviceLib.\n"));
+DEBUG ((DEBUG_INFO, "FmpDxe(%s): GetVersionString() unsupported in 
FmpDeviceLib.\n", mImageIdName));
 Private->Descriptor.VersionName = AllocateCopyPool (
 sizeof (VERSION_STRING_NOT_SUPPORTED),
 VERSION_STRING_NOT_SUPPORTED
 );
   } else if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_INFO, "FmpDxe: GetVersionString() not available in 
FmpDeviceLib.\n"));
+DEBUG ((DEBUG_INFO, "FmpDxe(%s): GetVersionString() not available in 
FmpDeviceLib.\n", mImageIdName));
 Private->Descriptor.VersionName = AllocateCopyPool (
 sizeof (VERSION_STRING_NOT_AVAILABLE),
 VERSION_STRING_NOT_AVAILABLE
@@ -434,7 +434,7 @@ GetTheImageInfo (
   // Check for valid pointer
   //
   if (ImageInfoSize == NULL) {
-DEBUG ((DEBUG_ERROR, "FmpDxe: GetImageInfo() - ImageInfoSize is NULL.\n"));
+DEBUG ((DEBUG_ERROR, 

[edk2-devel] [PATCH V2 06/10] FmpDevicePkg: Add Capsule Update Policy Protocol

2019-08-11 Thread Eric Jin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525

* Add Capsule Update Policy Protocol to FmpDevicePkg
* Add CapsuleUpdatePolicyLib instance that uses the services
  of the Capsule Update Policy Protocol
* Add module that produces the Capsule Update Policy
  Protocol using the services of the CapsuleUpdatePolicyLib
  class.
* Update FmpDevicePkg DSC to build the new library instance
  and the new module and update builds of FmpDxe modules
  to demonstrate the use of the different CapsuleUpdatePolicyLib
  instances.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Liming Gao 
Signed-off-by: Michael D Kinney 
Signed-off-by: Wang Fan 
Reviewed-by: Eric Jin 
---
 .../CapsuleUpdatePolicyDxe.c  | 173 ++
 .../CapsuleUpdatePolicyDxe.h  | 140 ++
 .../CapsuleUpdatePolicyDxe.inf|  48 +
 .../CapsuleUpdatePolicyDxe.uni|  14 ++
 .../CapsuleUpdatePolicyDxeExtra.uni   |  14 ++
 FmpDevicePkg/FmpDevicePkg.dec |  26 ++-
 FmpDevicePkg/FmpDevicePkg.dsc |  21 ++-
 .../CapsuleUpdatePolicyLibOnProtocol.c| 171 +
 .../CapsuleUpdatePolicyLibOnProtocol.inf  |  40 
 .../CapsuleUpdatePolicyLibOnProtocol.uni  |  15 ++
 .../Library/FmpPayloadHeaderLib.h |   0
 .../Protocol/CapsuleUpdatePolicy.h| 132 +
 12 files changed, 784 insertions(+), 10 deletions(-)
 create mode 100644 FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.c
 create mode 100644 FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.h
 create mode 100644 
FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.inf
 create mode 100644 
FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.uni
 create mode 100644 
FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxeExtra.uni
 create mode 100644 
FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.c
 create mode 100644 
FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.inf
 create mode 100644 
FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.uni
 rename FmpDevicePkg/{Include => PrivateInclude}/Library/FmpPayloadHeaderLib.h 
(100%)
 create mode 100644 FmpDevicePkg/PrivateInclude/Protocol/CapsuleUpdatePolicy.h

diff --git a/FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.c 
b/FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.c
new file mode 100644
index 00..d2571fd0e6
--- /dev/null
+++ b/FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.c
@@ -0,0 +1,173 @@
+/** @file
+  Provides platform policy services used during a capsule update that uses the
+  services of the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL.
+
+  Copyright (c) 2019, Intel Corporation. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include "CapsuleUpdatePolicyDxe.h"
+
+///
+/// Handle for the Capsule Update Policy Protocol
+///
+EFI_HANDLE  mHandle = NULL;
+
+///
+/// Capsule Update Policy Protocol instance
+///
+EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL  mCapsuleUpdatePolicy = {
+  CapsuleUpdatePolicyCheckSystemPower,
+  CapsuleUpdatePolicyCheckSystemThermal,
+  CapsuleUpdatePolicyCheckSystemEnvironment,
+  CapsuleUpdatePolicyIsLowestSupportedVersionCheckRequired,
+  CapsuleUpdatePolicyIsLockFmpDeviceAtLockEventGuidRequired
+};
+
+/**
+  Determine if the system power state supports a capsule update.
+
+  @param[in]  This  A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL 
instance.
+  @param[out] Good  Returns TRUE if system power state supports a capsule
+update.  Returns FALSE if system power state does not
+support a capsule update.  Return value is only valid if
+return status is EFI_SUCCESS.
+
+  @retval EFI_SUCCESSGood parameter has been updated with result.
+  @retval EFI_INVALID_PARAMETER  Good is NULL.
+  @retval EFI_DEVICE_ERROR   System power state can not be determined.
+
+**/
+EFI_STATUS
+EFIAPI
+CapsuleUpdatePolicyCheckSystemPower (
+  IN  EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL  *This,
+  OUT BOOLEAN   *Good
+  )
+{
+  return CheckSystemPower (Good);
+}
+
+
+/**
+  Determines if the system thermal state supports a capsule update.
+
+  @param[in]  This  A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL 
instance.
+  @param[out] Good  Returns TRUE if system thermal state supports a capsule
+update.  Returns FALSE if system thermal state does not
+support a capsule update.  Return value is only valid if
+return status is EFI_SUCCESS.
+
+  @retval EFI_SUCCESSGood parameter has been updated with result.
+  @retval EFI_INVALID_PARAMETER  Good is NULL.
+  @retval EFI_DEVICE_ERROR   System thermal state can not be determined.
+
+**/
+EFI_STATUS
+EFIAPI

[edk2-devel] [PATCH V2 05/10] FmpDevicePkg/FmpDxe: Different variable for each FMP Descriptor

2019-08-11 Thread Eric Jin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Liming Gao 
Signed-off-by: Michael D Kinney 
Signed-off-by: Eric Jin 
---
 FmpDevicePkg/FmpDxe/FmpDxe.c  | 124 +++-
 FmpDevicePkg/FmpDxe/FmpDxe.h  |   8 +-
 FmpDevicePkg/FmpDxe/VariableSupport.c | 824 ++
 FmpDevicePkg/FmpDxe/VariableSupport.h | 135 -
 4 files changed, 786 insertions(+), 305 deletions(-)

diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
index dab3310834..1574425fd6 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -11,6 +11,7 @@
 **/
 
 #include "FmpDxe.h"
+#include "VariableSupport.h"
 
 ///
 /// FILE_GUID from FmpDxe.inf.  When FmpDxe.inf is used in a platform, the
@@ -73,7 +74,13 @@ const FIRMWARE_MANAGEMENT_PRIVATE_DATA  
mFirmwareManagementPrivateDataTemplate =
   NULL,// VersionName
   TRUE,// RuntimeVersionSupported
   NULL,// FmpDeviceLockEvent
-  FALSE// FmpDeviceLocked
+  FALSE,   // FmpDeviceLocked
+  NULL,// FmpDeviceContext
+  NULL,// VersionVariableName
+  NULL,// LsvVariableName
+  NULL,// LastAttemptStatusVariableName
+  NULL,// 
LastAttemptVersionVariableName
+  NULL // FmpStateVariableName
 };
 
 ///
@@ -193,7 +200,7 @@ GetImageTypeNameString (
 **/
 UINT32
 GetLowestSupportedVersion (
-  VOID
+  FIRMWARE_MANAGEMENT_PRIVATE_DATA  *Private
   )
 {
   EFI_STATUS  Status;
@@ -230,7 +237,7 @@ GetLowestSupportedVersion (
   //
   // Check the lowest supported version UEFI variable for this device
   //
-  VariableLowestSupportedVersion = GetLowestSupportedVersionFromVariable();
+  VariableLowestSupportedVersion = GetLowestSupportedVersionFromVariable 
(Private);
   if (VariableLowestSupportedVersion > ReturnLsv) {
 ReturnLsv = VariableLowestSupportedVersion;
   }
@@ -265,6 +272,20 @@ PopulateDescriptor (
   Private->Descriptor.ImageId = Private->Descriptor.ImageIndex;
   Private->Descriptor.ImageIdName = GetImageTypeNameString();
 
+  //
+  // Get the hardware instance from FmpDeviceLib
+  //
+  Status = FmpDeviceGetHardwareInstance 
(>Descriptor.HardwareInstance);
+  if (Status == EFI_UNSUPPORTED) {
+Private->Descriptor.HardwareInstance = 0;
+  }
+
+  //
+  // Generate UEFI Variable names used to store status information for this
+  // FMP instance.
+  //
+  GenerateFmpVariableNames (Private);
+
   //
   // Get the version.  Some devices don't support getting the firmware version
   // at runtime.  If FmpDeviceLib does not support returning a version, then
@@ -273,7 +294,7 @@ PopulateDescriptor (
   Status = FmpDeviceGetVersion (>Descriptor.Version);
   if (Status == EFI_UNSUPPORTED) {
 Private->RuntimeVersionSupported = FALSE;
-Private->Descriptor.Version = GetVersionFromVariable();
+Private->Descriptor.Version = GetVersionFromVariable (Private);
   } else if (EFI_ERROR (Status)) {
 //
 // Unexpected error.   Use default version.
@@ -309,7 +330,7 @@ PopulateDescriptor (
 );
   }
 
-  Private->Descriptor.LowestSupportedImageVersion = 
GetLowestSupportedVersion();
+  Private->Descriptor.LowestSupportedImageVersion = GetLowestSupportedVersion 
(Private);
 
   //
   // Get attributes from the FmpDeviceLib
@@ -341,16 +362,8 @@ PopulateDescriptor (
 Private->Descriptor.Size = 0;
   }
 
-  Private->Descriptor.LastAttemptVersion = GetLastAttemptVersionFromVariable 
();
-  Private->Descriptor.LastAttemptStatus  = GetLastAttemptStatusFromVariable ();
-
-  //
-  // Get the hardware instance from FmpDeviceLib
-  //
-  Status = FmpDeviceGetHardwareInstance 
(>Descriptor.HardwareInstance);
-  if (Status == EFI_UNSUPPORTED) {
-Private->Descriptor.HardwareInstance = 0;
-  }
+  Private->Descriptor.LastAttemptVersion = GetLastAttemptVersionFromVariable 
(Private);
+  Private->Descriptor.LastAttemptStatus  = GetLastAttemptStatusFromVariable 
(Private);
 
   Private->DescriptorPopulated = TRUE;
 }
@@ -453,7 +466,7 @@ GetTheImageInfo (
   *ImageInfoSize = sizeof (EFI_FIRMWARE_IMAGE_DESCRIPTOR);
 
   //
-  // make sure the descriptor has already been loaded
+  // Make sure the descriptor has already been loaded or refreshed
   //
   PopulateDescriptor (Private);
 
@@ -696,7 +709,7 @@ CheckTheImage (
   FmpDeviceSetContext (Private->Handle, >FmpDeviceContext);
 
   //
-  // make sure the descriptor has already been loaded
+  // Make sure the descriptor has already been loaded or refreshed
   //
   PopulateDescriptor (Private);
 
@@ -949,7 +962,15 @@ SetTheImage (
   Private = 

[edk2-devel] [PATCH V2 03/10] FmpDEvicePkg/FmpDeviceLibNull: Implement new APIs

2019-08-11 Thread Eric Jin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Liming Gao 
Signed-off-by: Michael D Kinney 
Reviewed-by: Eric Jin 
---
 .../Library/FmpDeviceLibNull/FmpDeviceLib.c   | 93 ++-
 1 file changed, 92 insertions(+), 1 deletion(-)

diff --git a/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c 
b/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c
index c9fcb84b20..fd219cb70b 100644
--- a/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c
+++ b/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c
@@ -3,7 +3,7 @@
   image stored in a firmware device.
 
   Copyright (c) 2016, Microsoft Corporation. All rights reserved.
-  Copyright (c) 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -40,6 +40,68 @@ RegisterFmpInstaller (
   return EFI_UNSUPPORTED;
 }
 
+/**
+  Provide a function to uninstall the Firmware Management Protocol instance 
from a
+  device handle when the device is managed by a driver that follows the UEFI
+  Driver Model.  If the device is not managed by a driver that follows the UEFI
+  Driver Model, then EFI_UNSUPPORTED is returned.
+
+  @param[in] FmpUninstaller  Function that installs the Firmware Management
+ Protocol.
+
+  @retval EFI_SUCCESS  The device is managed by a driver that follows the
+   UEFI Driver Model.  FmpUinstaller must be called on
+   each Driver Binding Stop().
+  @retval EFI_UNSUPPORTED  The device is not managed by a driver that follows
+   the UEFI Driver Model.
+  @retval otherThe Firmware Management Protocol for this firmware
+   device is not installed.  The firmware device is
+   still locked using FmpDeviceLock().
+
+**/
+EFI_STATUS
+EFIAPI
+RegisterFmpUninstaller (
+  IN FMP_DEVICE_LIB_REGISTER_FMP_UNINSTALLER  Function
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  Set the device context for the FmpDeviceLib services when the device is
+  managed by a driver that follows the UEFI Driver Model.  If the device is not
+  managed by a driver that follows the UEFI Driver Model, then EFI_UNSUPPORTED
+  is returned.  Once a device context is set, the FmpDeviceLib services
+  operate on the currently set device context.
+
+  @param[in]  Handle   Device handle for the FmpDeviceLib services.
+   If Handle is NULL, then Context is freed.
+  @param[in, out] Context  Device context for the FmpDeviceLib services.
+   If Context is NULL, then a new context is allocated
+   for Handle and the current device context is set and
+   returned in Context.  If Context is not NULL, then
+   the current device context is set.
+
+  @retval EFI_SUCCESS  The device is managed by a driver that follows the
+   UEFI Driver Model.
+  @retval EFI_UNSUPPORTED  The device is not managed by a driver that follows
+   the UEFI Driver Model.
+  @retval otherThe Firmware Management Protocol for this firmware
+   device is not installed.  The firmware device is
+   still locked using FmpDeviceLock().
+
+**/
+EFI_STATUS
+EFIAPI
+FmpDeviceSetContext (
+  IN EFI_HANDLE  Handle,
+  IN OUT VOID**Context
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
 /**
   Returns the size, in bytes, of the firmware image currently stored in the
   firmware device.  This function is used to by the GetImage() and
@@ -244,6 +306,35 @@ FmpDeviceGetVersion (
   return EFI_UNSUPPORTED;
 }
 
+/**
+  Returns the value used to fill in the HardwareInstance field of the
+  EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is returned by the 
GetImageInfo()
+  service of the Firmware Management Protocol.  If EFI_SUCCESS is returned, 
then
+  the firmware device supports a method to report the HardwareInstance value.
+  If the value can not be reported for the firmware device, then 
EFI_UNSUPPORTED
+  must be returned.  EFI_DEVICE_ERROR is returned if an error occurs attempting
+  to retrieve the HardwareInstance value for the firmware device.
+
+  @param[out] HardwareInstance  The hardware instance value for the firmware
+device.
+
+  @retval EFI_SUCCESS   The hardware instance for the current firmware
+devide is returned in HardwareInstance.
+  @retval EFI_UNSUPPORTED   The firmware device does not support a method to
+report the hardware instance value.
+  @retval EFI_DEVICE_ERROR  An error occurred attempting to retrieve the 
hardware
+instance value.
+
+**/
+EFI_STATUS
+EFIAPI
+FmpDeviceGetHardwareInstance (
+  OUT UINT64  

[edk2-devel] [PATCH V2 04/10] FmpDevicePkg/FmpDxe: Use new FmpDeviceLib APIs

2019-08-11 Thread Eric Jin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525

Update FmpDxe to support multiple controllers and use
new FmpDeviceLib APIs to support Stop/Unload and to
set the context for the worker functions in the
FmpDeviceLib.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Liming Gao 
Signed-off-by: Michael D Kinney 
Reviewed-by: Eric Jin 
---
 FmpDevicePkg/FmpDxe/FmpDxe.c  | 586 +++---
 FmpDevicePkg/FmpDxe/FmpDxe.h  | 341 +
 FmpDevicePkg/FmpDxe/FmpDxe.inf|   4 +-
 FmpDevicePkg/FmpDxe/FmpDxeLib.inf |   4 +-
 4 files changed, 715 insertions(+), 220 deletions(-)
 create mode 100644 FmpDevicePkg/FmpDxe/FmpDxe.h

diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
index f485f5b939..dab3310834 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -4,46 +4,13 @@
   information provided through PCDs and libraries.
 
   Copyright (c) 2016, Microsoft Corporation. All rights reserved.
-  Copyright (c) 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include "VariableSupport.h"
-
-#define VERSION_STRING_NOT_SUPPORTED  L"VERSION STRING NOT SUPPORTED"
-#define VERSION_STRING_NOT_AVAILABLE  L"VERSION STRING NOT AVAILABLE"
-
-/**
-  Check to see if any of the keys in PcdFmpDevicePkcs7CertBufferXdr matches
-  the test key.  PcdFmpDeviceTestKeySha256Digest contains the SHA256 hash of
-  the test key.  For each key in PcdFmpDevicePkcs7CertBufferXdr, compute the
-  SHA256 hash and compare it to PcdFmpDeviceTestKeySha256Digest.  If the
-  SHA256 hash matches or there is then error computing the SHA256 hash, then
-  set PcdTestKeyUsed to TRUE.  Skip this check if PcdTestKeyUsed is already
-  TRUE or PcdFmpDeviceTestKeySha256Digest is not exactly SHA256_DIGEST_SIZE
-  bytes.
-**/
-VOID
-DetectTestKey (
-  VOID
-  );
+#include "FmpDxe.h"
 
 ///
 /// FILE_GUID from FmpDxe.inf.  When FmpDxe.inf is used in a platform, the
@@ -56,30 +23,73 @@ const EFI_GUID  mDefaultModuleFileGuid = {
   0x78ef0a56, 0x1cf0, 0x4535, { 0xb5, 0xda, 0xf6, 0xfd, 0x2f, 0x40, 0x5a, 0x11 
}
 };
 
-EFI_FIRMWARE_IMAGE_DESCRIPTOR  mDesc;
-BOOLEANmDescriptorPopulated = FALSE;
-BOOLEANmRuntimeVersionSupported = TRUE;
-BOOLEANmFmpInstalled= FALSE;
-
 ///
-/// Function pointer to progress function
+/// TRUE if FmpDeviceLib manages a single firmware storage device.
 ///
-EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS  mProgressFunc  = NULL;
-BOOLEANmProgressSupported = FALSE;
+BOOLEAN  mFmpSingleInstance = FALSE;
 
-CHAR16  *mImageIdName = NULL;
-UINT64  mImageId  = 0x1;
-CHAR16  *mVersionName = NULL;
+///
+/// Firmware Management Protocol instance that is initialized in the entry
+/// point from PCD settings.
+///
+EDKII_FIRMWARE_MANAGEMENT_PROGRESS_PROTOCOL  mFmpProgress;
 
-EFI_EVENT  mFmpDeviceLockEvent;
 //
-// Indicates if an attempt has been made to lock a
-// FLASH storage device by calling FmpDeviceLock().
-// A FLASH storage device may not support being locked,
-// so this variable is set to TRUE even if FmpDeviceLock()
-// returns an error.
+// Template of the private context structure for the Firmware Management
+// Protocol instance
 //
-BOOLEANmFmpDeviceLocked = FALSE;
+const FIRMWARE_MANAGEMENT_PRIVATE_DATA  mFirmwareManagementPrivateDataTemplate 
= {
+  FIRMWARE_MANAGEMENT_PRIVATE_DATA_SIGNATURE,  // Signature
+  NULL,// Handle
+  {// Fmp
+GetTheImageInfo,
+GetTheImage,
+SetTheImage,
+CheckTheImage,
+GetPackageInfo,
+SetPackageInfo
+  },
+  FALSE,   // DescriptorPopulated
+  {// Desc
+1, // ImageIndex
+//
+// ImageTypeId
+//
+{ 0x, 0x, 0x, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00} },
+1, // ImageId
+NULL,  // ImageIdName
+0, // Version
+NULL,  // VersionName
+0, // Size
+0, // AttributesSupported
+0, // AttributesSetting
+0, // Compatibilities
+0, // LowestSupportedImageVersion
+0, // LastAttemptVersion
+0, // LastAttemptStatus
+0  // HardwareInstance
+  },
+  NULL,// ImageIdName
+  NULL,// VersionName
+  TRUE,// RuntimeVersionSupported
+  NULL,// FmpDeviceLockEvent
+  FALSE// FmpDeviceLocked
+};
+
+///
+/// GUID that is 

Re: [edk2-devel] [PATCH 1/3] MdeModulePkg: Add missing header files in INF files

2019-08-11 Thread Wu, Hao A
> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Zhang, Shenglei
> Sent: Thursday, August 08, 2019 2:25 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J; Wu, Hao A; Gao, Liming
> Subject: [edk2-devel] [PATCH 1/3] MdeModulePkg: Add missing header files
> in INF files
> 
> The header files are used but missing in INF,which causes
> generating warning message when building them.
> 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Liming Gao 
> Signed-off-by: Shenglei Zhang 
> ---
>  MdeModulePkg/Universal/CapsulePei/CapsulePei.inf| 1 +
>  MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf | 7 +++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> b/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> index 786c41163304..adf9f1502d69 100644
> --- a/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> +++ b/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> @@ -33,6 +33,7 @@ [Sources]
>UefiCapsule.c
>Capsule.h
>Common/CapsuleCoalesce.c
> +  Common/CommonHeader.h


File 'Common/CapsuleCoalesce.c' is referring the header
'Common/CommonHeader.h'.

The patch updates CapsulePei.inf, but there is a similar case in
CapsuleX64.inf as well.

Could you help to check whether such change is needed there?


> 
>  [Packages]
>MdePkg/MdePkg.dec
> diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
> b/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
> index af002bd98e99..2a4e256063a6 100644
> --- a/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
> +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
> @@ -28,6 +28,13 @@ [Sources]
>EbcDebugger/EdbCommon.h
>EbcDebugger/EdbSupportString.c
>EbcDebugger/EdbSupport.h
> +  EbcDebugger/EdbCommand.h
> +  EbcDebugger/EdbHook.h
> +  EbcDebugger/Edb.h
> +  EbcDebugger/EdbDisasmSupport.h
> +  EbcDebugger/EdbDisasm.h
> +  EbcDebugger/EdbSymbol.h
> +  EbcDebuggerHook.h


Could you help to check whether the below 3 INF files within
MdeModulePkg/Universal/EbcDxe have listed all used files in them?

(At least, I think there might be something missing in EbcDxe.inf)

Best Regards,
Hao Wu


> 
>  [Packages]
>MdePkg/MdePkg.dec
> --
> 2.18.0.windows.1
> 
> 
> 


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

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



[edk2-devel] [PATCH V2 02/10] FmpDevicePkg: Add APIs to FmpDeviceLib

2019-08-11 Thread Eric Jin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525
Add new APIs to FmpDevideLib to support multiple controllers
* RegisterFmpUninstaller()
* FmpDeviceSetContext()
* FmpDeviceGetHardwareInstance()

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Liming Gao 
Signed-off-by: Michael D Kinney 
Reviewed-by: Eric Jin 
---
 FmpDevicePkg/Include/Library/FmpDeviceLib.h | 104 +++-
 1 file changed, 103 insertions(+), 1 deletion(-)

diff --git a/FmpDevicePkg/Include/Library/FmpDeviceLib.h 
b/FmpDevicePkg/Include/Library/FmpDeviceLib.h
index c435b23030..1e498c13ce 100644
--- a/FmpDevicePkg/Include/Library/FmpDeviceLib.h
+++ b/FmpDevicePkg/Include/Library/FmpDeviceLib.h
@@ -3,7 +3,7 @@
   image stored in a firmware device.
 
   Copyright (c) 2016, Microsoft Corporation. All rights reserved.
-  Copyright (c) 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -34,6 +34,26 @@ EFI_STATUS
   IN  EFI_HANDLE  Handle
   );
 
+/**
+  Callback function that uninstalls a Firmware Management Protocol instance 
from
+  a handle.
+
+  @param[in]  Handle  The device handle to uninstall a Firmware Management
+  Protocol instance.
+
+  @retval  EFI_SUCCESSA Firmware Management Protocol instance was
+  uninstalled from Handle.
+  @retval  EFI_INVALID_PARAMETER  Handle is invalid
+  @retval  other  A Firmware Management Protocol instance could
+  not be uninstalled from Handle.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *FMP_DEVICE_LIB_REGISTER_FMP_UNINSTALLER)(
+  IN  EFI_HANDLE  Handle
+  );
+
 /**
   Provide a function to install the Firmware Management Protocol instance onto 
a
   device handle when the device is managed by a driver that follows the UEFI
@@ -59,6 +79,62 @@ RegisterFmpInstaller (
   IN FMP_DEVICE_LIB_REGISTER_FMP_INSTALLER  FmpInstaller
   );
 
+/**
+  Provide a function to uninstall the Firmware Management Protocol instance 
from a
+  device handle when the device is managed by a driver that follows the UEFI
+  Driver Model.  If the device is not managed by a driver that follows the UEFI
+  Driver Model, then EFI_UNSUPPORTED is returned.
+
+  @param[in] FmpUninstaller  Function that installs the Firmware Management
+ Protocol.
+
+  @retval EFI_SUCCESS  The device is managed by a driver that follows the
+   UEFI Driver Model.  FmpUinstaller must be called on
+   each Driver Binding Stop().
+  @retval EFI_UNSUPPORTED  The device is not managed by a driver that follows
+   the UEFI Driver Model.
+  @retval otherThe Firmware Management Protocol for this firmware
+   device is not installed.  The firmware device is
+   still locked using FmpDeviceLock().
+
+**/
+EFI_STATUS
+EFIAPI
+RegisterFmpUninstaller (
+  IN FMP_DEVICE_LIB_REGISTER_FMP_UNINSTALLER  FmpUninstaller
+  );
+
+/**
+  Set the device context for the FmpDeviceLib services when the device is
+  managed by a driver that follows the UEFI Driver Model.  If the device is not
+  managed by a driver that follows the UEFI Driver Model, then EFI_UNSUPPORTED
+  is returned.  Once a device context is set, the FmpDeviceLib services
+  operate on the currently set device context.
+
+  @param[in]  Handle   Device handle for the FmpDeviceLib services.
+   If Handle is NULL, then Context is freed.
+  @param[in, out] Context  Device context for the FmpDeviceLib services.
+   If Context is NULL, then a new context is allocated
+   for Handle and the current device context is set and
+   returned in Context.  If Context is not NULL, then
+   the current device context is set.
+
+  @retval EFI_SUCCESS  The device is managed by a driver that follows the
+   UEFI Driver Model.
+  @retval EFI_UNSUPPORTED  The device is not managed by a driver that follows
+   the UEFI Driver Model.
+  @retval otherThe Firmware Management Protocol for this firmware
+   device is not installed.  The firmware device is
+   still locked using FmpDeviceLock().
+
+**/
+EFI_STATUS
+EFIAPI
+FmpDeviceSetContext (
+  IN EFI_HANDLE  Handle,
+  IN OUT VOID**Context
+  );
+
 /**
   Returns the size, in bytes, of the firmware image currently stored in the
   firmware device.  This function is used to by the GetImage() and
@@ -232,6 +308,32 @@ FmpDeviceGetVersion (
   OUT UINT32  *Version
   );
 
+/**
+  Returns the value used to fill in the HardwareInstance field of the
+  EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is returned by the 
GetImageInfo()
+  service of the 

Re: [edk2-devel] [PATCH] SourceLevelDebugPkg DebugCommLibUsb3: Address NULL ptr dereference case

2019-08-11 Thread Wu, Hao A
> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Zeng, Star
> Sent: Friday, August 09, 2019 9:54 AM
> To: devel@edk2.groups.io
> Cc: Zeng, Star; Wu, Hao A
> Subject: [edk2-devel] [PATCH] SourceLevelDebugPkg DebugCommLibUsb3:
> Address NULL ptr dereference case
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2051
> 
> Original code GetConfigTable for AddrPtr first, if failed,
> InstalConfigTable with allocated AddrPtr. So the AddrPtr
> should not be NULL and the NULL pointer dereference case
> should be false positive. This patch is just to address
> the case raised from static analysis.
> 
> Cc: Hao A Wu 
> Signed-off-by: Star Zeng 
> ---
>  .../DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c| 2
> +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCom
> municationLibUsb3Dxe.c
> b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCom
> municationLibUsb3Dxe.c
> index eee30c852ffd..d4245465ce74 100644
> ---
> a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCom
> municationLibUsb3Dxe.c
> +++
> b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCom
> municationLibUsb3Dxe.c
> @@ -447,7 +447,7 @@ DebugCommunicationUsb3DxeConstructor (
>EFI_EVENT Event;
> 
>Status = EfiGetSystemConfigurationTable (, (VOID **)
> );
> -  if (EFI_ERROR (Status)) {
> +  if (EFI_ERROR (Status) || (AddrPtr == NULL)) {


Reviewed-by: Hao A Wu 
And pushed via commit 4053587347.

Best Regards,
Hao Wu


>  //
>  // Instead of using local variables, install system configuration table 
> for
>  // the local instance and the buffer to save instance address pointer.
> --
> 2.21.0.windows.1
> 
> 
> 


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

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



[edk2-devel] [PATCH V2 01/10] FmpDevicePkg: Add UEFI_DRIVER support

2019-08-11 Thread Eric Jin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525
Allow libs to be used with modules of type UEFI_DRIVE.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Liming Gao 
Signed-off-by: Michael D Kinney 
Reviewed-by: Eric Jin 
---
 FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf| 4 ++--
 .../Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf 
b/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf
index 956d2258aa..9c77e5bde0 100644
--- a/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf
+++ b/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf
@@ -3,7 +3,7 @@
 #  image stored in a firmware device.
 #
 #  Copyright (c) 2016, Microsoft Corporation. All rights reserved.
-#  Copyright (c) 2018, Intel Corporation. All rights reserved.
+#  Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
@@ -15,7 +15,7 @@
   FILE_GUID   = 8507642B-AE92-4664-B713-807F7774A96D
   MODULE_TYPE = DXE_DRIVER
   VERSION_STRING  = 1.0
-  LIBRARY_CLASS   = FmpDeviceLib|DXE_DRIVER
+  LIBRARY_CLASS   = FmpDeviceLib|DXE_DRIVER UEFI_DRIVER
 
 #
 # The following information is for reference only and not required by the 
build tools.
diff --git 
a/FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf 
b/FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf
index d1bfbb6bd8..0d6692dcec 100644
--- a/FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf
+++ b/FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf
@@ -6,7 +6,7 @@
 #  may be added to this library class to retrieve the new information.
 #
 #  Copyright (c) 2016, Microsoft Corporation. All rights reserved.
-#  Copyright (c) 2018, Intel Corporation. All rights reserved.
+#  Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
@@ -17,7 +17,7 @@
   FILE_GUID  = 98A79A6C-513C-4E72-8375-39C0A7244C4B
   MODULE_TYPE= DXE_DRIVER
   VERSION_STRING = 1.0
-  LIBRARY_CLASS  = FmpPayloadHeaderLib|DXE_DRIVER 
UEFI_APPLICATION
+  LIBRARY_CLASS  = FmpPayloadHeaderLib|DXE_DRIVER UEFI_DRIVER 
UEFI_APPLICATION
 
 #
 #  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
-- 
2.20.1.windows.1


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

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



[edk2-devel] [PATCH V2 00/10] Multiple Controllers Support solution

2019-08-11 Thread Eric Jin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525

The patch set is to support drivers that manage multiple controllers and
also provide a firmware update capability to each managed controller.

The following modules are related to Multiple Controllers Support solution

FmpDevicePkg\FmpDxe\FmpDxe.inf - Driver to manage multiple controllers and 
provide
the firmware update capability to each managed controller.
FmpDevicePkg\CapsuleUpdatePolicyDxe\CapsuleUpdatePolicyDxe.inf - Driver to 
produce
the Capsule Update Policy Protocol using the services of the 
CapsuleUpdatePolicyLib
class. The protocol is a private interface to the FmpDevicePkg
FmpDevicePkg\Library\CapsuleUpdatePolicyLibOnProtocol\CapsuleUpdatePolicyLibOnProtocol.inf
 -
CapsuleUpdatePolicyLib instance that uses the services of the Capsule Update 
Policy
Protocol produced by CapsuleUpdatePolicyDxe
FmpDevicePkg\Library\CapsuleUpdatePolicyLibNull\CapsuleUpdatePolicyLibNull.inf 
- 
Null CapsuleUpdatePolicyLib instance and the template for platform specific 
implementation
FmpDevicePkg\Library\FmpDeviceLibNull\FmpDeviceLibNull.inf - Null FmpDeviceLib
instance and the template for platform specific implementation

Eric Jin (10):
  FmpDevicePkg: Add UEFI_DRIVER support
  FmpDevicePkg: Add APIs to FmpDeviceLib
  FmpDEvicePkg/FmpDeviceLibNull: Implement new APIs
  FmpDevicePkg/FmpDxe: Use new FmpDeviceLib APIs
  FmpDevicePkg/FmpDxe: Different variable for each FMP Descriptor
  FmpDevicePkg: Add Capsule Update Policy Protocol
  FmpDevicePkg/FmpDxe: Improve all DEBUG() messages
  FmpDevicePkg/FmpDxe: Add PcdFmpDeviceImageTypeIdGuid
  FmpDevicePkg/FmpDxe: Add PcdFmpDeviceStorageAccessEnable
  FmpDevicePkg/FmpDxe: Remove use of CatSprint()

 .../CapsuleUpdatePolicyDxe.c  | 173 
 .../CapsuleUpdatePolicyDxe.h  | 140 +++
 .../CapsuleUpdatePolicyDxe.inf|  48 +
 .../CapsuleUpdatePolicyDxe.uni|  14 +
 .../CapsuleUpdatePolicyDxeExtra.uni   |  14 +
 FmpDevicePkg/FmpDevicePkg.dec |  43 +-
 FmpDevicePkg/FmpDevicePkg.dsc |  64 +-
 FmpDevicePkg/FmpDevicePkg.uni |  16 +-
 FmpDevicePkg/FmpDxe/DetectTestKey.c   |  16 +-
 FmpDevicePkg/FmpDxe/FmpDxe.c  | 792 ++--
 FmpDevicePkg/FmpDxe/FmpDxe.h  | 355 
 FmpDevicePkg/FmpDxe/FmpDxe.inf|   7 +-
 FmpDevicePkg/FmpDxe/FmpDxeLib.inf |   7 +-
 FmpDevicePkg/FmpDxe/VariableSupport.c | 844 +-
 FmpDevicePkg/FmpDxe/VariableSupport.h | 135 ++-
 FmpDevicePkg/Include/Library/FmpDeviceLib.h   | 104 ++-
 .../CapsuleUpdatePolicyLibOnProtocol.c| 171 
 .../CapsuleUpdatePolicyLibOnProtocol.inf  |  40 +
 .../CapsuleUpdatePolicyLibOnProtocol.uni  |  15 +
 .../Library/FmpDeviceLibNull/FmpDeviceLib.c   |  93 +-
 .../FmpDeviceLibNull/FmpDeviceLibNull.inf |   4 +-
 .../FmpPayloadHeaderLibV1.inf |   4 +-
 .../Library/FmpPayloadHeaderLib.h |   0
 .../Protocol/CapsuleUpdatePolicy.h| 132 +++
 24 files changed, 2644 insertions(+), 587 deletions(-)
 create mode 100644 FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.c
 create mode 100644 FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.h
 create mode 100644 
FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.inf
 create mode 100644 
FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.uni
 create mode 100644 
FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxeExtra.uni
 create mode 100644 FmpDevicePkg/FmpDxe/FmpDxe.h
 create mode 100644 
FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.c
 create mode 100644 
FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.inf
 create mode 100644 
FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.uni
 rename FmpDevicePkg/{Include => PrivateInclude}/Library/FmpPayloadHeaderLib.h 
(100%)
 create mode 100644 FmpDevicePkg/PrivateInclude/Protocol/CapsuleUpdatePolicy.h

-- 
2.20.1.windows.1


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

View/Reply Online (#45329): https://edk2.groups.io/g/devel/message/45329
Mute This Topic: https://groups.io/mt/32836322/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] Vlv2TbltDevicePkg/FmpDeviceLib: Implement new APIs

2019-08-11 Thread Eric Jin
Implement new APIs defined in FmpDeviceLib
* RegisterFmpUninstaller()
* FmpDeviceSetContext()
* FmpDeviceGetHardwareInstance()

Cc: Zailiang Sun 
Cc: Yi Qian 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Eric Jin 
---
 .../Library/FmpDeviceLib/FmpDeviceLib.c   | 95 ++
 .../Library/FmpDeviceLibSample/FmpDeviceLib.c | 99 ++-
 2 files changed, 192 insertions(+), 2 deletions(-)

diff --git 
a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/Library/FmpDeviceLib/FmpDeviceLib.c
 
b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/Library/FmpDeviceLib/FmpDeviceLib.c
index 57185d8d09..d8c9036012 100644
--- 
a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/Library/FmpDeviceLib/FmpDeviceLib.c
+++ 
b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/Library/FmpDeviceLib/FmpDeviceLib.c
@@ -66,6 +66,73 @@ RegisterFmpInstaller (
   return EFI_UNSUPPORTED;
 }
 
+/**
+  Provide a function to uninstall the Firmware Management Protocol instance 
from a
+  device handle when the device is managed by a driver that follows the UEFI
+  Driver Model.  If the device is not managed by a driver that follows the UEFI
+  Driver Model, then EFI_UNSUPPORTED is returned.
+
+  @param[in] FmpUninstaller  Function that installs the Firmware Management
+ Protocol.
+
+  @retval EFI_SUCCESS  The device is managed by a driver that follows the
+   UEFI Driver Model.  FmpUinstaller must be called on
+   each Driver Binding Stop().
+  @retval EFI_UNSUPPORTED  The device is not managed by a driver that follows
+   the UEFI Driver Model.
+  @retval otherThe Firmware Management Protocol for this firmware
+   device is not installed.  The firmware device is
+   still locked using FmpDeviceLock().
+
+**/
+EFI_STATUS
+EFIAPI
+RegisterFmpUninstaller (
+  IN FMP_DEVICE_LIB_REGISTER_FMP_UNINSTALLER  FmpUninstaller
+  )
+{
+  //
+  // This is a system firmware update that does not use Driver Binding Protocol
+  //
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  Set the device context for the FmpDeviceLib services when the device is
+  managed by a driver that follows the UEFI Driver Model.  If the device is not
+  managed by a driver that follows the UEFI Driver Model, then EFI_UNSUPPORTED
+  is returned.  Once a device context is set, the FmpDeviceLib services
+  operate on the currently set device context.
+
+  @param[in]  Handle   Device handle for the FmpDeviceLib services.
+   If Handle is NULL, then Context is freed.
+  @param[in, out] Context  Device context for the FmpDeviceLib services.
+   If Context is NULL, then a new context is allocated
+   for Handle and the current device context is set and
+   returned in Context.  If Context is not NULL, then
+   the current device context is set.
+
+  @retval EFI_SUCCESS  The device is managed by a driver that follows the
+   UEFI Driver Model.
+  @retval EFI_UNSUPPORTED  The device is not managed by a driver that follows
+   the UEFI Driver Model.
+  @retval otherThe Firmware Management Protocol for this firmware
+   device is not installed.  The firmware device is
+   still locked using FmpDeviceLock().
+
+**/
+EFI_STATUS
+EFIAPI
+FmpDeviceSetContext (
+  IN EFI_HANDLE  Handle,
+  IN OUT VOID**Context
+  )
+{
+  //
+  // This is a system firmware update that does not use Driver Binding Protocol
+  //
+  return EFI_UNSUPPORTED;
+}
 
 /**
   Returns the size, in bytes, of the firmware image currently stored in the
@@ -289,6 +356,34 @@ FmpDeviceGetVersion (
   return EFI_SUCCESS;
 }
 
+/**
+  Returns the value used to fill in the HardwareInstance field of the
+  EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is returned by the 
GetImageInfo()
+  service of the Firmware Management Protocol.  If EFI_SUCCESS is returned, 
then
+  the firmware device supports a method to report the HardwareInstance value.
+  If the value can not be reported for the firmware device, then 
EFI_UNSUPPORTED
+  must be returned.  EFI_DEVICE_ERROR is returned if an error occurs attempting
+  to retrieve the HardwareInstance value for the firmware device.
+
+  @param[out] HardwareInstance  The hardware instance value for the firmware
+device.
+
+  @retval EFI_SUCCESS   The hardware instance for the current firmware
+devide is returned in HardwareInstance.
+  @retval EFI_UNSUPPORTED   The firmware device does not support a method to
+report the hardware instance value.
+  @retval EFI_DEVICE_ERROR  An error occurred attempting to retrieve the 
hardware
+instance value.
+
+**/

Re: [edk2-devel] [edk2-platforms] [PATCH v2] Platform/Intel: Update Readme.md to point to edk2-non-osi master branch

2019-08-11 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 


> -Original Message-
> From: Desimone, Nathaniel L
> Sent: Monday, August 12, 2019 7:45 AM
> To: devel@edk2.groups.io
> Cc: Andrew Fish ; Laszlo Ersek ; Leif
> Lindholm ; Kinney, Michael D
> ; Kubacki, Michael A
> ; Sinha, Ankit ; Chiu,
> Chasel 
> Subject: [edk2-platforms] [PATCH v2] Platform/Intel: Update Readme.md to
> point to edk2-non-osi master branch
> 
> Updated Platform/Intel/Readme.md to point to master branch on
> edk2-non-osi instead of devel-MinPlatform
> 
> Updated edk2-platforms/Readme.md to point to Platform/Intel/Readme.md
> for build instructions on Intel based Minimum Platforms
> 
> Added a link to the EDK II Minimum Platform Draft Specification to
> Platform/Intel/Readme.md
> 
> Cc: Andrew Fish 
> Cc: Laszlo Ersek 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Cc: Michael Kubacki 
> Cc: Ankit Sinha 
> Cc: Chasel Chiu 
> Signed-off-by: Nate DeSimone 
> ---
>  Platform/Intel/Readme.md | 6 --
>  Readme.md| 4 ++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/Platform/Intel/Readme.md b/Platform/Intel/Readme.md index
> 0a0e8a8c80..00f42985a2 100644
> --- a/Platform/Intel/Readme.md
> +++ b/Platform/Intel/Readme.md
> @@ -1,7 +1,9 @@
>  # **EDK II Minimum Platform Firmware for Intel(R) Platforms**
> 
>  The Minimum Platform is a software architecture that guides uniform delivery
> of Intel platforms enabling firmware -solutions for basic boot functionality
> with extensibility built-in.
> +solutions for basic boot functionality with extensibility built-in.
> +Please see the [EDK II Minimum Platform Draft
> +Specification](https://edk2-docs.gitbooks.io/edk-ii-minimum-platform-sp
> +ecification/)
> +for more details.
> 
>  Package maintainers for the Minimum Platform projects are listed in
> Maintainers.txt.
> 
> @@ -98,7 +100,7 @@ return back to the minimum platform caller.
>* ``git clone https://github.com/tianocore/edk2-platforms.git``
> 
>  * edk2-non-osi repository
> -  * ``git clone https://github.com/tianocore/edk2-non-osi.git -b
> devel-MinPlatform``
> +  * ``git clone https://github.com/tianocore/edk2-non-osi.git``
> 
>  * FSP repository
>* ``git clone https://github.com/IntelFsp/FSP.git``
> diff --git a/Readme.md b/Readme.md
> index 63e59f60b4..1befd0b544 100644
> --- a/Readme.md
> +++ b/Readme.md
> @@ -223,8 +223,8 @@ they will be documented with the platform.
>  * [D05](Platform/Hisilicon/D05)
>  * [HiKey](Platform/Hisilicon/HiKey)
> 
> -## [Intel](Platform/Intel/Readme.md)
> -### Minimum Platforms
> +## Intel
> +### [Minimum Platforms](Platform/Intel/Readme.md)
>  * [Clevo](Platform/Intel/ClevoOpenBoardPkg)
>  * [Kaby Lake](Platform/Intel/KabylakeOpenBoardPkg)
>  * [Purley](Platform/Intel/PurleyOpenBoardPkg)
> --
> 2.17.1.windows.2


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

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



[edk2-devel] [PATCH] ShellPkg/UefiShellLevel2CommansLib: Pointer Resonse should be checked

2019-08-11 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2049

ShellPkg\Library\UefiShellLevel2CommandsLib\Cp.c line 104 and
ShellPkg\Library\UefiShellLevel2CommandsLib\Mv.c line 640, the
pointer variable Response may be a NULL pointer. So we should
make sure that it isn't NULL before dereference it.

If Response is NULL that indicates a EFI_OUT_OF_RESOURCES
error, directly return SHELL_ABORTED.

Cc: Jaben Carsey 
Cc: Ray Ni 
Signed-off-by: Zhichao Gao 
---
 ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c | 5 -
 ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c | 5 -
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c 
b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
index 18b05b5803..4a2c2cfe64 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
@@ -2,7 +2,7 @@
   Main file for cp shell level 2 function.
 
   (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
-  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -101,6 +101,9 @@ CopySingleFile(
 // possibly return based on response
 //
 if (!SilentMode) {
+  if (Response == NULL) {
+return SHELL_ABORTED;
+  }
   switch (*(SHELL_PROMPT_RESPONSE*)Response) {
 case ShellPromptResponseNo:
   //
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c 
b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
index 8c2852d7eb..f50c1e4c20 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
@@ -2,7 +2,7 @@
   Main file for mv shell level 2 function.
 
   (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
-  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -637,6 +637,9 @@ ValidateAndMoveFiles(
   if (Response == NULL) {
 ShellPromptForResponseHii(ShellPromptResponseTypeYesNoAllCancel, 
STRING_TOKEN (STR_GEN_DEST_EXIST_OVR), gShellLevel2HiiHandle, );
   }
+  if (Response == NULL) {
+return SHELL_ABORTED;
+  }
   switch (*(SHELL_PROMPT_RESPONSE*)Response) {
 case ShellPromptResponseNo:
   FreePool(Response);
-- 
2.21.0.windows.1


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

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



[edk2-devel] gUefiCpuPkgTokenSpaceGuid.PcdCpuApTargetCstate definition confusion?

2019-08-11 Thread Andrew Fish via Groups.Io
I was tracking down a Platform C state bug and I noticed the platform code was 
using this definition [1] for PcdCpuApTargetCstate and wrote that actual value 
used for Mwait. But the MpInitLIb seems to assume that PcdCpuApTargetCstate is 
eax[7:4] and it shifts the data left. This ends up with the value being 0 which 
means C1 for all calculated values. 

So my question is which definition is correct? As far as I can tell eax[3:0] 
are sub C states and thus being able to pass that value would be useful? 

There is other code in the MpLib [3] that is also doing the shift so it seems 
intestinal. But given the PCD definition I can see how the platform code set 
the wrong value. 

[1] PCD Definition
https://github.com/tianocore/edk2/blob/master/UefiCpuPkg/UefiCpuPkg.dec 


  ## Specifies the AP target C-state for Mwait during POST phase.
  #  The default value 0 means C1 state.
  #  The value is defined as below.
  # @Prompt The specified AP target C-state for Mwait.
  gUefiCpuPkgTokenSpaceGuid.PcdCpuApTargetCstate|0|UINT8|0x0007

[2] UefiCpuPkg code
https://github.com/tianocore/edk2/blob/master/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm
 

MwaitLoop:
cli
moveax, esp   ; Set Monitor Address
xorecx, ecx   ; ecx = 0
xoredx, edx   ; edx = 0
monitor
moveax, ebx   ; Mwait Cx, Target C-State per eax[7:4]
shleax, 4
mwait
jmpMwaitLoop


https://github.com/tianocore/edk2/blob/master/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
 

  AsmRelocateApLoopFunc (
MwaitSupport,
CpuMpData->ApTargetCState,
CpuMpData->PmCodeSegment,
mReservedTopOfApStack - ProcessorNumber * AP_SAFE_STACK_SIZE,
(UINTN) 
);
[3] ApTargetCState shifting
https://github.com/tianocore/edk2/blob/master/UefiCpuPkg/Library/MpInitLib/MpLib.c
 

  //
  // Check AP start-up signal again.
  // If AP start-up signal is not set, place AP into
  // the specified C-state
  //
  AsmMwait (CpuMpData->ApTargetCState << 4, 0);

Thanks,

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

View/Reply Online (#45325): https://edk2.groups.io/g/devel/message/45325
Mute This Topic: https://groups.io/mt/32835440/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] ClevoOpenBoardPkg: Remove batch build scripts

2019-08-11 Thread Nate DeSimone
Reviewed-by: Nate DeSimone 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Agyeman, Prince
Sent: Friday, August 9, 2019 9:35 AM
To: devel@edk2.groups.io
Subject: [edk2-devel] [edk2-platforms] [PATCH] ClevoOpenBoardPkg: Remove batch 
build scripts

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

Removed batch build scripts as they are replaced

by build_bios.py

Signed-off-by: Agyeman 
---
 .../ClevoOpenBoardPkg/N1xxWU/GitEdk2Clevo.bat |  79 ---
 .../Intel/ClevoOpenBoardPkg/N1xxWU/bld.bat| 159 -
 .../Intel/ClevoOpenBoardPkg/N1xxWU/cln.bat|  48 
 .../ClevoOpenBoardPkg/N1xxWU/postbuild.bat|  39 
 .../ClevoOpenBoardPkg/N1xxWU/prebuild.bat | 214 --
 .../Intel/ClevoOpenBoardPkg/N1xxWU/prep.bat   |  79 ---
 6 files changed, 618 deletions(-)
 delete mode 100644 Platform/Intel/ClevoOpenBoardPkg/N1xxWU/GitEdk2Clevo.bat
 delete mode 100644 Platform/Intel/ClevoOpenBoardPkg/N1xxWU/bld.bat
 delete mode 100644 Platform/Intel/ClevoOpenBoardPkg/N1xxWU/cln.bat
 delete mode 100644 Platform/Intel/ClevoOpenBoardPkg/N1xxWU/postbuild.bat
 delete mode 100644 Platform/Intel/ClevoOpenBoardPkg/N1xxWU/prebuild.bat
 delete mode 100644 Platform/Intel/ClevoOpenBoardPkg/N1xxWU/prep.bat

diff --git a/Platform/Intel/ClevoOpenBoardPkg/N1xxWU/GitEdk2Clevo.bat 
b/Platform/Intel/ClevoOpenBoardPkg/N1xxWU/GitEdk2Clevo.bat
deleted file mode 100644
index 81f51b3785..00
--- a/Platform/Intel/ClevoOpenBoardPkg/N1xxWU/GitEdk2Clevo.bat
+++ /dev/null
@@ -1,79 +0,0 @@
-@REM @file
-@REM
-@REM Copyright (c) 2019, Intel Corporation. All rights reserved. -@REM 
SPDX-License-Identifier: BSD-2-Clause-Patent -@REM
-
-@echo off
-
-pushd ..\..\..\..\..\
-
-@REM Set WORKSPACE environment.
-set WORKSPACE=%cd%
-echo.
-echo Set WORKSPACE as: %WORKSPACE%
-echo.
-
-@REM Check whether Git has been installed and been added to system path.
-git --help >nul 2>nul
-if %ERRORLEVEL% NEQ 0 (
-  echo.
-  echo The 'git' command is not recognized.
-  echo Please make sure that Git is installed and has been added to system 
path.
-  echo.
-  goto :EOF
-)
-
-@REM Create the Conf directory under WORKSPACE -if not exist %WORKSPACE%\Conf (
-  mkdir Conf
-)
-
-@REM Set other environments.
-@REM Basic Rule:
-@REM   Platform override Silicon override Core
-@REM   Source override Binary
-
-set 
PACKAGES_PATH=%WORKSPACE%\edk2-platforms\Platform\Intel;%WORKSPACE%\edk2-platforms\Silicon\Intel;%WORKSPACE%\edk2-non-osi\Silicon\Intel;%WORKSPACE%\FSP;%WORKSPACE%\edk2;%WORKSPACE%
-set EDK_TOOLS_BIN=%WORKSPACE%\edk2-BaseTools-win32
-
-@if not defined PYTHON_HOME (
-  @if exist C:\Python27 (
-set PYTHON_HOME=C:\Python27
-  )
-)
-
-set EDK_SETUP_OPTION=
-@rem if python is installed, disable the binary base tools.
-if defined PYTHON_HOME (
-  set EDK_TOOLS_BIN=
-  set EDK_SETUP_OPTION=--nt32
-)
-pushd %WORKSPACE%\edk2
-call edksetup.bat %EDK_SETUP_OPTION%
-popd
-pushd %WORKSPACE%
-@rem if python is installed, nmake BaseTools source and enable BaseTools 
source build -@if defined PYTHON_HOME (
-  nmake -f %BASE_TOOLS_PATH%\Makefile
-)
-popd
-
-set openssl_path=%WORKSPACE%
-
-popd
-
-goto :EOF
-
-:Help
-echo.
-echo Usage:
-echo GitEdk2.bat [-w Workspace_Directory] (optional) [-b Branch_Name] 
(optional) -echo.
-echo -wA absolute/relative path to be the workspace.
-echo   Default value is the current directory.
-echo.
-echo -bThe branch name of the repository. Currently, only master, udk2015,
-echo   trunk (same as master) and bp13 (same as udk2015) are supported.
-echo   Default value is master.
-echo.
diff --git a/Platform/Intel/ClevoOpenBoardPkg/N1xxWU/bld.bat 
b/Platform/Intel/ClevoOpenBoardPkg/N1xxWU/bld.bat
deleted file mode 100644
index 606ce979a7..00
--- a/Platform/Intel/ClevoOpenBoardPkg/N1xxWU/bld.bat
+++ /dev/null
@@ -1,159 +0,0 @@
-@REM @file
-@REM
-@REM Copyright (c) 2019, Intel Corporation. All rights reserved. -@REM 
SPDX-License-Identifier: BSD-2-Clause-Patent -@REM
-
-:: Useage: bld [/s] [/f  ] [/r]
-::
-:: For a given build command, 3 options may be passed into this batch file via 
command prompt:
-:: 1) /s = Redirects all output to a file called EDK2.log(Prep.log must be 
existed), which will be located at the root.
-:: 2) /f = Defines the passing in of a single override to a feature PCD that 
is used in the platform
-::DSC file.  If this parameter is used, it is to be followed immediately 
after by both the feature
-::pcd name and value. FeaturePcd is the full PCD name, like 
gMinPlatformPkgTokenSpaceGuid.PcdOptimizeCompilerEnable
-:: 3) /r = Useful for faster rebuilds when no changes have been made to .inf 
files. Passes -u to
-::build.exe to skip the generation of makefiles.
-:: 4) rom = Build Bios.rom only and building SPIs will be skipped.
-::
-
-@echo on
-
-cd %WORKSPACE%
-
-@REM
-@REM Build FSP Binary
-@REM
-@if not defined FSP_BINARY_BUILD goto :SkipFspBinaryBuild -@if 
%FSP_BINARY_BUILD% EQU FALSE goto :SkipFspBinaryBuild -@set 

Re: [edk2-devel] [edk2-platforms] [PATCH] Platform/Intel/KabylakeOpenBoardPkg: Fix build.

2019-08-11 Thread Nate DeSimone
Pushed: 
https://github.com/tianocore/edk2-platforms/commit/84627927fa195703752c7fd5ab4437f87c547b87

-Original Message-
From: Kubacki, Michael A 
Sent: Friday, August 9, 2019 11:13 AM
To: devel@edk2.groups.io; Desimone, Nathaniel L 
Cc: Chiu, Chasel 
Subject: RE: [edk2-devel] [edk2-platforms] [PATCH] 
Platform/Intel/KabylakeOpenBoardPkg: Fix build.

Reviewed-by: Michael Kubacki 

> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of 
> Nate DeSimone
> Sent: Thursday, August 8, 2019 5:47 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Kubacki, Michael A 
> 
> Subject: [edk2-devel] [edk2-platforms] [PATCH]
> Platform/Intel/KabylakeOpenBoardPkg: Fix build.
> 
> The build for KabylakeOpenBoardPkg is presently broken due to 
> WORKSPACE_PLATFORM_BIN being defined to a marco of the same name in 
> KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg
> 
> Setting this macro to an empty string resolves the issue.
> 
> Cc: Chasel Chiu 
> Cc: Michael Kubacki 
> Signed-off-by: Nate DeSimone 
> ---
>  .../Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg| 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg
> index bf89ea399c..ab1a9a61c2 100644
> --- 
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg
> @@ -7,7 +7,7 @@
> 
> 
>  [CONFIG]
> -WORKSPACE_PLATFORM_BIN = WORKSPACE_PLATFORM_BIN
> +WORKSPACE_PLATFORM_BIN =
>  EDK_SETUP_OPTION =
>  openssl_path =
>  PLATFORM_BOARD_PACKAGE = KabylakeOpenBoardPkg
> --
> 2.17.1.windows.2
> 
> 
> 


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

View/Reply Online (#45323): https://edk2.groups.io/g/devel/message/45323
Mute This Topic: https://groups.io/mt/32805602/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] Platform/Intel: Update Readme.md to point to edk2-non-osi master branch

2019-08-11 Thread Nate DeSimone
Hi Leif,

> I am well aware that there are platform-specific steps required to achieve 
> the final firmware image for some
> systems. But we need to work to address that. There have been discussions 
> about implementing support for
> hooking pre/post-build python scripts into the .dsc format - has there been 
> any progress on that?

I'm not sure. Liming would know more on that than I. For now, our 
MinPlatform... platforms are using the
build_bios.py script written by Prince as a substitute.

> For this patch, I would prefer if instead of adding these notes we changed 
> the ## [Intel](Platform/Intel/Readme.md)
> ### Minimum Platforms

Done. Please see patch V2.

> Arguably, it would make sense to move all of the MinPlatform ... platforms 
> ... and the Readme.md to a separate
> subdirectory and link to that directory. Not everything under Platform/Intel 
> is a MinPlatform platform - soon
> there'll even be an ARM one.

I totally agree with you that would make more sense. Could you perhaps send an 
RFC and then we can start
the reorganization process?

Thanks,
Nate

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

View/Reply Online (#45321): https://edk2.groups.io/g/devel/message/45321
Mute This Topic: https://groups.io/mt/32803353/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 v2] Platform/Intel: Update Readme.md to point to edk2-non-osi master branch

2019-08-11 Thread Nate DeSimone
Updated Platform/Intel/Readme.md to point to master branch on
edk2-non-osi instead of devel-MinPlatform

Updated edk2-platforms/Readme.md to point to Platform/Intel/Readme.md
for build instructions on Intel based Minimum Platforms

Added a link to the EDK II Minimum Platform Draft Specification
to Platform/Intel/Readme.md

Cc: Andrew Fish 
Cc: Laszlo Ersek 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Michael Kubacki 
Cc: Ankit Sinha 
Cc: Chasel Chiu 
Signed-off-by: Nate DeSimone 
---
 Platform/Intel/Readme.md | 6 --
 Readme.md| 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Platform/Intel/Readme.md b/Platform/Intel/Readme.md
index 0a0e8a8c80..00f42985a2 100644
--- a/Platform/Intel/Readme.md
+++ b/Platform/Intel/Readme.md
@@ -1,7 +1,9 @@
 # **EDK II Minimum Platform Firmware for Intel(R) Platforms**
 
 The Minimum Platform is a software architecture that guides uniform delivery 
of Intel platforms enabling firmware
-solutions for basic boot functionality with extensibility built-in.
+solutions for basic boot functionality with extensibility built-in. Please see 
the
+[EDK II Minimum Platform Draft 
Specification](https://edk2-docs.gitbooks.io/edk-ii-minimum-platform-specification/)
+for more details.
 
 Package maintainers for the Minimum Platform projects are listed in 
Maintainers.txt.
 
@@ -98,7 +100,7 @@ return back to the minimum platform caller.
   * ``git clone https://github.com/tianocore/edk2-platforms.git``
 
 * edk2-non-osi repository
-  * ``git clone https://github.com/tianocore/edk2-non-osi.git -b 
devel-MinPlatform``
+  * ``git clone https://github.com/tianocore/edk2-non-osi.git``
 
 * FSP repository
   * ``git clone https://github.com/IntelFsp/FSP.git``
diff --git a/Readme.md b/Readme.md
index 63e59f60b4..1befd0b544 100644
--- a/Readme.md
+++ b/Readme.md
@@ -223,8 +223,8 @@ they will be documented with the platform.
 * [D05](Platform/Hisilicon/D05)
 * [HiKey](Platform/Hisilicon/HiKey)
 
-## [Intel](Platform/Intel/Readme.md)
-### Minimum Platforms
+## Intel
+### [Minimum Platforms](Platform/Intel/Readme.md)
 * [Clevo](Platform/Intel/ClevoOpenBoardPkg)
 * [Kaby Lake](Platform/Intel/KabylakeOpenBoardPkg)
 * [Purley](Platform/Intel/PurleyOpenBoardPkg)
-- 
2.17.1.windows.2


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

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



Re: [edk2-devel] [Patch] Vlv2TbltDevicePkg/VlvPlatformInitDxe: Avoid memset instrinsic

2019-08-11 Thread Sun, Zailiang
Reviewed-by: Zailiang Sun 

> -Original Message-
> From: Kinney, Michael D
> Sent: Saturday, August 10, 2019 5:24 AM
> To: devel@edk2.groups.io
> Cc: Sun, Zailiang ; Gary Lin 
> Subject: [Patch] Vlv2TbltDevicePkg/VlvPlatformInitDxe: Avoid memset instrinsic
> 
> VS2017 builds for X64 are failing due to the use of the
> memset intrinsic.  The local variable GopVersion is an
> array that is initialied in the declaration.  Update to
> use ZeroMem() to intialize GopVersion.
> 
> Cc: Zailiang Sun 
> Cc: Gary Lin 
> Signed-off-by: Michael D Kinney 
> ---
>  .../Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c   | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
> b/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
> index fcd9e566ae..3815c8fa9c 100644
> --- a/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
> +++ b/Platform/Intel/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
> @@ -493,9 +493,10 @@ SetGOPVersionCallback (
>IN VOID  *Context
>)
>  {
> -  CHAR16GopVersion[16] = {0};
> +  CHAR16GopVersion[16];
>EFI_STATUSStatus;
> 
> +  ZeroMem (GopVersion, sizeof (GopVersion));
>Status = GetGOPDriverVersion(GopVersion);
>if(!EFI_ERROR(Status)) {
>  StrCpy((CHAR16*)&(mIgdOpRegion.OpRegion->Header.GOPV[0]),
> GopVersion);
> --
> 2.21.0.windows.1


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

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



Re: [edk2-devel] [Patch] Vlv2Tbl2DevicePkg/PlatformSetupDxe: Fix setup info regression

2019-08-11 Thread Sun, Zailiang
Reviewed-by: Zailiang Sun 

-Original Message-
From: Kinney, Michael D 
Sent: Saturday, August 10, 2019 3:34 AM
To: devel@edk2.groups.io
Cc: Sun, Zailiang ; Gary Lin 
Subject: [Patch] Vlv2Tbl2DevicePkg/PlatformSetupDxe: Fix setup info regression

The following commit removed the call to SetupInfo() from
SystemConfigExtractConfig().  This caused the BIOS, Processor,
Platform, and Memory information strings from being filled
in with their proper values.

https://github.com/tianocore/edk2-platforms/commit/6738c654c8eddccc2a1230a4541bc2cb74c10ea5

The call to SetupInfo() is added back.

Cc: Zailiang Sun 
Cc: Gary Lin 
Signed-off-by: Michael D Kinney 
---
 .../Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.c  | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.c 
b/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.c
index 7a4987f656..f3850b2aff 100644
--- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.c
+++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.c
@@ -150,6 +150,7 @@ SystemConfigExtractConfig (
   OUT EFI_STRING *Results
   )
 {
+  SetupInfo();
   return EFI_UNSUPPORTED;
 }
 
-- 
2.21.0.windows.1


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

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