[edk2-devel] [edk2-staging/EdkRepo] [PATCH V1 0/2] EdkRepo: Add support for SUBST drives

2020-08-05 Thread Nate DeSimone
EdkRepo currently does not handle virtual drives created using the SUBST 
command.
Specifically, when cloning or syncing a project to a subst drive the includeIf 
statements
that redirect submodule fetches to mirror servers will be generated with the
subst drive information.  This causes git to not activate the includeif since
it specifies the subst path and not the actual path.

To resolve this, EdkRepo will now enumerate the virtual drives created by SUBST 
and if
the current workspace is on a SUBST virtual drive EdkRepo will convert the 
workspace
path to the path on the real volume.

Cc: Ashley E Desimone 
Cc: Nate DeSimone 
Cc: Puja Pandya 
Cc: Bret Barkelew 
Cc: Prince Agyeman 
Cc: Erik Bjorge 
Signed-off-by: Nate DeSimone 

Nate DeSimone (2):
  EdkRepo: Add function to enumerate subst drives
  EdkRepo: Add support for subst drives

 edkrepo/commands/clone_command.py |  6 
 edkrepo/common/pathfix.py | 50 ++-
 edkrepo/config/config_factory.py  | 10 ++-
 3 files changed, 64 insertions(+), 2 deletions(-)

-- 
2.27.0.windows.1


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

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



[edk2-devel] [edk2-staging/EdkRepo] [PATCH V1 2/2] EdkRepo: Add support for subst drives

2020-08-05 Thread Nate DeSimone
get_workspace_path() now converts a virtual drive path
to a real path before any git repo operations are done.

Cc: Ashley E Desimone 
Cc: Nate DeSimone 
Cc: Puja Pandya 
Cc: Bret Barkelew 
Cc: Prince Agyeman 
Cc: Erik Bjorge 
Signed-off-by: Nate DeSimone 
---
 edkrepo/commands/clone_command.py |  6 ++
 edkrepo/config/config_factory.py  | 10 +-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/edkrepo/commands/clone_command.py 
b/edkrepo/commands/clone_command.py
index f638090..650bc81 100644
--- a/edkrepo/commands/clone_command.py
+++ b/edkrepo/commands/clone_command.py
@@ -20,6 +20,7 @@ from edkrepo.common.edkrepo_exception import 
EdkrepoInvalidParametersException,
 from edkrepo.common.edkrepo_exception import EdkrepoManifestNotFoundException
 from edkrepo.common.humble import CLONE_INVALID_WORKSPACE, 
CLONE_INVALID_PROJECT_ARG, CLONE_INVALID_COMBO_ARG
 from edkrepo.common.humble import SPARSE_CHECKOUT, CLONE_INVALID_LOCAL_ROOTS
+from edkrepo.common.pathfix import get_subst_drive_list
 from edkrepo.common.workspace_maintenance.workspace_maintenance import 
case_insensitive_single_match
 from edkrepo.common.workspace_maintenance.manifest_repos_maintenance import 
pull_all_manifest_repos, find_project_in_all_indices
 from edkrepo.common.workspace_maintenance.manifest_repos_maintenance import 
list_available_manifest_repos
@@ -77,6 +78,11 @@ class CloneCommand(EdkrepoCommand):
 workspace_dir = os.getcwd()
 else:
 workspace_dir = os.path.abspath(workspace_dir)
+subst = get_subst_drive_list()
+for drive in subst.keys():
+if '{}:'.format(drive) == 
os.path.splitdrive(workspace_dir)[0].upper():
+workspace_dir = os.path.join(subst[drive], 
os.path.splitdrive(workspace_dir)[1][1:])
+workspace_dir = os.path.normpath(workspace_dir)
 if os.path.isdir(workspace_dir) and os.listdir(workspace_dir):
 raise EdkrepoInvalidParametersException(CLONE_INVALID_WORKSPACE)
 if not os.path.isdir(workspace_dir):
diff --git a/edkrepo/config/config_factory.py b/edkrepo/config/config_factory.py
index a82a438..45ac16f 100644
--- a/edkrepo/config/config_factory.py
+++ b/edkrepo/config/config_factory.py
@@ -11,13 +11,16 @@ import os
 import sys
 import configparser
 import collections
-from ctypes import *
+if sys.platform == "win32":
+from ctypes import oledll, c_void_p, c_uint32, c_wchar_p
+from ctypes import create_unicode_buffer
 
 import edkrepo.config.humble.config_factory_humble as humble
 from edkrepo.common.edkrepo_exception import 
EdkrepoGlobalConfigNotFoundException, EdkrepoConfigFileInvalidException
 from edkrepo.common.edkrepo_exception import EdkrepoWorkspaceInvalidException, 
EdkrepoGlobalDataDirectoryNotFoundException
 from edkrepo.common.edkrepo_exception import EdkrepoConfigFileReadOnlyException
 from edkrepo.common.humble import MIRROR_PRIMARY_REPOS_MISSING, 
MIRROR_DECODE_WARNING, MAX_PATCH_SET_INVALID
+from edkrepo.common.pathfix import get_subst_drive_list
 from edkrepo_manifest_parser import edk_manifest
 from edkrepo.common.pathfix import expanduser
 
@@ -238,6 +241,11 @@ def get_workspace_path():
 while True:
 if os.path.isdir(os.path.join(path, "repo")):
 if os.path.isfile(os.path.join(os.path.join(path, "repo"), 
"Manifest.xml")):
+if sys.platform == "win32":
+subst = get_subst_drive_list()
+for drive in subst.keys():
+if '{}:'.format(drive) == 
os.path.splitdrive(path)[0].upper():
+path = os.path.join(subst[drive], 
os.path.splitdrive(path)[1][1:])
 return path
 if os.path.dirname(path) == path:
 break
-- 
2.27.0.windows.1


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

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



Re: [edk2-devel] [Patch 0/4] Update licenses

2020-08-05 Thread Ard Biesheuvel
for the series,

Acked-by: Ard Biesheuvel 

From: Michael D Kinney 
Sent: Tuesday, August 4, 2020 21:10
To: devel@edk2.groups.io 
Cc: Andrew Fish ; Laszlo Ersek ; Leif 
Lindholm ; Ard Biesheuvel ; Jian J 
Wang ; Hao A Wu ; Liming Gao 

Subject: [Patch 0/4] Update licenses

Update licenses that may have been missed in the conversion to the
BSD-2-Clause-Patent using SPDX identifiers.

Also update list of licenses in Readme.rst and list git submodule
license in their own list.

Cc: Andrew Fish 
Cc: Laszlo Ersek 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Liming Gao 
Signed-off-by: Michael D Kinney 

Michael D Kinney (4):
  EmbeddedPkg/NonCoherentIoMmuDxe: Apply BSD-2-Clause-Patent
  MdeModulePkg/PeCoffImageEmulator.h: Apply BSD-2-Clause-Patent
  MdePkg/BaseMemoryLibOptDxe: Apply BSD-2-Clause-Patent
  Readme.rst: List submodules and links to licenses

 .../NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.c |  9 +---
 .../NonCoherentIoMmuDxe.inf   | 10 +---
 .../Include/Protocol/PeCoffImageEmulator.h|  9 +---
 .../BaseMemoryLibOptDxe/AArch64/CompareGuid.S | 24 +
 .../BaseMemoryLibOptDxe/AArch64/CompareMem.S  | 24 +
 .../BaseMemoryLibOptDxe/AArch64/CopyMem.S | 50 +--
 .../BaseMemoryLibOptDxe/AArch64/ScanMem.S | 24 +
 .../BaseMemoryLibOptDxe/AArch64/SetMem.S  | 50 +--
 .../BaseMemoryLibOptDxe/Arm/CompareGuid.S | 24 +
 .../BaseMemoryLibOptDxe/Arm/CompareGuid.asm   | 24 +
 .../BaseMemoryLibOptDxe/Arm/CompareMem.S  | 24 +
 .../BaseMemoryLibOptDxe/Arm/CompareMem.asm| 24 +
 .../Library/BaseMemoryLibOptDxe/Arm/ScanMem.S | 28 +--
 .../BaseMemoryLibOptDxe/Arm/ScanMem.asm   | 28 +--
 ReadMe.rst| 22 +---
 15 files changed, 30 insertions(+), 344 deletions(-)

--
2.21.0.windows.1

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.

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

View/Reply Online (#63771): https://edk2.groups.io/g/devel/message/63771
Mute This Topic: https://groups.io/mt/75993656/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/UsbBusDxe: some USB PenDisk fails enumeration.

2020-08-05 Thread Guomin Jiang
I will review it by next weekend(8/14).

Thanks.
From: devel@edk2.groups.io  On Behalf Of Feng Libo
Sent: Thursday, August 6, 2020 9:25 AM
To: Feng Libo ; devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/UsbBusDxe: some USB PenDisk 
fails enumeration.

Hello,

could anyone review this PATCH?

We encountered the USB enumeration problem and the patch is based on the 
Microsoft post as below.

https://techcommunity.microsoft.com/t5/microsoft-usb-blog/how-does-usb-stack-enumerate-a-device/ba-p/270685#:~:text=%20How%20does%20USB%20stack%20enumerate%20a%20device%3F,a%20request%20for%20the%20USB%20Device...%20More%20

Thanks

Best Regards

Feng Libo


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

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



Re: [edk2-devel] question about MSFT compiler/link option

2020-08-05 Thread Andrew Fish via groups.io


> On Aug 5, 2020, at 8:31 PM, Tiger Liu(BJ-RD)  wrote:
> 
> Hi, Michael:
> I wrote this sentence in C file:
> pTmp = (VOID*)& PdataStructTable;
> 

Tiger,

Working around optimization is complicated. You likely added a statement that 
got optimized away as the value of pTmp could be ignored and your program could 
still get the same result. 

You would need to do some meaningful work with pTmp or make pTmp a volatile 
variable to force the compiler to NOT optimize it away. The better the 
optimizer, the more layers of abstraction it can see and optimize away. 

Thanks,

Andrew Fish

> tried to reference the table being generated to prevent the optimizer from 
> removing the data structure from the executable.
> 
> But it is still being optimized away.
> 
> I used MSTF VS2015.
> 
> Thanks
> -邮件原件-
> 发件人: devel@edk2.groups.io   > 代表 Michael D Kinney
> 发送时间: 2020年8月5日 23:18
> 收件人: devel@edk2.groups.io ; Tiger Liu(BJ-RD) 
> mailto:tiger...@zhaoxin.com>>; Gao, Liming 
> mailto:liming@intel.com>>; Kinney, Michael D 
> mailto:michael.d.kin...@intel.com>>
> 主题: Re: [edk2-devel] question about MSFT compiler/link option
> 
> Hi,
> 
> I think you are seeing the impact of compiler optimizations.
> 
> If a global variable is never referenced after optimizing the code, then the 
> global variable will be optimized away.  This type of optimization is 
> important for size constrained environment like firmware.
> 
> By using the /Gw- flag, you are disabling the ability of the compiler to 
> optimize away unreferenced global variables.
> 
> If you update the code in your example to guarantee the global variable is 
> always accessed for all types of builds, then I suspect you will always see 
> the global in the map.
> 
> Thanks,
> 
> Mike
> 
>> -Original Message-
>> From: devel@edk2.groups.io  On Behalf Of Tiger
>> Liu(BJ-RD)
>> Sent: Tuesday, August 4, 2020 11:34 PM
>> To: devel@edk2.groups.io; Gao, Liming
>> 
>> Subject: Re: [edk2-devel] question about MSFT compiler/link option
>> 
>> Hi, Liming:
>> Thanks for your reply!
>> 
>> I checked map file, not find this global data array.
>> 
>> I found if added this build option in this PEIM's inf, then it seems
>> ok.
>> [BuildOptions]
>> MSFT:*_*_IA32_CC_FLAGS   = /Gw-
>> 
>> Thanks
>> 
>> -邮件原件-
>> 发件人: devel@edk2.groups.io  代表
>> Liming Gao
>> 发送时间: 2020年8月4日 23:21
>> 收件人: devel@edk2.groups.io; Tiger Liu(BJ-RD) 
>> 主题: Re: [edk2-devel] question about MSFT compiler/link option
>> 
>> If this global variable is used by code, it will be linked into the
>> final EFI image. You can check whether the generate map file includes
>> it.
>> 
>>> -Original Message-
>>> From: devel@edk2.groups.io  On
>> Behalf Of Tiger
>>> Liu(BJ-RD)
>>> Sent: Tuesday, August 4, 2020 5:34 PM
>>> To: devel@edk2.groups.io
>>> Subject: [edk2-devel] question about MSFT
>> compiler/link option
>>> 
>>> Hi, Experts:
>>> I have a question about MSFT compiler/link option.
>>> 
>>> I wrote a PEIM, which had a large global data array
>> definition in a C file.
>>> Such as:
>>> PRI_DATA_STRUCT  PdataStructTable[] = {
>>> {01,   0x75,0xF0, 0x0, 0x0,
>> 0x0 },
>>> {02,   0x77,0xF0, 0x0, 0x0,
>> 0x0 },
>>> {03,   0x79,0xF0, 0x0, 0x0,
>> 0x0 },
>>> {04,   0x7B,0xF0, 0x0, 0x0,
>> 0x0 },
>>> {05,   0x7D,0xF0, 0x0, 0x0,
>> 0x0 },
>>> {06,   0x7F,0xF0, 0x0, 0x0,
>> 0x0 },
>>> ..
>>> };
>>> 
>>> This global data array is very large, about 20KB.
>>> 
>>> But I found the PEIM's compiled size is about 5KB, it
>> seems not include this global data array in the efi binary statically.
>>> Even the release version PEIM's size is larger than
>> debug version.
>>> 
>>> I found when compiling release version, the link
>> option has :
>>> /MERGE:.rdata=.data It seems release binary included
>> the global data array in the final efi image.
>>> 
>>> So, my question is:
>>> Will the global data array be in linked into the final
>> efi binary image when compiling debug version?
>>> 
>>> Thanks
>>> 
>>> 
>>> 保密声明:
>>> 本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内
>> 容做任何未经授权的查阅、使用、复制或转发。
>>> CONFIDENTIAL NOTE:
>>> This email contains confidential or legally privileged
>> information and
>>> is for the sole use of its intended recipient. Any
>> unauthorized review, use, copying or forwarding of this email or the
>> content of this email is strictly prohibited.
>>> 
>>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 保密声明:
>> 本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容
>> 做任何未经授权的查阅、使用、复制或转发。
>> CONFIDENTIAL NOTE:
>> This email contains confidential or legally privileged information and
>> is for the sole use of its intended recipient. Any unauthorized
>> review, use, copying or forwarding of this email or the content of
>> this email is strictly prohibited.
>> 
>> 
> 
> 
> 
> 
> 
> 
> 保密声明:
> 本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容做任何未经授权的查阅

Re: [edk2-devel] question about MSFT compiler/link option

2020-08-05 Thread Tiger Liu(BJ-RD)
Hi, Michael:
I wrote this sentence in C file:
pTmp = (VOID*)& PdataStructTable;

tried to reference the table being generated to prevent the optimizer from 
removing the data structure from the executable.

But it is still being optimized away.

I used MSTF VS2015.

Thanks
-邮件原件-
发件人: devel@edk2.groups.io  代表 Michael D Kinney
发送时间: 2020年8月5日 23:18
收件人: devel@edk2.groups.io; Tiger Liu(BJ-RD) ; Gao, Liming 
; Kinney, Michael D 
主题: Re: [edk2-devel] question about MSFT compiler/link option

Hi,

I think you are seeing the impact of compiler optimizations.

If a global variable is never referenced after optimizing the code, then the 
global variable will be optimized away.  This type of optimization is important 
for size constrained environment like firmware.

By using the /Gw- flag, you are disabling the ability of the compiler to 
optimize away unreferenced global variables.

If you update the code in your example to guarantee the global variable is 
always accessed for all types of builds, then I suspect you will always see the 
global in the map.

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Tiger
> Liu(BJ-RD)
> Sent: Tuesday, August 4, 2020 11:34 PM
> To: devel@edk2.groups.io; Gao, Liming
> 
> Subject: Re: [edk2-devel] question about MSFT compiler/link option
>
> Hi, Liming:
> Thanks for your reply!
>
> I checked map file, not find this global data array.
>
> I found if added this build option in this PEIM's inf, then it seems
> ok.
> [BuildOptions]
> MSFT:*_*_IA32_CC_FLAGS   = /Gw-
>
> Thanks
>
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表
> Liming Gao
> 发送时间: 2020年8月4日 23:21
> 收件人: devel@edk2.groups.io; Tiger Liu(BJ-RD) 
> 主题: Re: [edk2-devel] question about MSFT compiler/link option
>
> If this global variable is used by code, it will be linked into the
> final EFI image. You can check whether the generate map file includes
> it.
>
> > -Original Message-
> > From: devel@edk2.groups.io  On
> Behalf Of Tiger
> > Liu(BJ-RD)
> > Sent: Tuesday, August 4, 2020 5:34 PM
> > To: devel@edk2.groups.io
> > Subject: [edk2-devel] question about MSFT
> compiler/link option
> >
> > Hi, Experts:
> > I have a question about MSFT compiler/link option.
> >
> > I wrote a PEIM, which had a large global data array
> definition in a C file.
> > Such as:
> > PRI_DATA_STRUCT  PdataStructTable[] = {
> > {01,   0x75,0xF0, 0x0, 0x0,
> 0x0 },
> > {02,   0x77,0xF0, 0x0, 0x0,
> 0x0 },
> > {03,   0x79,0xF0, 0x0, 0x0,
> 0x0 },
> > {04,   0x7B,0xF0, 0x0, 0x0,
> 0x0 },
> > {05,   0x7D,0xF0, 0x0, 0x0,
> 0x0 },
> > {06,   0x7F,0xF0, 0x0, 0x0,
> 0x0 },
> > ..
> > };
> >
> > This global data array is very large, about 20KB.
> >
> > But I found the PEIM's compiled size is about 5KB, it
> seems not include this global data array in the efi binary statically.
> > Even the release version PEIM's size is larger than
> debug version.
> >
> > I found when compiling release version, the link
> option has :
> > /MERGE:.rdata=.data It seems release binary included
> the global data array in the final efi image.
> >
> > So, my question is:
> > Will the global data array be in linked into the final
> efi binary image when compiling debug version?
> >
> > Thanks
> >
> >
> > 保密声明:
> > 本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内
> 容做任何未经授权的查阅、使用、复制或转发。
> > CONFIDENTIAL NOTE:
> > This email contains confidential or legally privileged
> information and
> > is for the sole use of its intended recipient. Any
> unauthorized review, use, copying or forwarding of this email or the
> content of this email is strictly prohibited.
> >
> >
>
>
>
>
>
>
> 保密声明:
> 本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容
> 做任何未经授权的查阅、使用、复制或转发。
> CONFIDENTIAL NOTE:
> This email contains confidential or legally privileged information and
> is for the sole use of its intended recipient. Any unauthorized
> review, use, copying or forwarding of this email or the content of
> this email is strictly prohibited.
>
>






保密声明:
本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容做任何未经授权的查阅、使用、复制或转发。
CONFIDENTIAL NOTE:
This email contains confidential or legally privileged information and is for 
the sole use of its intended recipient. Any unauthorized review, use, copying 
or forwarding of this email or the content of this email is strictly prohibited.

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

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



[edk2-devel] [PATCH] EmbeddedPkg/libfdt: Add strncmp macro to use AsciiStrnCmp

2020-08-05 Thread Abner Chang
For the implementation which utilizes libfdt provided in EmbeddedPkg
however it uses strncmp function in the libfdt helper library,
libfdt_env.h should provide the macro implied with edk2 strncmp
implementation.

The example is RISC-V OpenSBI library. edk2 RISC-V port uses OpenSBI
library and incorporate with edk2 libfdt. edk2 libfdt_env.h provides
the necessary macros to build OpenSBI which uses fdt functions in edk2
environment. However, OpenSBI also has libfdt helper library that uses
strncmp function which is not defined in edk2 libfdt_env.h. This commit
addresses the build issue caused by missing strncmp macro in
libfdt_env.h.

Check below three commits for the corresponding changes on OpenSBI,
https://github.com/riscv/opensbi/commit/8e47649eff96c303e02fbd58cdc6c4ed341066ec
https://github.com/riscv/opensbi/commit/2845d2d2cf4fb74a89452ba223995aa4a118c07e
https://github.com/riscv/opensbi/commit/2cfd2fc9048806353298a1b967abf985901e36e8

Signed-off-by: Abner Chang 

Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Cc: Daniel Schaefer 
---
 EmbeddedPkg/Include/libfdt_env.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/EmbeddedPkg/Include/libfdt_env.h b/EmbeddedPkg/Include/libfdt_env.h
index 11a9764733..7feff52bc0 100644
--- a/EmbeddedPkg/Include/libfdt_env.h
+++ b/EmbeddedPkg/Include/libfdt_env.h
@@ -76,4 +76,8 @@ static inline size_t strnlen (const char* str, size_t strsz ) 
{
   return AsciiStrnLenS (str, strsz);
 }
 
+static inline size_t strncmp (const char* str1, const char* str2, size_t strsz 
) {
+  return AsciiStrnCmp (str1, str2, strsz);
+}
+
 #endif /* _LIBFDT_ENV_H */
-- 
2.25.0


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

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



Re: [edk2-devel] [Patch 4/4] Readme.rst: List submodules and links to licenses

2020-08-05 Thread Laszlo Ersek
On 08/04/20 21:10, Michael D Kinney wrote:
> Update list of content that is covered by a license other than
> the BSD-2-Clause Plus Patent License and break out list of
> content that is included as a git submodule from upstream
> projects.
> 
> * Use alphabetic order of content
> * Remove references to IntelFrameworkModulePkg
> * Add reference for UnitTestFrameworkPkg use of cmocka
> 
> Cc: Andrew Fish 
> Cc: Laszlo Ersek 
> Cc: Leif Lindholm 
> Signed-off-by: Michael D Kinney 
> ---
>  ReadMe.rst | 22 --
>  1 file changed, 16 insertions(+), 6 deletions(-)
> 
> diff --git a/ReadMe.rst b/ReadMe.rst
> index d597e34efc..a16e13547f 100644
> --- a/ReadMe.rst
> +++ b/ReadMe.rst
> @@ -69,16 +69,26 @@ The majority of the content in the EDK II open source 
> project uses a
>  source project contains the following components that are covered by 
> additional
>  licenses:
>  
> --  `BaseTools/Source/C/BrotliCompress/brotli 
> `__
> --  `MdeModulePkg/Library/BrotliCustomDecompressLib/brotli 
> `__
>  -  `BaseTools/Source/C/LzmaCompress 
> `__
> --  `MdeModulePkg/Library/LzmaCustomDecompressLib 
> `__
> --  `IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/Sdk 
> `__
>  -  `BaseTools/Source/C/VfrCompile/Pccts 
> `__
> --  `MdeModulePkg/Universal/RegularExpressionDxe/oniguruma 
> `__
> +-  `CryptoPkg\Library\BaseCryptLib\SysCall\inet_pton.c 
> `__
> +-  `CryptoPkg\Library\Include\crypto\dso_conf.h 
> `__
> +-  `CryptoPkg\Library\Include\openssl\opensslconf.h 
> `__
> +-  `EmbeddedPkg/Library/FdtLib `__.  (EDK 
> II uses BSD License)
> +-  `EmbeddedPkg/Include/fdt.h `__.  (EDK II uses 
> BSD Licence)
> +-  `EmbeddedPkg/Include/libfdt.h `__.  (EDK II 
> uses BSD License)
> +-  `MdeModulePkg/Library/LzmaCustomDecompressLib 
> `__
>  -  `OvmfPkg `__
> --  `CryptoPkg/Library/OpensslLib/openssl 
> `__
> +
> +The EDK II open source project uses content from upstream projects as git 
> submodules
> +that are covered by additional licenses.
> +
>  -  `ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 
> `__
> +-  `BaseTools/Source/C/BrotliCompress/brotli 
> `__
> +-  `CryptoPkg/Library/OpensslLib/openssl 
> `__
> +-  `MdeModulePkg/Library/BrotliCustomDecompressLib/brotli 
> `__
> +-  `MdeModulePkg/Universal/RegularExpressionDxe/oniguruma 
> `__
> +-  `UnitTestFrameworkPkg/Library/CmockaLib/cmocka 
> `__
>  
>  The EDK II Project is composed of packages. The maintainers for each package
>  are listed in `Maintainers.txt `__.
> 

Acked-by: Laszlo Ersek 


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

View/Reply Online (#63766): https://edk2.groups.io/g/devel/message/63766
Mute This Topic: https://groups.io/mt/75993660/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/1] Maintainers.txt: Add bhyve reviewers

2020-08-05 Thread Laszlo Ersek
On 08/02/20 05:42, Rebecca Cran wrote:
> Bhyve files are under OvmfPkg, in OvmfPkg/Bhyve and
> various files in OvmfPkg/Library and OvmfPkg/Include.
> 
> Update Maintainers.txt to indicate reviewers for all
> bhyve-specific files.
> 
> Signed-off-by: Rebecca Cran 
> Cc: Andrew Fish 
> Cc: Laszlo Ersek 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Cc: Jordan Justen 
> Cc: Ard Biesheuvel 
> ---
>  Maintainers.txt | 13 +
>  1 file changed, 13 insertions(+)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 5504bb3d17cc..569bd2511a69 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -398,6 +398,19 @@ M: Laszlo Ersek 
>  M: Ard Biesheuvel 
>  S: Maintained
>  
> +OvmfPkg: bhyve-related modules
> +F: OvmfPkg/Bhyve/
> +F: OvmfPkg/Include/IndustryStandard/Bhyve.h
> +F: OvmfPkg/Include/Library/BhyveFwCtlLib.h
> +F: OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLibBhyve.c
> +F: OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLibBhyve.inf
> +F: OvmfPkg/Library/BhyveFwCtlLib/
> +F: OvmfPkg/Library/PlatformBootManagerLibBhyve/
> +F: OvmfPkg/Library/ResetSystemLib/BaseResetShutdownBhyve.c
> +F: OvmfPkg/Library/ResetSystemLib/BaseResetSystemLibBhyve.inf
> +R: Rebecca Cran 
> +R: Peter Grehan 
> +
>  OvmfPkg: CSM modules
>  F: OvmfPkg/Csm/
>  R: David Woodhouse 
> 

Reviewed-by: Laszlo Ersek 

Can Peter please post an Acked-by for this patch, too?

Thanks
Laszlo


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

View/Reply Online (#63765): https://edk2.groups.io/g/devel/message/63765
Mute This Topic: https://groups.io/mt/75940056/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] IntelSiliconPkg: IOMMU generic bug fix

2020-08-05 Thread De Leon Vasquez, Lorena R
Hi Liming,
I’ve update the name
Thanks,
Lorena

From: Gao, Liming 
Sent: Friday, July 31, 2020 2:30 AM
To: De Leon Vasquez, Lorena R ; 
devel@edk2.groups.io; Lohr, Paul A ; Yao, Jiewen 

Cc: Kinney, Michael D 
Subject: RE: [edk2-devel] [edk2-platforms] [PATCH] IntelSiliconPkg: IOMMU 
generic bug fix

Lorena:
  Thanks for your update. Can you correct name style as Star Zeng 
mailto:star.z...@intel.com>> for below message?

Suggested-by: Star Zeng star.z...@intel.com
Signed-off-by: 
lorena.r.de.leon.vazq...@intel.com

Thanks
Liming
From: De Leon Vasquez, Lorena R 
mailto:lorena.r.de.leon.vasq...@intel.com>>
Sent: 2020年7月29日 23:23
To: Gao, Liming mailto:liming@intel.com>>; 
devel@edk2.groups.io; Lohr, Paul A 
mailto:paul.a.l...@intel.com>>; Yao, Jiewen 
mailto:jiewen@intel.com>>
Cc: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
Subject: RE: [edk2-devel] [edk2-platforms] [PATCH] IntelSiliconPkg: IOMMU 
generic bug fix

I’ve attached patch with modifications suggested

From: Gao, Liming mailto:liming@intel.com>>
Sent: Thursday, July 9, 2020 7:45 AM
To: De Leon Vazquez, Lorena R 
mailto:lorena.r.de.leon.vazq...@intel.com>>;
 devel@edk2.groups.io; Lohr, Paul A 
mailto:paul.a.l...@intel.com>>; Yao, Jiewen 
mailto:jiewen@intel.com>>
Cc: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
Subject: RE: [edk2-devel] [edk2-platforms] [PATCH] IntelSiliconPkg: IOMMU 
generic bug fix

Lorena:
  I have one minor comment on this patch. The error return status should be 
EFI_UNSUPPORTED.

+  return error;
==>
return EFI_UNSUPPORTED;

Thanks
Liming
From: De Leon Vazquez, Lorena R 
mailto:lorena.r.de.leon.vazq...@intel.com>>
Sent: Tuesday, July 7, 2020 1:24 AM
To: Gao, Liming mailto:liming@intel.com>>; 
devel@edk2.groups.io; Lohr, Paul A 
mailto:paul.a.l...@intel.com>>; Yao, Jiewen 
mailto:jiewen@intel.com>>
Cc: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
Subject: RE: [edk2-devel] [edk2-platforms] [PATCH] IntelSiliconPkg: IOMMU 
generic bug fix

Hi Liming,
I’ve attached the patch

Thanks,
Lorena

From: Gao, Liming mailto:liming@intel.com>>
Sent: Thursday, July 2, 2020 8:54 PM
To: devel@edk2.groups.io; Lohr, Paul A 
mailto:paul.a.l...@intel.com>>; Yao, Jiewen 
mailto:jiewen@intel.com>>; De Leon Vazquez, Lorena R 
mailto:lorena.r.de.leon.vazq...@intel.com>>
Cc: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
Subject: RE: [edk2-devel] [edk2-platforms] [PATCH] IntelSiliconPkg: IOMMU 
generic bug fix

Paul:
  This patch is missing to be merged.

Lorena:
  I can’t extract the patch from the mail. Can you send the patch to me? I can 
help merge it.

Thanks
Liming
From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Lohr, Paul A
Sent: Thursday, July 2, 2020 9:56 PM
To: devel@edk2.groups.io; Yao, Jiewen 
mailto:jiewen@intel.com>>; De Leon Vazquez, Lorena R 
mailto:lorena.r.de.leon.vazq...@intel.com>>
Cc: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
Subject: Re: [edk2-devel] [edk2-platforms] [PATCH] IntelSiliconPkg: IOMMU 
generic bug fix

Hello,

It seems this did not get checked in.  Is there something wrong with the patch 
itself?  Or was this simply submitted incorrectly?  I don’t see a Bugzilla 
associated with it is why I ask.

Paul A. Lohr - Server Firmware Enabling
512.239.9073 (cell)
512.794.5044 (work)

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Yao, Jiewen
Sent: Monday, March 2, 2020 5:46 PM
To: De Leon Vazquez, Lorena R 
mailto:lorena.r.de.leon.vazq...@intel.com>>;
 devel@edk2.groups.io
Cc: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
Subject: Re: [edk2-devel] [edk2-platforms] [PATCH] IntelSiliconPkg: IOMMU 
generic bug fix

Reviewed-by: jiewen@intel.com

From: De Leon Vazquez, Lorena R 
mailto:lorena.r.de.leon.vazq...@intel.com>>
Sent: Tuesday, March 3, 2020 7:04 AM
To: devel@edk2.groups.io
Cc: Yao, Jiewen mailto:jiewen@intel.com>>; Kinney, 
Michael D mailto:michael.d.kin...@intel.com>>
Subject: [edk2-platforms] [PATCH] IntelSiliconPkg: IOMMU generic bug fix

Looks like Addresswidth is BIT wise values. Right now these values are not used 
any

Suggested-by: Star Zeng star.z...@intel.com
Signed-off-by: 
lorena.r.de.leon.vazq...@intel.com

--
.../Feature/VTd/IntelVTdDxe/TranslationTable.c| 11 ---
.../Feature/VTd/IntelVTdDxe/TranslationTableEx.c  | 11 ---
2 files changed, 8 insertions(+), 14 deletions(-)

diff --git 
a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c 
b/Silicon/Intel/IntelSiliconPkg/Feature/VTd

Re: [edk2-devel] [PATCH] MdeModulePkg/UsbBusDxe: some USB PenDisk fails enumeration.

2020-08-05 Thread Feng Libo
Hello,

could anyone review this PATCH?

We encountered the USB enumeration problem and the patch is based on the 
Microsoft post as below.

https://techcommunity.microsoft.com/t5/microsoft-usb-blog/how-does-usb-stack-enumerate-a-device/ba-p/270685#:~:text=%20How%20does%20USB%20stack%20enumerate%20a%20device%3F,a%20request%20for%20the%20USB%20Device...%20More%20

Thanks

Best Regards

Feng Libo

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

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



Re: [edk2-devel] [PATCH v2 6/9] IntelFsp2WrapperPkg/FspMeasurementLib: Add BaseFspMeasurementLib.

2020-08-05 Thread Chiu, Chasel


Hi Qi,

Please see my comments below inline.

Thanks,
Chasel


> -Original Message-
> From: Zhang, Qi1 
> Sent: Thursday, August 6, 2020 8:34 AM
> To: devel@edk2.groups.io
> Cc: Yao, Jiewen ; Chiu, Chasel
> ; Desimone, Nathaniel L
> ; Zeng, Star ; Zhang,
> Qi1 
> Subject: [PATCH v2 6/9] IntelFsp2WrapperPkg/FspMeasurementLib: Add
> BaseFspMeasurementLib.
> 
> From: Jiewen Yao 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2376
> 
> Cc: Jiewen Yao 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Cc: Qi Zhang 
> Signed-off-by: Jiewen Yao 
> ---
>  .../BaseFspMeasurementLib.inf |  54 +++
>  .../BaseFspMeasurementLib/FspMeasurementLib.c | 349
> ++
>  2 files changed, 403 insertions(+)
>  create mode 100644
> IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasuremen
> tLib.inf
>  create mode 100644
> IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.
> c
> 
> diff --git
> a/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurem
> entLib.inf
> b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurem
> entLib.inf
> new file mode 100644
> index 00..d30168117d
> --- /dev/null
> +++
> b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurem
> entLib.inf
> @@ -0,0 +1,54 @@
> +## @file
> 
> +#  Provides FSP measurement functions.
> 
> +#
> 
> +#  This library provides MeasureFspFirmwareBlob() to measure FSP binary.
> 
> +#
> 
> +# Copyright (c) 2020, Intel Corporation. All rights reserved.
> 
> +# SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +#
> 
> +##
> 
> +
> 
> +[Defines]
> 
> +  INF_VERSION= 0x00010005
> 
> +  BASE_NAME  = FspMeasurementLib
> 
> +  FILE_GUID  =
> 9A62C49D-C45A-4322-9F3C-45958DF0056B
> 
> +  MODULE_TYPE= BASE
> 
> +  VERSION_STRING = 1.0
> 
> +  LIBRARY_CLASS  = FspMeasurementLib
> 
> +
> 
> +#
> 
> +# The following information is for reference only and not required by the
> build tools.
> 
> +#
> 
> +#  VALID_ARCHITECTURES   = IA32 X64
> 
> +#
> 
> +
> 
> +[Sources]
> 
> +  FspMeasurementLib.c
> 
> +
> 
> +[Packages]
> 
> +  MdePkg/MdePkg.dec
> 
> +  MdeModulePkg/MdeModulePkg.dec
> 
> +  SecurityPkg/SecurityPkg.dec
> 
> +  IntelFsp2Pkg/IntelFsp2Pkg.dec
> 
> +  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> 
> +
> 
> +[LibraryClasses]
> 
> +  BaseLib
> 
> +  BaseMemoryLib
> 
> +  DebugLib
> 
> +  PrintLib
> 
> +  PcdLib
> 
> +  PeiServicesLib
> 
> +  PeiServicesTablePointerLib
> 
> +  FspWrapperApiLib
> 
> +  TpmMeasurementLib
> 
> +  HashLib
> 
> +
> 
> +[Ppis]
> 
> +  gEdkiiTcgPpiGuid
> ## CONSUMES
> 
> +
> 
> +[Pcd]
> 
> +  gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig
> ## CONSUMES
> 
> +  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress
> ## CONSUMES
> 
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdTcgPfpMeasurementRevision
> ## CONSUMES
> 
> +
> 
> diff --git
> a/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLi
> b.c
> b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLi
> b.c
> new file mode 100644
> index 00..316570cd2c
> --- /dev/null
> +++
> b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLi
> b.c
> @@ -0,0 +1,349 @@
> +/** @file
> 
> +  This library is used by FSP modules to measure data to TPM.
> 
> +
> 
> +Copyright (c) 2020, 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 
> 
> +
> 
> +#pragma pack (1)
> 
> +
> 
> +#define PLATFORM_FIRMWARE_BLOB_DESC
> "Fv(----)"
> 
> +typedef struct {
> 
> +  UINT8 BlobDescriptionSize;
> 
> +  UINT8
> BlobDescription[sizeof(PLATFORM_FIRMWARE_BLOB_DESC)];
> 
> +  EFI_PHYSICAL_ADDRESS  BlobBase;
> 
> +  UINT64BlobLength;
> 
> +} PLATFORM_FIRMWARE_BLOB2_STRUCT;
> 
> +
> 
> +#define HANDOFF_TABLE_POINTER_DESC  "1234567890ABCDEF"
> 
> +typedef struct {
> 
> +  UINT8 TableDescriptionSize;
> 
> +  UINT8
> TableDescription[sizeof(HANDOFF_TABLE_POINTER_DESC)];
> 
> +  UINT64NumberOfTables;
> 
> +  EFI_CONFIGURATION_TABLE   TableEntry[1];
> 
> +} HANDOFF_TABLE_POINTERS2_STRUCT;
> 
> +
> 
> +#pragma pack ()
> 
> +
> 
> +/**
> 
> +  Tpm measure and log data, and extend the measurement result into a
> specific PCR.
> 
> +
> 
> +  @param[in]  PcrIndex PCR Index.
> 
> +  @param[in]  EventTypeEvent type.
> 
> +  @param[in]  EventLog Measurement event log.
> 
> +  @param[in]  LogLen   Event log length in bytes.
> 
> +  @param[in]  HashData The start of

Re: [edk2-devel] [PATCH V3] Maintainers.txt: Add reviewer for serial and disk

2020-08-05 Thread Ni, Ray
Reviewed-by: Ray Ni 

> -Original Message-
> From: Zeng, Star 
> Sent: Monday, August 3, 2020 2:37 PM
> To: devel@edk2.groups.io; Gao, Zhichao 
> Cc: Wang, Jian J ; Wu, Hao A ; 
> Gao, Liming ; Ni, Ray
> ; Bi, Dandan ; Zeng, Star 
> 
> Subject: RE: [edk2-devel] [PATCH V3] Maintainers.txt: Add reviewer for serial 
> and disk
> 
> Reviewed-by: Star Zeng 
> 
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Gao, Zhichao
> Sent: 2020年8月3日 14:05
> To: devel@edk2.groups.io
> Cc: Gao, Zhichao ; Wang, Jian J 
> ; Wu, Hao A ; Gao,
> Liming ; Ni, Ray ; Bi, Dandan 
> ; Zeng, Star
> 
> Subject: [edk2-devel] [PATCH V3] Maintainers.txt: Add reviewer for serial and 
> disk
> 
> From: "Gao, Zhichao" 
> 
> Signed-off-by: Zhichao Gao 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Liming Gao 
> Cc: Ray Ni 
> Cc: Dandan Bi 
> Cc: Star Zeng 
> ---
> V2:
> Forget to remove the *SerailPort*.h from the common device section in V1.
> Fix it in V2.
> 
> V3:
> Add the missing ':' in V2 for Disk mdoules.
> Add one more module reviewer for SMBIOS.
> 
>  Maintainers.txt | 17 ++---
>  1 file changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt index 5504bb3d17..fe7f04831f 
> 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -286,16 +286,27 @@ F: MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c
>  R: Dandan Bi 
>  R: Liming Gao 
> 
> +MdeModulePkg: Serial modules
> +F: MdeModulePkg/*Serial*/
> +F: MdeModulePkg/Include/*SerialPort*.h
> +R: Hao A Wu 
> +R: Ray Ni 
> +R: Zhichao Gao 
> +
> +MdeModulePkg: Disk modules
> +F: MdeModulePkg/Universal/Disk/
> +R: Hao A Wu 
> +R: Ray Ni 
> +R: Zhichao Gao 
> +
>  MdeModulePkg: Device and Peripheral modules
>  F: MdeModulePkg/*PciHostBridge*/
> -F: MdeModulePkg/*Serial*/
>  F: MdeModulePkg/Bus/
>  F: MdeModulePkg/Include/*Ata*.h
>  F: MdeModulePkg/Include/*IoMmu*.h
>  F: MdeModulePkg/Include/*NonDiscoverableDevice*.h
>  F: MdeModulePkg/Include/*NvmExpress*.h
>  F: MdeModulePkg/Include/*SdMmc*.h
> -F: MdeModulePkg/Include/*SerialPort*.h
>  F: MdeModulePkg/Include/*Ufs*.h
>  F: MdeModulePkg/Include/*Usb*.h
>  F: MdeModulePkg/Include/Guid/RecoveryDevice.h
> @@ -304,7 +315,6 @@ F: MdeModulePkg/Include/Library/PciHostBridgeLib.h
>  F: MdeModulePkg/Include/Ppi/StorageSecurityCommand.h
>  F: MdeModulePkg/Include/Protocol/Ps2Policy.h
>  F: MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/
> -F: MdeModulePkg/Universal/Disk/
>  F: MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/
>  R: Hao A Wu 
>  R: Ray Ni 
> @@ -365,6 +375,7 @@ MdeModulePkg: SMBIOS modules
>  F: MdeModulePkg/Universal/Smbios*/
>  R: Dandan Bi 
>  R: Star Zeng 
> +R: Zhichao Gao 
> 
>  MdeModulePkg: UEFI Variable modules
>  F: MdeModulePkg/*Var*/
> --
> 2.21.0.windows.1
> 
> 
> 
> 


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

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



[edk2-devel] [PATCH v2 7/9] IntelFsp2WraperPkg/Fsp{m|s}WrapperPeim: Add FspBin measurement.

2020-08-05 Thread Qi Zhang
From: Jiewen Yao 

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

Cc: Jiewen Yao 
Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Star Zeng 
Cc: Qi Zhang 
Signed-off-by: Jiewen Yao 
---
 .../FspmWrapperPeim/FspmWrapperPeim.c | 90 ++-
 .../FspmWrapperPeim/FspmWrapperPeim.inf   | 20 +++--
 .../FspsWrapperPeim/FspsWrapperPeim.c | 85 +-
 .../FspsWrapperPeim/FspsWrapperPeim.inf   | 27 +++---
 4 files changed, 203 insertions(+), 19 deletions(-)

diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
index 265b77ed60..f1bff46baa 100644
--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
@@ -3,7 +3,7 @@
   register TemporaryRamDonePpi to call TempRamExit API, and register 
MemoryDiscoveredPpi
   notify to call FspSiliconInit API.
 
-  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -25,11 +25,14 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -147,7 +150,21 @@ FspmWrapperInit (
   VOID
   )
 {
-  EFI_STATUS   Status;
+  EFI_STATUSStatus;
+  EFI_PEI_FIRMWARE_VOLUME_INFO_MEASUREMENT_EXCLUDED_PPI 
*MeasurementExcludedFvPpi;
+  EFI_PEI_PPI_DESCRIPTOR
*MeasurementExcludedPpiList;
+
+  MeasurementExcludedFvPpi = AllocatePool (sizeof(*MeasurementExcludedFvPpi));
+  ASSERT(MeasurementExcludedFvPpi != NULL);
+  MeasurementExcludedFvPpi->Count = 1;
+  MeasurementExcludedFvPpi->Fv[0].FvBase = PcdGet32 (PcdFspmBaseAddress);
+  MeasurementExcludedFvPpi->Fv[0].FvLength = ((EFI_FIRMWARE_VOLUME_HEADER *) 
(UINTN) PcdGet32 (PcdFspmBaseAddress))->FvLength;
+
+  MeasurementExcludedPpiList = AllocatePool 
(sizeof(*MeasurementExcludedPpiList));
+  ASSERT(MeasurementExcludedPpiList != NULL);
+  MeasurementExcludedPpiList->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | 
EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
+  MeasurementExcludedPpiList->Guid  = 
&gEfiPeiFirmwareVolumeInfoMeasurementExcludedPpiGuid;
+  MeasurementExcludedPpiList->Ppi   = MeasurementExcludedFvPpi;
 
   Status = EFI_SUCCESS;
 
@@ -155,6 +172,9 @@ FspmWrapperInit (
 Status = PeiFspMemoryInit ();
 ASSERT_EFI_ERROR (Status);
   } else {
+Status = PeiServicesInstallPpi (MeasurementExcludedPpiList);
+ASSERT_EFI_ERROR (Status);
+
 PeiServicesInstallFvInfoPpi (
   NULL,
   (VOID *)(UINTN) PcdGet32 (PcdFspmBaseAddress),
@@ -167,6 +187,67 @@ FspmWrapperInit (
   return Status;
 }
 
+/**
+  This function is called after TCG installed PPI.
+
+  @param[in] PeiServicesPointer to PEI Services Table.
+  @param[in] NotifyDesc Pointer to the descriptor for the Notification 
event that
+caused this function to execute.
+  @param[in] PpiPointer to the PPI data associated with this 
function.
+
+  @retval EFI_STATUSAlways return EFI_SUCCESS
+**/
+EFI_STATUS
+EFIAPI
+TcgPpiNotify (
+  IN EFI_PEI_SERVICES  **PeiServices,
+  IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
+  IN VOID  *Ppi
+  );
+
+EFI_PEI_NOTIFY_DESCRIPTOR mTcgPpiNotifyDesc = {
+  (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | 
EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+  &gEdkiiTcgPpiGuid,
+  TcgPpiNotify
+};
+
+/**
+  This function is called after TCG installed PPI.
+
+  @param[in] PeiServicesPointer to PEI Services Table.
+  @param[in] NotifyDesc Pointer to the descriptor for the Notification 
event that
+caused this function to execute.
+  @param[in] PpiPointer to the PPI data associated with this 
function.
+
+  @retval EFI_STATUSAlways return EFI_SUCCESS
+**/
+EFI_STATUS
+EFIAPI
+TcgPpiNotify (
+  IN EFI_PEI_SERVICES  **PeiServices,
+  IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
+  IN VOID  *Ppi
+  )
+{
+  UINT32FspMeasureMask;
+
+  DEBUG ((DEBUG_INFO, "TcgPpiNotify FSPM\n"));
+
+  FspMeasureMask = PcdGet32 (PcdFspMeasurementConfig);
+  if (FspMeasureMask & FSP_MEASURE_FSP) {
+if (FspMeasureMask & FSP_MEASURE_FSPT) {
+  MeasureFspFirmwareBlob (0, "FSPT", PcdGet32(PcdFsptBaseAddress),
+  (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) 
PcdGet32 (PcdFsptBaseAddress))->FvLength);
+}
+if (FspMeasureMask & FSP_MEASURE_FSPM) {
+  MeasureFspFirmwareBlob (0, "FSPM", PcdGet32(PcdFspmBaseAddress),
+  (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) 
PcdGet32 (PcdFspmBaseAddress))->FvLength);
+}
+  }
+
+  return EFI_SUCCESS;
+}
+
 /**
   This is the entrypoint of PEIM
 
@@ -182,8 +263,13 @@ FspmWrapperPeimEntryPoint (
   IN CONST EFI_PEI_SERVICES 

[edk2-devel] [PATCH v2 5/9] IntelFsp2WrapperPkg/FspMeasurementLib: Add header file.

2020-08-05 Thread Qi Zhang
From: Jiewen Yao 

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

Cc: Jiewen Yao 
Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Star Zeng 
Cc: Qi Zhang 
Signed-off-by: Jiewen Yao 
---
 .../Include/Library/FspMeasurementLib.h   | 39 +++
 1 file changed, 39 insertions(+)
 create mode 100644 IntelFsp2WrapperPkg/Include/Library/FspMeasurementLib.h

diff --git a/IntelFsp2WrapperPkg/Include/Library/FspMeasurementLib.h 
b/IntelFsp2WrapperPkg/Include/Library/FspMeasurementLib.h
new file mode 100644
index 00..4ab40420ad
--- /dev/null
+++ b/IntelFsp2WrapperPkg/Include/Library/FspMeasurementLib.h
@@ -0,0 +1,39 @@
+/** @file
+  This library is used by FSP modules to measure data to TPM.
+
+Copyright (c) 2020, Intel Corporation. All rights reserved. 
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _FSP_MEASUREMENT_LIB_H_
+#define _FSP_MEASUREMENT_LIB_H_
+
+#define FSP_MEASURE_FSP   BIT0
+#define FSP_MEASURE_FSPT  BIT1
+#define FSP_MEASURE_FSPM  BIT2
+#define FSP_MEASURE_FSPS  BIT3
+#define FSP_MEASURE_FSPUPDBIT31
+
+/**
+  Mesure a FSP FirmwareBlob.
+
+  @param[in]  PcrIndexPCR Index.
+  @param[in]  Descrption  Description for this FirmwareBlob.
+  @param[in]  FirmwareBlobBaseBase address of this FirmwareBlob.
+  @param[in]  FirmwareBlobLength  Size in bytes of this FirmwareBlob.
+
+  @retval EFI_SUCCESS   Operation completed successfully.
+  @retval EFI_UNSUPPORTED   TPM device not available.
+  @retval EFI_OUT_OF_RESOURCES  Out of memory.
+  @retval EFI_DEVICE_ERROR  The operation was unsuccessful.
+*/
+EFI_STATUS
+EFIAPI
+MeasureFspFirmwareBlob (
+  IN UINT32 PcrIndex,
+  IN CHAR8  *Description OPTIONAL,
+  IN EFI_PHYSICAL_ADDRESS   FirmwareBlobBase,
+  IN UINT64 FirmwareBlobLength
+  );
+#endif
-- 
2.26.2.windows.1


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

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



[edk2-devel] [PATCH v2 6/9] IntelFsp2WrapperPkg/FspMeasurementLib: Add BaseFspMeasurementLib.

2020-08-05 Thread Qi Zhang
From: Jiewen Yao 

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

Cc: Jiewen Yao 
Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Star Zeng 
Cc: Qi Zhang 
Signed-off-by: Jiewen Yao 
---
 .../BaseFspMeasurementLib.inf |  54 +++
 .../BaseFspMeasurementLib/FspMeasurementLib.c | 349 ++
 2 files changed, 403 insertions(+)
 create mode 100644 
IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurementLib.inf
 create mode 100644 
IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c

diff --git 
a/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurementLib.inf 
b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurementLib.inf
new file mode 100644
index 00..d30168117d
--- /dev/null
+++ 
b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurementLib.inf
@@ -0,0 +1,54 @@
+## @file
+#  Provides FSP measurement functions.
+#
+#  This library provides MeasureFspFirmwareBlob() to measure FSP binary.
+#
+# Copyright (c) 2020, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = FspMeasurementLib
+  FILE_GUID  = 9A62C49D-C45A-4322-9F3C-45958DF0056B
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = FspMeasurementLib
+
+#
+# The following information is for reference only and not required by the 
build tools.
+#
+#  VALID_ARCHITECTURES   = IA32 X64
+#
+
+[Sources]
+  FspMeasurementLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  SecurityPkg/SecurityPkg.dec
+  IntelFsp2Pkg/IntelFsp2Pkg.dec
+  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  BaseMemoryLib
+  DebugLib
+  PrintLib
+  PcdLib
+  PeiServicesLib
+  PeiServicesTablePointerLib
+  FspWrapperApiLib
+  TpmMeasurementLib
+  HashLib
+
+[Ppis]
+  gEdkiiTcgPpiGuid   ## 
CONSUMES
+
+[Pcd]
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig## 
CONSUMES
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress ## 
CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdTcgPfpMeasurementRevision## 
CONSUMES
+
diff --git 
a/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c 
b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c
new file mode 100644
index 00..316570cd2c
--- /dev/null
+++ b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c
@@ -0,0 +1,349 @@
+/** @file
+  This library is used by FSP modules to measure data to TPM.
+
+Copyright (c) 2020, 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 
+
+#pragma pack (1)
+
+#define PLATFORM_FIRMWARE_BLOB_DESC "Fv(----)"
+typedef struct {
+  UINT8 BlobDescriptionSize;
+  UINT8 
BlobDescription[sizeof(PLATFORM_FIRMWARE_BLOB_DESC)];
+  EFI_PHYSICAL_ADDRESS  BlobBase;
+  UINT64BlobLength;
+} PLATFORM_FIRMWARE_BLOB2_STRUCT;
+
+#define HANDOFF_TABLE_POINTER_DESC  "1234567890ABCDEF"
+typedef struct {
+  UINT8 TableDescriptionSize;
+  UINT8 
TableDescription[sizeof(HANDOFF_TABLE_POINTER_DESC)];
+  UINT64NumberOfTables;
+  EFI_CONFIGURATION_TABLE   TableEntry[1];
+} HANDOFF_TABLE_POINTERS2_STRUCT;
+
+#pragma pack ()
+
+/**
+  Tpm measure and log data, and extend the measurement result into a specific 
PCR.
+
+  @param[in]  PcrIndex PCR Index.
+  @param[in]  EventTypeEvent type.
+  @param[in]  EventLog Measurement event log.
+  @param[in]  LogLen   Event log length in bytes.
+  @param[in]  HashData The start of the data buffer to be hashed, 
extended.
+  @param[in]  HashDataLen  The length, in bytes, of the buffer referenced 
by HashData
+  @param[in]  FlagsBitmap providing additional information.
+
+  @retval EFI_SUCCESS   Operation completed successfully.
+  @retval EFI_UNSUPPORTED   TPM device not available.
+  @retval EFI_OUT_OF_RESOURCES  Out of memory.
+  @retval EFI_DEVICE_ERROR  The operation was unsuccessful.
+**/
+EFI_STATUS
+EFIAPI
+TpmMeasureAndLogDataWithFlags (
+  IN UINT32 PcrIndex,
+  IN UINT32 EventType,
+  IN VOID   *EventLog,
+  IN UINT32 LogLen,
+  IN VOID   *HashData,
+  IN UINT64 HashDataLen,
+  IN UINT64 Flags
+  )
+{
+  EFI_STATUSStatus;
+  EDKII_TCG_PPI *TcgPpi;
+  TCG_PCR_EVENT_HDR Tcg

[edk2-devel] [PATCH v2 4/9] SecurityPkg/PeiTpmMeasurementLib: Add new API.

2020-08-05 Thread Qi Zhang
From: Jiewen Yao 

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

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Qi Zhang 
Signed-off-by: Jiewen Yao 
---
 .../PeiTpmMeasurementLib/EventLogRecord.c | 218 ++
 .../PeiTpmMeasurementLib.inf  |   4 +
 2 files changed, 222 insertions(+)
 create mode 100644 SecurityPkg/Library/PeiTpmMeasurementLib/EventLogRecord.c

diff --git a/SecurityPkg/Library/PeiTpmMeasurementLib/EventLogRecord.c 
b/SecurityPkg/Library/PeiTpmMeasurementLib/EventLogRecord.c
new file mode 100644
index 00..cececdf7b2
--- /dev/null
+++ b/SecurityPkg/Library/PeiTpmMeasurementLib/EventLogRecord.c
@@ -0,0 +1,218 @@
+/** @file
+  This library is used by other modules to measure data to TPM.
+
+Copyright (c) 2020, Intel Corporation. All rights reserved. 
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#pragma pack (1)
+
+#define PLATFORM_FIRMWARE_BLOB_DESC "Fv(----)"
+typedef struct {
+  UINT8 BlobDescriptionSize;
+  UINT8 
BlobDescription[sizeof(PLATFORM_FIRMWARE_BLOB_DESC)];
+  EFI_PHYSICAL_ADDRESS  BlobBase;
+  UINT64BlobLength;
+} PLATFORM_FIRMWARE_BLOB2_STRUCT;
+
+#define HANDOFF_TABLE_POINTER_DESC  "1234567890ABCDEF"
+typedef struct {
+  UINT8 TableDescriptionSize;
+  UINT8 
TableDescription[sizeof(HANDOFF_TABLE_POINTER_DESC)];
+  UINT64NumberOfTables;
+  EFI_CONFIGURATION_TABLE   TableEntry[1];
+} HANDOFF_TABLE_POINTERS2_STRUCT;
+
+#pragma pack ()
+
+/**
+  Get the FvName from the FV header.
+
+  Causion: The FV is untrusted input.
+
+  @param[in]  FvBaseBase address of FV image.
+  @param[in]  FvLength  Length of FV image.
+
+  @return FvName pointer
+  @retval NULL   FvName is NOT found
+**/
+VOID *
+TpmMeasurementGetFvName (
+  IN EFI_PHYSICAL_ADDRESS   FvBase,
+  IN UINT64 FvLength
+  )
+{
+  EFI_FIRMWARE_VOLUME_HEADER  *FvHeader;
+  EFI_FIRMWARE_VOLUME_EXT_HEADER  *FvExtHeader;
+
+  if (FvBase >= MAX_ADDRESS) {
+return NULL;
+  }
+  if (FvLength >= MAX_ADDRESS - FvBase) {
+return NULL;
+  }
+  if (FvLength < sizeof(EFI_FIRMWARE_VOLUME_HEADER)) {
+return NULL;
+  }
+
+  FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FvBase;
+  if (FvHeader->Signature != EFI_FVH_SIGNATURE) {
+return NULL;
+  }
+  if (FvHeader->ExtHeaderOffset < sizeof(EFI_FIRMWARE_VOLUME_HEADER)) {
+return NULL;
+  }
+  if (FvHeader->ExtHeaderOffset + sizeof(EFI_FIRMWARE_VOLUME_EXT_HEADER) > 
FvLength) {
+return NULL;
+  }
+  FvExtHeader = (EFI_FIRMWARE_VOLUME_EXT_HEADER *)(UINTN)(FvBase + 
FvHeader->ExtHeaderOffset);
+
+  return &FvExtHeader->FvName;
+}
+
+/**
+  Mesure a FirmwareBlob.
+
+  @param[in]  PcrIndexPcrIndex of the measurment.
+  @param[in]  Descrption  Description for this FirmwareBlob.
+  @param[in]  FirmwareBlobBaseBase address of this FirmwareBlob.
+  @param[in]  FirmwareBlobLength  Size in bytes of this FirmwareBlob.
+
+  @retval EFI_SUCCESS   Operation completed successfully.
+  @retval EFI_UNSUPPORTED   TPM device not available.
+  @retval EFI_OUT_OF_RESOURCES  Out of memory.
+  @retval EFI_DEVICE_ERROR  The operation was unsuccessful.
+*/
+EFI_STATUS
+EFIAPI
+MeasureFirmwareBlob (
+  IN UINT32 PcrIndex,
+  IN CHAR8  *Description OPTIONAL,
+  IN EFI_PHYSICAL_ADDRESS   FirmwareBlobBase,
+  IN UINT64 FirmwareBlobLength
+  )
+{
+  EFI_PLATFORM_FIRMWARE_BLOBFvBlob;
+  PLATFORM_FIRMWARE_BLOB2_STRUCTFvBlob2;
+  VOID  *FvName;
+  UINT32EventType;
+  VOID  *EventLog;
+  UINT32EventLogSize;
+  EFI_STATUSStatus;
+
+  FvName = TpmMeasurementGetFvName (FirmwareBlobBase, FirmwareBlobLength);
+
+  if (((Description != NULL) || (FvName != NULL)) &&
+  (PcdGet32(PcdTcgPfpMeasurementRevision) >= 
TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_105)) {
+ZeroMem (&FvBlob2, sizeof(FvBlob2));
+if (Description != NULL) {
+  AsciiSPrint((CHAR8*)FvBlob2.BlobDescription, 
sizeof(FvBlob2.BlobDescription), "%a", Description);
+} else {
+  AsciiSPrint((CHAR8*)FvBlob2.BlobDescription, 
sizeof(FvBlob2.BlobDescription), "Fv(%g)", FvName);
+}
+
+FvBlob2.BlobDescriptionSize = sizeof(FvBlob2.BlobDescription);
+FvBlob2.BlobBase = FirmwareBlobBase;
+FvBlob2.BlobLength = FirmwareBlobLength;
+
+EventType = EV_EFI_PLATFORM_FIRMWARE_BLOB2;
+EventLog = &FvBlob2;
+EventLogSize = sizeof(FvBlob2);
+  } else {
+FvBlob.BlobBase = FirmwareBlobBase;
+FvBlob.BlobLength

[edk2-devel] [PATCH v2 8/9] IntelFsp2Wrapper/dsc: Add FspTpmMeasurementLib and PcdFspMeasurementConfig.

2020-08-05 Thread Qi Zhang
From: Jiewen Yao 

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

Cc: Jiewen Yao 
Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Star Zeng 
Cc: Qi Zhang 
Signed-off-by: Jiewen Yao 
---
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec | 17 +
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc |  5 -
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec 
b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
index faf2be621c..4bd3250571 100644
--- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
+++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
@@ -92,6 +92,23 @@
   #
   
gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection|0x0001|UINT8|0x400A
 
+  ## This PCD decides how FSP is measured
+  # 1) The BootGuard ACM may already measured the FSP component, such as 
FSPT/FSPM.
+  # We need a flag (PCD) to indicate if there is need to do such FSP 
measurement or NOT.
+  # 2) The FSP binary includes FSP code and FSP UPD region. The UPD region is 
considered
+  # as configuration block, and it may be updated by OEM by design.
+  # This flag (PCD) is to indicate if we need isolate the the UPD region from 
the FSP code region.
+  # BIT0: Need measure FSP. (for FSP1.x) - reserved in FSP2.
+  # BIT1: Need measure FSPT. (for FSP 2.x)
+  # BIT2: Need measure FSPM. (for FSP 2.x)
+  # BIT3: Need measure FSPS. (for FSP 2.x)
+  # BIT4~30: reserved.
+  # BIT31: Need isolate UPD region measurement.
+#0: measure FSP[T|M|S] as one binary in one record (PCR0).
+#1: measure FSP UPD region in one record (PCR1), the FSP code without UPD 
in another record (PCR0).
+  #
+  
gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig|0x000F|UINT32|0x400B
+
 [PcdsFixedAtBuild, PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]
   #
   ## These are the base address of FSP-M/S
diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc 
b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
index cb4f69285d..5c0d509be4 100644
--- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
+++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
@@ -1,7 +1,7 @@
 ## @file
 # Provides drivers and definitions to support fsp in EDKII bios.
 #
-# Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -45,6 +45,7 @@
   # FSP Wrapper Lib
   
FspWrapperApiLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/BaseFspWrapperApiLib.inf
   
FspWrapperApiTestLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperApiTestLibNull/BaseFspWrapperApiTestLibNull.inf
+  
FspMeasurementLib|IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurementLib.inf
 
   # FSP platform sample
   
FspWrapperPlatformLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
@@ -57,6 +58,7 @@
   PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
   
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
+  
TpmMeasurementLib|SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.inf
 
 [LibraryClasses.common.DXE_DRIVER]
   
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
@@ -73,6 +75,7 @@
   
IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspWrapperPlatformSecLibSample.inf
   
IntelFsp2WrapperPkg/Library/PeiFspWrapperHobProcessLibSample/PeiFspWrapperHobProcessLibSample.inf
   
IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/PeiFspWrapperApiTestLib.inf
+  IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurementLib.inf
 
   IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
   IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf
-- 
2.26.2.windows.1


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

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



[edk2-devel] [PATCH v2 9/9] SecurityPkg/Tcg2: handle PRE HASH and LOG ONLY

2020-08-05 Thread Qi Zhang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2376

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Qi Zhang 
Cc: Rahul Kumar 
Signed-off-by: Qi Zhang 
---
 SecurityPkg/Include/Ppi/Tcg.h |  5 +
 SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 12 +++-
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/SecurityPkg/Include/Ppi/Tcg.h b/SecurityPkg/Include/Ppi/Tcg.h
index 0e943f2465..22f47f9817 100644
--- a/SecurityPkg/Include/Ppi/Tcg.h
+++ b/SecurityPkg/Include/Ppi/Tcg.h
@@ -18,6 +18,11 @@ typedef struct _EDKII_TCG_PPI EDKII_TCG_PPI;
 //
 #define EDKII_TCG_PRE_HASH  0x0001
 
+//
+// This bit is shall be set when HashData is the pre-hash digest and log only.
+//
+#define EDKII_TCG_PRE_HASH_LOG_ONLY  0x0002
+
 /**
   Tpm measure and log data, and extend the measurement result into a specific 
PCR.
 
diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c 
b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
index 246968bb7f..b56b03746c 100644
--- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
+++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
@@ -453,13 +453,15 @@ HashLogExtendEvent (
 return EFI_DEVICE_ERROR;
   }
 
-  if(Flags & EDKII_TCG_PRE_HASH) {
+  if ((Flags & EDKII_TCG_PRE_HASH) || (Flags & EDKII_TCG_PRE_HASH_LOG_ONLY)) {
 ZeroMem (&DigestList, sizeof(DigestList));
 CopyMem (&DigestList, HashData, sizeof(DigestList));
-Status = Tpm2PcrExtend (
- 0,
- &DigestList
- );
+if (Flags & EDKII_TCG_PRE_HASH) {
+  Status = Tpm2PcrExtend (
+   NewEventHdr->PCRIndex,
+   &DigestList
+   );
+}
   } else {
 Status = HashAndExtend (
NewEventHdr->PCRIndex,
-- 
2.26.2.windows.1


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

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



[edk2-devel] [PATCH v2 2/9] MdeModulePkg/NullTpmMeasurementLib: Add new API.

2020-08-05 Thread Qi Zhang
From: Jiewen Yao 

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

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Qi Zhang 
Signed-off-by: Jiewen Yao 
---
 .../TpmMeasurementLibNull.c   | 61 ++-
 .../TpmMeasurementLibNull.inf |  6 +-
 2 files changed, 63 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.c 
b/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.c
index b9c5b68de8..2ce38d8258 100644
--- a/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.c
+++ b/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.c
@@ -1,11 +1,13 @@
 /** @file
   This library is used by other modules to measure data to TPM.
 
-Copyright (c) 2015, Intel Corporation. All rights reserved. 
+Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved. 
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
+#include 
+
 /**
   Tpm measure and log data, and extend the measurement result into a specific 
PCR.
 
@@ -37,3 +39,60 @@ TpmMeasureAndLogData (
   //
   return EFI_SUCCESS;
 }
+
+/**
+  Mesure a FirmwareBlob.
+
+  @param[in]  Descrption  Description for this FirmwareBlob.
+  @param[in]  FirmwareBlobBaseBase address of this FirmwareBlob.
+  @param[in]  FirmwareBlobLength  Size in bytes of this FirmwareBlob.
+
+  @retval EFI_SUCCESS   Operation completed successfully.
+  @retval EFI_UNSUPPORTED   TPM device not available.
+  @retval EFI_OUT_OF_RESOURCES  Out of memory.
+  @retval EFI_DEVICE_ERROR  The operation was unsuccessful.
+*/
+EFI_STATUS
+EFIAPI
+MeasureFirmwareBlob (
+  IN UINT32 PcrIndex,
+  IN CHAR8  *Description OPTIONAL,
+  IN EFI_PHYSICAL_ADDRESS   FirmwareBlobBase,
+  IN UINT64 FirmwareBlobLength
+  )
+{
+  //
+  // Do nothing, just return EFI_SUCCESS.
+  //
+  return EFI_SUCCESS;
+}
+
+/**
+  Mesure a HandoffTable.
+
+  @param[in]  PcrIndexPcrIndex of the measurment.
+  @param[in]  Descrption  Description for this HandoffTable.
+  @param[in]  TableGuid   GUID of this HandoffTable.
+  @param[in]  TableAddressBase address of this HandoffTable.
+  @param[in]  TableLength Size in bytes of this HandoffTable.
+
+  @retval EFI_SUCCESS   Operation completed successfully.
+  @retval EFI_UNSUPPORTED   TPM device not available.
+  @retval EFI_OUT_OF_RESOURCES  Out of memory.
+  @retval EFI_DEVICE_ERROR  The operation was unsuccessful.
+*/
+EFI_STATUS
+EFIAPI
+MeasureHandoffTable (
+  IN UINT32 PcrIndex,
+  IN CHAR8  *Description OPTIONAL,
+  IN EFI_GUID   *TableGuid,
+  IN VOID   *TableAddress,
+  IN UINTN  TableLength
+  )
+{
+  //
+  // Do nothing, just return EFI_SUCCESS.
+  //
+  return EFI_SUCCESS;
+}
diff --git 
a/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf 
b/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
index 61abcfa2ec..1db2c0d6a7 100644
--- a/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
+++ b/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
@@ -1,7 +1,7 @@
 ## @file
 #  Provides NULL TPM measurement function.
 #
-# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -10,9 +10,9 @@
   INF_VERSION= 0x00010005
   BASE_NAME  = TpmMeasurementLibNull
   FILE_GUID  = 6DFD6E9F-9278-48D8-8F45-B6CFF2C2B69C
-  MODULE_TYPE= UEFI_DRIVER
+  MODULE_TYPE= BASE
   VERSION_STRING = 1.0
-  LIBRARY_CLASS  = TpmMeasurementLib|DXE_DRIVER 
DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
+  LIBRARY_CLASS  = TpmMeasurementLib
   MODULE_UNI_FILE= TpmMeasurementLibNull.uni
 
 #
-- 
2.26.2.windows.1


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

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



[edk2-devel] [PATCH v2 0/9] Need add a FSP binary measurement

2020-08-05 Thread Qi Zhang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2376

The EDKII BIOS calls FSP API in FSP Wrapper Pkg.
This FSP code need to be measured into TPM.

We need add a generic module in FSP Wrapper Pkg code to measure:
1) FSP-T, FSP-M, FSP-S in API mode.
2) FSP-T in Dispatch-mode. The FSP-M and FSP-S will be reported
   as standard FV and they will be measured by TCG-PEI.

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Star Zeng 
Cc: Qi Zhang 

Jiewen Yao (8):
  MdeModulePkg/TpmMeasurementLib: Add new API to TpmMeasurmentLib.
  MdeModulePkg/NullTpmMeasurementLib: Add new API.
  SecurityPkg/DxeTpmMeasurementLib: Add new API.
  SecurityPkg/PeiTpmMeasurementLib: Add new API.
  IntelFsp2WrapperPkg/FspMeasurementLib: Add header file.
  IntelFsp2WrapperPkg/FspMeasurementLib: Add BaseFspMeasurementLib.
  IntelFsp2WraperPkg/Fsp{m|s}WrapperPeim: Add FspBin measurement.
  IntelFsp2Wrapper/dsc: Add FspTpmMeasurementLib and
PcdFspMeasurementConfig.

Qi Zhang (1):
  SecurityPkg/Tcg2: handle PRE HASH and LOG ONLY

 .../FspmWrapperPeim/FspmWrapperPeim.c |  90 -
 .../FspmWrapperPeim/FspmWrapperPeim.inf   |  20 +-
 .../FspsWrapperPeim/FspsWrapperPeim.c |  85 -
 .../FspsWrapperPeim/FspsWrapperPeim.inf   |  27 +-
 .../Include/Library/FspMeasurementLib.h   |  39 ++
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec   |  17 +
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc   |   5 +-
 .../BaseFspMeasurementLib.inf |  54 +++
 .../BaseFspMeasurementLib/FspMeasurementLib.c | 349 ++
 .../Include/Library/TpmMeasurementLib.h   |  48 ++-
 .../TpmMeasurementLibNull.c   |  61 ++-
 .../TpmMeasurementLibNull.inf |   6 +-
 SecurityPkg/Include/Ppi/Tcg.h |   5 +
 .../DxeTpmMeasurementLib.inf  |   6 +-
 .../DxeTpmMeasurementLib/EventLogRecord.c | 218 +++
 .../PeiTpmMeasurementLib/EventLogRecord.c | 218 +++
 .../PeiTpmMeasurementLib.inf  |   4 +
 SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c |  12 +-
 18 files changed, 1233 insertions(+), 31 deletions(-)
 create mode 100644 IntelFsp2WrapperPkg/Include/Library/FspMeasurementLib.h
 create mode 100644 
IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurementLib.inf
 create mode 100644 
IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c
 create mode 100644 SecurityPkg/Library/DxeTpmMeasurementLib/EventLogRecord.c
 create mode 100644 SecurityPkg/Library/PeiTpmMeasurementLib/EventLogRecord.c

-- 
2.26.2.windows.1


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

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



[edk2-devel] [PATCH v2 3/9] SecurityPkg/DxeTpmMeasurementLib: Add new API.

2020-08-05 Thread Qi Zhang
From: Jiewen Yao 

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

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Qi Zhang 
Signed-off-by: Jiewen Yao 
---
 .../DxeTpmMeasurementLib.inf  |   6 +-
 .../DxeTpmMeasurementLib/EventLogRecord.c | 218 ++
 2 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 SecurityPkg/Library/DxeTpmMeasurementLib/EventLogRecord.c

diff --git a/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf 
b/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
index 7d41bc41f9..39448f8ee8 100644
--- a/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
+++ b/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
@@ -4,7 +4,7 @@
 #  This library provides TpmMeasureAndLogData() to measure and log data, and
 #  extend the measurement result into a specific PCR.
 #
-# Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2012 - 2020, Intel Corporation. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -26,6 +26,7 @@
 
 [Sources]
   DxeTpmMeasurementLib.c
+  EventLogRecord.c
 
 [Packages]
   MdePkg/MdePkg.dec
@@ -42,3 +43,6 @@
 [Protocols]
   gEfiTcgProtocolGuid   ## SOMETIMES_CONSUMES
   gEfiTcg2ProtocolGuid  ## SOMETIMES_CONSUMES
+
+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdTcgPfpMeasurementRevision  ## 
CONSUMES
diff --git a/SecurityPkg/Library/DxeTpmMeasurementLib/EventLogRecord.c 
b/SecurityPkg/Library/DxeTpmMeasurementLib/EventLogRecord.c
new file mode 100644
index 00..7b3726e44b
--- /dev/null
+++ b/SecurityPkg/Library/DxeTpmMeasurementLib/EventLogRecord.c
@@ -0,0 +1,218 @@
+/** @file
+  This library is used by other modules to measure data to TPM.
+
+Copyright (c) 2020, Intel Corporation. All rights reserved. 
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#pragma pack (1)
+
+#define PLATFORM_FIRMWARE_BLOB_DESC "Fv(----)"
+typedef struct {
+  UINT8 BlobDescriptionSize;
+  UINT8 
BlobDescription[sizeof(PLATFORM_FIRMWARE_BLOB_DESC)];
+  EFI_PHYSICAL_ADDRESS  BlobBase;
+  UINT64BlobLength;
+} PLATFORM_FIRMWARE_BLOB2_STRUCT;
+
+#define HANDOFF_TABLE_POINTER_DESC  "1234567890ABCDEF"
+typedef struct {
+  UINT8 TableDescriptionSize;
+  UINT8 
TableDescription[sizeof(HANDOFF_TABLE_POINTER_DESC)];
+  UINT64NumberOfTables;
+  EFI_CONFIGURATION_TABLE   TableEntry[1];
+} HANDOFF_TABLE_POINTERS2_STRUCT;
+
+#pragma pack ()
+
+/**
+  Get the FvName from the FV header.
+
+  Causion: The FV is untrusted input.
+
+  @param[in]  FvBaseBase address of FV image.
+  @param[in]  FvLength  Length of FV image.
+
+  @return FvName pointer
+  @retval NULL   FvName is NOT found
+**/
+VOID *
+TpmMeasurementGetFvName (
+  IN EFI_PHYSICAL_ADDRESS   FvBase,
+  IN UINT64 FvLength
+  )
+{
+  EFI_FIRMWARE_VOLUME_HEADER  *FvHeader;
+  EFI_FIRMWARE_VOLUME_EXT_HEADER  *FvExtHeader;
+
+  if (FvBase >= MAX_ADDRESS) {
+return NULL;
+  }
+  if (FvLength >= MAX_ADDRESS - FvBase) {
+return NULL;
+  }
+  if (FvLength < sizeof(EFI_FIRMWARE_VOLUME_HEADER)) {
+return NULL;
+  }
+
+  FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FvBase;
+  if (FvHeader->Signature != EFI_FVH_SIGNATURE) {
+return NULL;
+  }
+  if (FvHeader->ExtHeaderOffset < sizeof(EFI_FIRMWARE_VOLUME_HEADER)) {
+return NULL;
+  }
+  if (FvHeader->ExtHeaderOffset + sizeof(EFI_FIRMWARE_VOLUME_EXT_HEADER) > 
FvLength) {
+return NULL;
+  }
+  FvExtHeader = (EFI_FIRMWARE_VOLUME_EXT_HEADER *)(UINTN)(FvBase + 
FvHeader->ExtHeaderOffset);
+
+  return &FvExtHeader->FvName;
+}
+
+/**
+  Mesure a FirmwareBlob.
+
+  @param[in]  PcrIndexPcrIndex of the measurment.
+  @param[in]  Descrption  Description for this FirmwareBlob.
+  @param[in]  FirmwareBlobBaseBase address of this FirmwareBlob.
+  @param[in]  FirmwareBlobLength  Size in bytes of this FirmwareBlob.
+
+  @retval EFI_SUCCESS   Operation completed successfully.
+  @retval EFI_UNSUPPORTED   TPM device not available.
+  @retval EFI_OUT_OF_RESOURCES  Out of memory.
+  @retval EFI_DEVICE_ERROR  The operation was unsuccessful.
+*/
+EFI_STATUS
+EFIAPI
+MeasureFirmwareBlob (
+  IN UINT32 PcrIndex,
+  IN CHAR8  *Description OPTIONAL,
+  IN EFI_PHYSICAL_ADDRESS   FirmwareBlobBase,
+  IN UINT64 FirmwareBlobLength
+  )
+{
+  EFI_PLATFORM_FIRMWARE_BLOBFvBlob;
+  PLATFORM_FIRMWARE_BLOB2_STRUCTFvBlob2;
+  VOID  *FvName;
+  UINT32EventType

[edk2-devel] [PATCH v2 1/9] MdeModulePkg/TpmMeasurementLib: Add new API to TpmMeasurmentLib.

2020-08-05 Thread Qi Zhang
From: Jiewen Yao 

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

Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Qi Zhang 
Signed-off-by: Jiewen Yao 
---
 .../Include/Library/TpmMeasurementLib.h   | 48 ++-
 1 file changed, 47 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Include/Library/TpmMeasurementLib.h 
b/MdeModulePkg/Include/Library/TpmMeasurementLib.h
index ddf6723f03..5a0f97d208 100644
--- a/MdeModulePkg/Include/Library/TpmMeasurementLib.h
+++ b/MdeModulePkg/Include/Library/TpmMeasurementLib.h
@@ -1,7 +1,7 @@
 /** @file
   This library is used by other modules to measure data to TPM.
 
-Copyright (c) 2012, Intel Corporation. All rights reserved. 
+Copyright (c) 2012 - 2020, Intel Corporation. All rights reserved. 
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -35,4 +35,50 @@ TpmMeasureAndLogData (
   IN UINT64 HashDataLen
   );
 
+/**
+  Mesure a FirmwareBlob.
+
+  @param[in]  PcrIndexPCR Index.
+  @param[in]  Descrption  Description for this FirmwareBlob.
+  @param[in]  FirmwareBlobBaseBase address of this FirmwareBlob.
+  @param[in]  FirmwareBlobLength  Size in bytes of this FirmwareBlob.
+
+  @retval EFI_SUCCESS   Operation completed successfully.
+  @retval EFI_UNSUPPORTED   TPM device not available.
+  @retval EFI_OUT_OF_RESOURCES  Out of memory.
+  @retval EFI_DEVICE_ERROR  The operation was unsuccessful.
+*/
+EFI_STATUS
+EFIAPI
+MeasureFirmwareBlob (
+  IN UINT32 PcrIndex,
+  IN CHAR8  *Description OPTIONAL,
+  IN EFI_PHYSICAL_ADDRESS   FirmwareBlobBase,
+  IN UINT64 FirmwareBlobLength
+  );
+
+/**
+  Mesure a HandoffTable.
+
+  @param[in]  PcrIndexPcrIndex of the measurment.
+  @param[in]  Descrption  Description for this HandoffTable.
+  @param[in]  TableGuid   GUID of this HandoffTable.
+  @param[in]  TableAddressBase address of this HandoffTable.
+  @param[in]  TableLength Size in bytes of this HandoffTable.
+
+  @retval EFI_SUCCESS   Operation completed successfully.
+  @retval EFI_UNSUPPORTED   TPM device not available.
+  @retval EFI_OUT_OF_RESOURCES  Out of memory.
+  @retval EFI_DEVICE_ERROR  The operation was unsuccessful.
+*/
+EFI_STATUS
+EFIAPI
+MeasureHandoffTable (
+  IN UINT32 PcrIndex,
+  IN CHAR8  *Description OPTIONAL,
+  IN EFI_GUID   *TableGuid,
+  IN VOID   *TableAddress,
+  IN UINTN  TableLength
+  );
+
 #endif
-- 
2.26.2.windows.1


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

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



Re: [edk2-devel] [PATCH v1 7/7] FmpDevicePkg/FmpDxe: Improve function parameter validation

2020-08-05 Thread Michael Kubacki

Hi Mike,

There's quite a few discrepancies at the moment between functions in 
FmpDxe that implement EFI_FIRMWARE_MANAGEMENT_PROTOCOL and the 
corresponding description in the UEFI spec.


For example:

UEFI Spec 2.8B - EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetImageInfo():

Status Codes Returned

EFI_SUCCESS The image information was successfully returned.
EFI_BUFFER_TOO_SMALLThe ImageInfo buffer was too small. The current
buffer size needed to hold the image(s)
information is returned in ImageInfoSize.
EFI_INVALID_PARAMETER   ImageInfoSize is not too small and ImageInfo is
NULL.
EFI_INVALID_PARAMETER   ImageInfoSize is non-zero and DescriptorVersion
is NULL.
EFI_INVALID_PARAMETER   ImageInfoSize is non-zero and DescriptorCount is
NULL.
EFI_INVALID_PARAMETER   ImageInfoSize is non-zero and DescriptorSize is
NULL.
EFI_INVALID_PARAMETER   ImageInfoSize is non-zero and PackageVersion is
NULL.
EFI_INVALID_PARAMETER   ImageInfoSize is non-zero and PackageVersionName
is NULL.
EFI_DEVICE_ERRORValid information could not be returned.
Possible corrupted image.

Actual - FmpDxe - GetTheImageInfo():

  @retval EFI_SUCCESSThe device was successfully updated
 with the new image.
  @retval EFI_BUFFER_TOO_SMALL   The ImageInfo buffer was too small.
 The current buffer size
 needed to hold the image(s)
 information is returned in
 ImageInfoSize.
  @retval EFI_INVALID_PARAMETER  ImageInfoSize is NULL.
  @retval EFI_DEVICE_ERROR   Valid information could not be
 returned. Possible corrupted image.

There's cases such as in GetTheImage() where the code describes 
EFI_INVALID_PARAMETER is returned as follows:


  @retval EFI_INVALID_PARAMETER  The Image was NULL.

However, the implementation will actually return the status code under 
other conditions such as an invalid ImageIndex or NULL ImageSize pointer.


I agree these should be cleaned up such that implementation and spec 
match and the descriptions are accurate, but that could warrant its own 
series.


For this series, is the ask to leave the descriptions as-is? If so, I 
can file a BZ to resolve the code/spec discrepancies.


Thanks,
Michael

On 8/5/2020 4:30 PM, Michael D Kinney wrote:

Michael,

That is a good point.  I missed that behavior in some of the APIs.

What I also missed was that these APIs are defined in the UEFI Spec and the
description of the return codes is from there and should match the UEFI Spec.

The implementation should be conformant with the UEFI Spec.  If you notice
behavior that is not conformant, then we need to update the code or potentially
work on spec updates.

For this patch series, let’s make sure the Firmware Management Protocol service
headers match the UEFI Spec.

Mike


-Original Message-
From: Michael Kubacki 
Sent: Wednesday, August 5, 2020 1:43 PM
To: Kinney, Michael D ; devel@edk2.groups.io
Cc: Gao, Liming 
Subject: Re: [PATCH v1 7/7] FmpDevicePkg/FmpDxe: Improve function parameter 
validation

Hi Mike,

Some of those functions currently return EFI_SUCCESS if ImageIndex is
invalid. Example:
https://github.com/tianocore/edk2/blob/master/FmpDevicePkg/FmpDxe/FmpDxe.c#L851

Given the request to update the EFI_INVALID_PARAMETER text for those
other functions, I'm assuming you'd like me to make those return
EFI_INVALID_PARAMETER like what GetTheImage() currently does -
https://github.com/tianocore/edk2/blob/master/FmpDevicePkg/FmpDxe/FmpDxe.c#L573?

Thanks,
Michael

On 8/5/2020 9:51 AM, Kinney, Michael D wrote:

Hi Michael,

A few minor comments included below.  With those updates,

Reviewed-bv: Michael D Kinney 

Mike


-Original Message-
From: michael.kuba...@outlook.com 
Sent: Thursday, July 30, 2020 8:15 PM
To: devel@edk2.groups.io
Cc: Gao, Liming ; Kinney, Michael D 

Subject: [PATCH v1 7/7] FmpDevicePkg/FmpDxe: Improve function parameter 
validation

From: Michael Kubacki 

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

Makes some minor improvements to function parameter validation
in FmpDxe, in particular to externally exposed functions such
as those that back EFI_FIRMWARE_MANAGEMENT_PROTOCOL.

Cc: Liming Gao 
Cc: Michael D Kinney 
Signed-off-by: Michael Kubacki 
---
   FmpDevicePkg/FmpDxe/FmpDxe.c | 56 +---
   FmpDevicePkg/FmpDxe/FmpDxe.h | 10 ++--
   2 files changed, 54 insertions(+), 12 deletions(-)

diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
index a3e342591936..958d9b394b71 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -278,6 +278,11 @@ Populat

Re: [edk2-devel] [PATCH v1 7/7] FmpDevicePkg/FmpDxe: Improve function parameter validation

2020-08-05 Thread Michael D Kinney
Michael,

That is a good point.  I missed that behavior in some of the APIs.

What I also missed was that these APIs are defined in the UEFI Spec and the
description of the return codes is from there and should match the UEFI Spec.

The implementation should be conformant with the UEFI Spec.  If you notice
behavior that is not conformant, then we need to update the code or potentially
work on spec updates.

For this patch series, let’s make sure the Firmware Management Protocol service
headers match the UEFI Spec.

Mike

> -Original Message-
> From: Michael Kubacki 
> Sent: Wednesday, August 5, 2020 1:43 PM
> To: Kinney, Michael D ; devel@edk2.groups.io
> Cc: Gao, Liming 
> Subject: Re: [PATCH v1 7/7] FmpDevicePkg/FmpDxe: Improve function parameter 
> validation
> 
> Hi Mike,
> 
> Some of those functions currently return EFI_SUCCESS if ImageIndex is
> invalid. Example:
> https://github.com/tianocore/edk2/blob/master/FmpDevicePkg/FmpDxe/FmpDxe.c#L851
> 
> Given the request to update the EFI_INVALID_PARAMETER text for those
> other functions, I'm assuming you'd like me to make those return
> EFI_INVALID_PARAMETER like what GetTheImage() currently does -
> https://github.com/tianocore/edk2/blob/master/FmpDevicePkg/FmpDxe/FmpDxe.c#L573?
> 
> Thanks,
> Michael
> 
> On 8/5/2020 9:51 AM, Kinney, Michael D wrote:
> > Hi Michael,
> >
> > A few minor comments included below.  With those updates,
> >
> > Reviewed-bv: Michael D Kinney 
> >
> > Mike
> >
> >> -Original Message-
> >> From: michael.kuba...@outlook.com 
> >> Sent: Thursday, July 30, 2020 8:15 PM
> >> To: devel@edk2.groups.io
> >> Cc: Gao, Liming ; Kinney, Michael D 
> >> 
> >> Subject: [PATCH v1 7/7] FmpDevicePkg/FmpDxe: Improve function parameter 
> >> validation
> >>
> >> From: Michael Kubacki 
> >>
> >> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2869
> >>
> >> Makes some minor improvements to function parameter validation
> >> in FmpDxe, in particular to externally exposed functions such
> >> as those that back EFI_FIRMWARE_MANAGEMENT_PROTOCOL.
> >>
> >> Cc: Liming Gao 
> >> Cc: Michael D Kinney 
> >> Signed-off-by: Michael Kubacki 
> >> ---
> >>   FmpDevicePkg/FmpDxe/FmpDxe.c | 56 +---
> >>   FmpDevicePkg/FmpDxe/FmpDxe.h | 10 ++--
> >>   2 files changed, 54 insertions(+), 12 deletions(-)
> >>
> >> diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
> >> index a3e342591936..958d9b394b71 100644
> >> --- a/FmpDevicePkg/FmpDxe/FmpDxe.c
> >> +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
> >> @@ -278,6 +278,11 @@ PopulateDescriptor (
> >> EFI_STATUS  Status;
> >> UINT32  DependenciesSize;
> >>
> >> +  if (Private == NULL) {
> >> +DEBUG ((DEBUG_ERROR, "FmpDxe(%s): PopulateDescriptor() - Private is 
> >> NULL.\n", mImageIdName));
> >> +return;
> >> +  }
> >> +
> >> if (Private->DescriptorPopulated) {
> >>   return;
> >> }
> >> @@ -429,7 +434,7 @@ PopulateDescriptor (
> >> @retval EFI_SUCCESSThe device was successfully updated 
> >> with the new image.
> >> @retval EFI_BUFFER_TOO_SMALL   The ImageInfo buffer was too small. 
> >> The current buffer size
> >>needed to hold the image(s) 
> >> information is returned in ImageInfoSize.
> >> -  @retval EFI_INVALID_PARAMETER  ImageInfoSize is NULL.
> >> +  @retval EFI_INVALID_PARAMETER  A required pointer is NULL.
> >> @retval EFI_DEVICE_ERROR   Valid information could not be 
> >> returned. Possible corrupted image.
> >>
> >>   **/
> >> @@ -451,6 +456,12 @@ GetTheImageInfo (
> >>
> >> Status = EFI_SUCCESS;
> >>
> >> +  if (This == NULL) {
> >> +DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetImageInfo() - This is NULL.\n", 
> >> mImageIdName));
> >> +Status = EFI_INVALID_PARAMETER;
> >> +goto cleanup;
> >> +  }
> >> +
> >> //
> >> // Retrieve the private context structure
> >> //
> >> @@ -536,7 +547,7 @@ GetTheImageInfo (
> >> @retval EFI_BUFFER_TOO_SMALL   The buffer specified by ImageSize is 
> >> too small to hold the
> >>image. The current buffer size needed 
> >> to hold the image is returned
> >>in ImageSize.
> >> -  @retval EFI_INVALID_PARAMETER  The Image was NULL.
> >> +  @retval EFI_INVALID_PARAMETER  A required pointer is NULL or ImageIndex 
> >> is invalid.
> >> @retval EFI_NOT_FOUND  The current image is not copied to the 
> >> buffer.
> >> @retval EFI_UNSUPPORTEDThe operation is not supported.
> >> @retval EFI_SECURITY_VIOLATION The operation could not be performed 
> >> due to an authentication failure.
> >> @@ -561,6 +572,12 @@ GetTheImage (
> >>
> >> Status = EFI_SUCCESS;
> >>
> >> +  if (This == NULL) {
> >> +DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetImage() - This is NULL.\n", 
> >> mImageIdName));
> >> +Status = EFI_INVALID_PARAMETER;
> >> +goto cleanup;
> >> +  }
> >> +
> >> //
> >> // Retrie

[edk2-devel] [PATCH v2 2/7] FmpDevicePkg/FmpDependencyLib: Fix "exression" typo

2020-08-05 Thread Michael Kubacki
From: Michael Kubacki 

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Michael Kubacki 
Reviewed-by: Michael D Kinney 
Reviewed-by: Guomin Jiang 
Reviewed-by: Wei6 Xu 
---
 FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c 
b/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c
index 28358069950a..ba89eb22d9f0 100644
--- a/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c
+++ b/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c
@@ -421,7 +421,7 @@ EvaluateDependency (
 Iterator++;
   }
 
-  DEBUG ((DEBUG_ERROR, "EvaluateDependency: No EFI_FMP_DEP_END Opcode in 
exression!\n"));
+  DEBUG ((DEBUG_ERROR, "EvaluateDependency: No EFI_FMP_DEP_END Opcode in 
expression!\n"));
 
 Error:
   return FALSE;
-- 
2.27.0.windows.1


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

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



[edk2-devel] [PATCH v2 7/7] FmpDevicePkg/FmpDxe: Improve function parameter validation

2020-08-05 Thread Michael Kubacki
From: Michael Kubacki 

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

Makes some minor improvements to function parameter validation
in FmpDxe, in particular to externally exposed functions such
as those that back EFI_FIRMWARE_MANAGEMENT_PROTOCOL.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Michael Kubacki 
Reviewed-by: Michael D Kinney 
Reviewed-by: Guomin Jiang 
Reviewed-by: Wei6 Xu 
---
 FmpDevicePkg/FmpDxe/FmpDxe.c | 59 +---
 FmpDevicePkg/FmpDxe/FmpDxe.h | 10 ++--
 2 files changed, 56 insertions(+), 13 deletions(-)

diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
index a3e342591936..9fa63cff4aa2 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -278,6 +278,11 @@ PopulateDescriptor (
   EFI_STATUS  Status;
   UINT32  DependenciesSize;
 
+  if (Private == NULL) {
+DEBUG ((DEBUG_ERROR, "FmpDxe(%s): PopulateDescriptor() - Private is 
NULL.\n", mImageIdName));
+return;
+  }
+
   if (Private->DescriptorPopulated) {
 return;
   }
@@ -429,7 +434,7 @@ PopulateDescriptor (
   @retval EFI_SUCCESSThe device was successfully updated with 
the new image.
   @retval EFI_BUFFER_TOO_SMALL   The ImageInfo buffer was too small. The 
current buffer size
  needed to hold the image(s) information 
is returned in ImageInfoSize.
-  @retval EFI_INVALID_PARAMETER  ImageInfoSize is NULL.
+  @retval EFI_INVALID_PARAMETER  A required pointer is NULL.
   @retval EFI_DEVICE_ERROR   Valid information could not be returned. 
Possible corrupted image.
 
 **/
@@ -451,6 +456,12 @@ GetTheImageInfo (
 
   Status = EFI_SUCCESS;
 
+  if (This == NULL) {
+DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetImageInfo() - This is NULL.\n", 
mImageIdName));
+Status = EFI_INVALID_PARAMETER;
+goto cleanup;
+  }
+
   //
   // Retrieve the private context structure
   //
@@ -536,7 +547,7 @@ GetTheImageInfo (
   @retval EFI_BUFFER_TOO_SMALL   The buffer specified by ImageSize is too 
small to hold the
  image. The current buffer size needed to hold 
the image is returned
  in ImageSize.
-  @retval EFI_INVALID_PARAMETER  The Image was NULL.
+  @retval EFI_INVALID_PARAMETER  A required pointer is NULL or ImageIndex is 
invalid.
   @retval EFI_NOT_FOUND  The current image is not copied to the buffer.
   @retval EFI_UNSUPPORTEDThe operation is not supported.
   @retval EFI_SECURITY_VIOLATION The operation could not be performed due to 
an authentication failure.
@@ -561,6 +572,12 @@ GetTheImage (
 
   Status = EFI_SUCCESS;
 
+  if (This == NULL) {
+DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetImage() - This is NULL.\n", 
mImageIdName));
+Status = EFI_INVALID_PARAMETER;
+goto cleanup;
+  }
+
   //
   // Retrieve the private context structure
   //
@@ -615,7 +632,8 @@ GetTheImage (
   @param[in]   Image Pointer to the image.
   @param[in]   ImageSize Size of the image.
   @param[in]   AdditionalHeaderSize  Size of any headers that cannot be 
calculated by this function.
-  @param[out]  PayloadSize
+  @param[out]  PayloadSize   An optional pointer to a UINTN that holds 
the size of the payload
+ (image size minus headers)
 
   @retval  !NULL  Valid pointer to the header.
   @retval  NULL   Structure is bad and pointer cannot be found.
@@ -626,7 +644,7 @@ GetFmpHeader (
   IN  CONST EFI_FIRMWARE_IMAGE_AUTHENTICATION  *Image,
   IN  CONST UINTN  ImageSize,
   IN  CONST UINTN  AdditionalHeaderSize,
-  OUT UINTN*PayloadSize
+  OUT UINTN*PayloadSize OPTIONAL
   )
 {
   //
@@ -640,7 +658,10 @@ GetFmpHeader (
 return NULL;
   }
 
-  *PayloadSize = ImageSize - (sizeof (Image->MonotonicCount) + 
Image->AuthInfo.Hdr.dwLength + AdditionalHeaderSize);
+  if (PayloadSize != NULL) {
+*PayloadSize = ImageSize - (sizeof (Image->MonotonicCount) + 
Image->AuthInfo.Hdr.dwLength + AdditionalHeaderSize);
+  }
+
   return (VOID *)((UINT8 *)Image + sizeof (Image->MonotonicCount) + 
Image->AuthInfo.Hdr.dwLength  + AdditionalHeaderSize);
 }
 
@@ -663,6 +684,11 @@ GetAllHeaderSize (
 {
   UINT32  CalculatedSize;
 
+  if (Image == NULL) {
+DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetAllHeaderSize() - Image is NULL.\n", 
mImageIdName));
+return 0;
+  }
+
   CalculatedSize = sizeof (Image->MonotonicCount) +
AdditionalHeaderSize +
Image->AuthInfo.Hdr.dwLength;
@@ -698,7 +724,7 @@ GetAllHeaderSize (
 
   @retval EFI_SUCCESSThe image was successfully checked.
   @retval EFI_ABORTEDThe operation is aborted.
-  @retval EFI_INVALID_PARAMETER  The Image was NULL.
+  @retval EFI_INVALID_PARAMETER  A required pointer is NULL or ImageIndex i

[edk2-devel] [PATCH v2 6/7] FmpDevicePkg/FmpDxe: Indicate ESRT GUID on invalid ImageIdName

2020-08-05 Thread Michael Kubacki
From: Michael Kubacki 

Updates the debug error message to include the GUID of the FMP
instance that encountered the issue to help the user better
isolate the problem.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Michael Kubacki 
Reviewed-by: Michael D Kinney 
Reviewed-by: Guomin Jiang 
Reviewed-by: Wei6 Xu 
---
 FmpDevicePkg/FmpDxe/FmpDxe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
index 14994ce4ee0e..a3e342591936 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -1679,7 +1679,7 @@ FmpDxeEntryPoint (
 //
 // PcdFmpDeviceImageIdName must be set to a non-empty Unicode string
 //
-DEBUG ((DEBUG_ERROR, "FmpDxe: PcdFmpDeviceImageIdName is an empty 
string.\n"));
+DEBUG ((DEBUG_ERROR, "FmpDxe(%g): PcdFmpDeviceImageIdName is an empty 
string.\n", &gEfiCallerIdGuid));
 ASSERT (FALSE);
 return EFI_UNSUPPORTED;
   }
-- 
2.27.0.windows.1


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

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



[edk2-devel] [PATCH v2 3/7] FmpDevicePkg/FmpDependencyLib: Handle version string overflow

2020-08-05 Thread Michael Kubacki
From: Michael Kubacki 

This change recognizes the condition of the DEPEX version string
extending beyond the end of the dependency expression as an error.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Michael Kubacki 
Reviewed-by: Michael D Kinney 
Reviewed-by: Guomin Jiang 
Reviewed-by: Wei6 Xu 
---

Notes:
This is particularly helpful for the user to isolate the issue
when stepping through the control flow as this case will be the
last executed before jumping to the Error label to return from
the function.

 FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c 
b/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c
index ba89eb22d9f0..5ef25d2415cf 100644
--- a/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c
+++ b/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c
@@ -286,6 +286,7 @@ EvaluateDependency (
   Iterator += AsciiStrnLenS ((CHAR8 *) Iterator, DependenciesSize - 
(Iterator - Dependencies->Dependencies));
   if (Iterator == (UINT8 *) Dependencies->Dependencies + DependenciesSize) 
{
 DEBUG ((DEBUG_ERROR, "EvaluateDependency: STRING extends beyond end of 
dependency expression!\n"));
+goto Error;
   }
   break;
 case EFI_FMP_DEP_AND:
-- 
2.27.0.windows.1


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

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



[edk2-devel] [PATCH v2 4/7] FmpDevicePkg/FmpDependencyCheckLib: Return unsatisfied on handle failure

2020-08-05 Thread Michael Kubacki
From: Michael Kubacki 

CheckFmpDependency () will currently return that dependencies are
satisfied if the initial call in the function to locate handles
that have gEfiFirmwareManagementProtocolGuid installed fails.

This change updates the error handling to return FALSE (dependencies
are not satisfied) if this handle search fails.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Michael Kubacki 
Reviewed-by: Michael D Kinney 
Reviewed-by: Guomin Jiang 
Reviewed-by: Wei6 Xu 
---
 FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependencyCheckLib.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependencyCheckLib.c 
b/FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependencyCheckLib.c
index 5e0241b25957..02ed600e0e95 100644
--- a/FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependencyCheckLib.c
+++ b/FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependencyCheckLib.c
@@ -2,6 +2,7 @@
   Provides FMP capsule dependency check services when updating the firmware
   image of a FMP device.
 
+  Copyright (c) Microsoft Corporation.
   Copyright (c) 2020, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -75,6 +76,7 @@ CheckFmpDependency (
 );
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "CheckFmpDependency: Get Firmware Management Protocol 
failed. (%r)", Status));
+IsSatisfied = FALSE;
 goto cleanup;
   }
 
-- 
2.27.0.windows.1


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

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



[edk2-devel] [PATCH v2 0/7] FmpDevicePkg Minor Fixes

2020-08-05 Thread Michael Kubacki
From: Michael Kubacki 

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

This patch series makes minor fixes and enhancements in
FmpDevicePkg. None of the issues impact functionality in a
major way.

These are smaller sets of changes that are being submitted prior
to a larger future patch series that will cover functional changes
for BZ2802.

Note: The series with Reviewed-bys is on the following branch.
https://github.com/makubacki/edk2/tree/fmpdevicepkg_minor_fixes

V2 changes:
1. [PATCH v1 7/7]:
   * Added a DEBUG_ERROR message if the Image parameter is NULL in
   GetAllHeaderSize()
   * Updated the EFI_INVALID_PARAMETER retval description for
   functions that accept an ImageIndex to indicate the status code
   could be returned if ImageIndex is invalid.
   * Updated CheckTheImage() to return EFI_INVALID_PARAMETER if
   ImageIndex is invalid.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Michael Kubacki 
Reviewed-by: Michael D Kinney 
Reviewed-by: Guomin Jiang 
Reviewed-by: Wei6 Xu 

Michael Kubacki (7):
  FmpDevicePkg/FmpDependencyLib: Correct ValidateDependency()
documentation
  FmpDevicePkg/FmpDependencyLib: Fix "exression" typo
  FmpDevicePkg/FmpDependencyLib: Handle version string overflow
  FmpDevicePkg/FmpDependencyCheckLib: Return unsatisfied on handle
failure
  FmpDevicePkg/FmpDxe: Better warn of potential ImageTypeId misconfig
  FmpDevicePkg/FmpDxe: Indicate ESRT GUID on invalid ImageIdName
  FmpDevicePkg/FmpDxe: Improve function parameter validation

 FmpDevicePkg/FmpDxe/FmpDxe.c   | 65 

 FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependencyCheckLib.c |  2 +
 FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c   |  8 ++-
 FmpDevicePkg/FmpDxe/FmpDxe.h   | 10 +--
 FmpDevicePkg/Include/Library/FmpDependencyLib.h|  5 +-
 5 files changed, 69 insertions(+), 21 deletions(-)

-- 
2.27.0.windows.1


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

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



[edk2-devel] [PATCH v2 5/7] FmpDevicePkg/FmpDxe: Better warn of potential ImageTypeId misconfig

2020-08-05 Thread Michael Kubacki
From: Michael Kubacki 

A user may fall through to the case they depend on the
PcdFmpDeviceImageTypeIdGuid value to get the ImageTypeId GUID
value. The default PCD value is 0 (NULL) so the code would
further fall back on the gEfiCallerIdGuid value.

This change modifies the print error level for the message that
indicates this occurred to DEBUG_WARN from DEBUG_INFO to better
warn the user that this occurred.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Michael Kubacki 
Reviewed-by: Michael D Kinney 
Reviewed-by: Guomin Jiang 
Reviewed-by: Wei6 Xu 
---

Notes:
The PCD documentation indicates it is valid behavior for the user
to fall back to gEfiCallerIdGuid. Is that really expected?

Would an ASSERT be appropriate?

 FmpDevicePkg/FmpDxe/FmpDxe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
index 58841774fee0..14994ce4ee0e 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -3,7 +3,7 @@
   image stored in a firmware device with platform and firmware device specific
   information provided through PCDs and libraries.
 
-  Copyright (c) 2016, Microsoft Corporation. All rights reserved.
+  Copyright (c) Microsoft Corporation.
   Copyright (c) 2018 - 2020, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -179,7 +179,7 @@ GetImageTypeIdGuid (
 if (ImageTypeIdGuidSize == sizeof (EFI_GUID)) {
   FmpDeviceLibGuid = (EFI_GUID *)PcdGetPtr (PcdFmpDeviceImageTypeIdGuid);
 } else {
-  DEBUG ((DEBUG_INFO, "FmpDxe(%s): Fall back to ImageTypeIdGuid of 
gEfiCallerIdGuid\n", mImageIdName));
+  DEBUG ((DEBUG_WARN, "FmpDxe(%s): Fall back to ImageTypeIdGuid of 
gEfiCallerIdGuid\n", mImageIdName));
   FmpDeviceLibGuid = &gEfiCallerIdGuid;
 }
   }
-- 
2.27.0.windows.1


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

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



[edk2-devel] [PATCH v2 1/7] FmpDevicePkg/FmpDependencyLib: Correct ValidateDependency() documentation

2020-08-05 Thread Michael Kubacki
From: Michael Kubacki 

Modifies the return value documentation to state that the BOOLEAN
value indicates whether a given dependency expression is valid
not a capsule.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Michael Kubacki 
Reviewed-by: Michael D Kinney 
Reviewed-by: Guomin Jiang 
Reviewed-by: Wei6 Xu 
---
 FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c | 5 +++--
 FmpDevicePkg/Include/Library/FmpDependencyLib.h  | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c 
b/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c
index 91dc0b9abd33..28358069950a 100644
--- a/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c
+++ b/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c
@@ -1,6 +1,7 @@
 /** @file
   Supports Fmp Capsule Dependency Expression.
 
+  Copyright (c) Microsoft Corporation.
   Copyright (c) 2020, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -433,8 +434,8 @@ EvaluateDependency (
   @param[in]   MaxDepexSize   Max size of the dependency.
   @param[out]  DepexSize  Size of dependency.
 
-  @retval TRUEThe capsule is valid.
-  @retval FALSE   The capsule is invalid.
+  @retval TRUEThe dependency expression is valid.
+  @retval FALSE   The dependency expression is invalid.
 
 **/
 BOOLEAN
diff --git a/FmpDevicePkg/Include/Library/FmpDependencyLib.h 
b/FmpDevicePkg/Include/Library/FmpDependencyLib.h
index 1110eefa9a54..c732903425b4 100644
--- a/FmpDevicePkg/Include/Library/FmpDependencyLib.h
+++ b/FmpDevicePkg/Include/Library/FmpDependencyLib.h
@@ -2,6 +2,7 @@
   Fmp Capsule Dependency support functions for Firmware Management Protocol 
based
   firmware updates.
 
+  Copyright (c) Microsoft Corporation.
   Copyright (c) 2020, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -29,8 +30,8 @@ typedef struct {
   @param[in]   MaxDepexSize   Max size of the dependency.
   @param[out]  DepexSize  Size of dependency.
 
-  @retval TRUEThe capsule is valid.
-  @retval FALSE   The capsule is invalid.
+  @retval TRUEThe dependency expression is valid.
+  @retval FALSE   The dependency expression is invalid.
 
 **/
 BOOLEAN
-- 
2.27.0.windows.1


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

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



Re: [edk2-devel] [PATCH v1 7/7] FmpDevicePkg/FmpDxe: Improve function parameter validation

2020-08-05 Thread Michael Kubacki

Hi Mike,

Some of those functions currently return EFI_SUCCESS if ImageIndex is 
invalid. Example: 
https://github.com/tianocore/edk2/blob/master/FmpDevicePkg/FmpDxe/FmpDxe.c#L851


Given the request to update the EFI_INVALID_PARAMETER text for those 
other functions, I'm assuming you'd like me to make those return 
EFI_INVALID_PARAMETER like what GetTheImage() currently does - 
https://github.com/tianocore/edk2/blob/master/FmpDevicePkg/FmpDxe/FmpDxe.c#L573?


Thanks,
Michael

On 8/5/2020 9:51 AM, Kinney, Michael D wrote:

Hi Michael,

A few minor comments included below.  With those updates,

Reviewed-bv: Michael D Kinney 

Mike


-Original Message-
From: michael.kuba...@outlook.com 
Sent: Thursday, July 30, 2020 8:15 PM
To: devel@edk2.groups.io
Cc: Gao, Liming ; Kinney, Michael D 

Subject: [PATCH v1 7/7] FmpDevicePkg/FmpDxe: Improve function parameter 
validation

From: Michael Kubacki 

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

Makes some minor improvements to function parameter validation
in FmpDxe, in particular to externally exposed functions such
as those that back EFI_FIRMWARE_MANAGEMENT_PROTOCOL.

Cc: Liming Gao 
Cc: Michael D Kinney 
Signed-off-by: Michael Kubacki 
---
  FmpDevicePkg/FmpDxe/FmpDxe.c | 56 +---
  FmpDevicePkg/FmpDxe/FmpDxe.h | 10 ++--
  2 files changed, 54 insertions(+), 12 deletions(-)

diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
index a3e342591936..958d9b394b71 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -278,6 +278,11 @@ PopulateDescriptor (
EFI_STATUS  Status;
UINT32  DependenciesSize;

+  if (Private == NULL) {
+DEBUG ((DEBUG_ERROR, "FmpDxe(%s): PopulateDescriptor() - Private is 
NULL.\n", mImageIdName));
+return;
+  }
+
if (Private->DescriptorPopulated) {
  return;
}
@@ -429,7 +434,7 @@ PopulateDescriptor (
@retval EFI_SUCCESSThe device was successfully updated with 
the new image.
@retval EFI_BUFFER_TOO_SMALL   The ImageInfo buffer was too small. The 
current buffer size
   needed to hold the image(s) information 
is returned in ImageInfoSize.
-  @retval EFI_INVALID_PARAMETER  ImageInfoSize is NULL.
+  @retval EFI_INVALID_PARAMETER  A required pointer is NULL.
@retval EFI_DEVICE_ERROR   Valid information could not be returned. 
Possible corrupted image.

  **/
@@ -451,6 +456,12 @@ GetTheImageInfo (

Status = EFI_SUCCESS;

+  if (This == NULL) {
+DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetImageInfo() - This is NULL.\n", 
mImageIdName));
+Status = EFI_INVALID_PARAMETER;
+goto cleanup;
+  }
+
//
// Retrieve the private context structure
//
@@ -536,7 +547,7 @@ GetTheImageInfo (
@retval EFI_BUFFER_TOO_SMALL   The buffer specified by ImageSize is too 
small to hold the
   image. The current buffer size needed to 
hold the image is returned
   in ImageSize.
-  @retval EFI_INVALID_PARAMETER  The Image was NULL.
+  @retval EFI_INVALID_PARAMETER  A required pointer is NULL or ImageIndex is 
invalid.
@retval EFI_NOT_FOUND  The current image is not copied to the 
buffer.
@retval EFI_UNSUPPORTEDThe operation is not supported.
@retval EFI_SECURITY_VIOLATION The operation could not be performed due to 
an authentication failure.
@@ -561,6 +572,12 @@ GetTheImage (

Status = EFI_SUCCESS;

+  if (This == NULL) {
+DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetImage() - This is NULL.\n", 
mImageIdName));
+Status = EFI_INVALID_PARAMETER;
+goto cleanup;
+  }
+
//
// Retrieve the private context structure
//
@@ -615,7 +632,8 @@ GetTheImage (
@param[in]   Image Pointer to the image.
@param[in]   ImageSize Size of the image.
@param[in]   AdditionalHeaderSize  Size of any headers that cannot be 
calculated by this function.
-  @param[out]  PayloadSize
+  @param[out]  PayloadSize   An optional pointer to a UINTN that holds 
the size of the payload
+ (image size minus headers)

@retval  !NULL  Valid pointer to the header.
@retval  NULL   Structure is bad and pointer cannot be found.
@@ -626,7 +644,7 @@ GetFmpHeader (
IN  CONST EFI_FIRMWARE_IMAGE_AUTHENTICATION  *Image,
IN  CONST UINTN  ImageSize,
IN  CONST UINTN  AdditionalHeaderSize,
-  OUT UINTN*PayloadSize
+  OUT UINTN*PayloadSize OPTIONAL
)
  {
//
@@ -640,7 +658,10 @@ GetFmpHeader (
  return NULL;
}

-  *PayloadSize = ImageSize - (sizeof (Image->MonotonicCount) + 
Image->AuthInfo.Hdr.dwLength + AdditionalHeaderSize);
+  if (PayloadSize != NULL) {
+*PayloadSize = ImageSize - (sizeof (Image->MonotonicCount) + 
Image->AuthInfo.Hdr.dwLength + Additional

Re: [EXTERNAL] Re: [edk2-devel] [PATCH edk2-platforms 2/3] Silicon/NXP: Add support for reserving a chunk from RAM

2020-08-05 Thread Bret Barkelew via groups.io
Agreed with your gut feeling.

- Bret

From: Leif Lindholm via groups.io
Sent: Wednesday, August 5, 2020 8:12 AM
To: Pankaj Bansal
Cc: Meenakshi Aggarwal; 
devel@edk2.groups.io; Ard 
Biesheuvel
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH edk2-platforms 2/3] Silicon/NXP: 
Add support for reserving a chunk from RAM

On Wed, Jul 08, 2020 at 00:19:32 -0500, Pankaj Bansal wrote:
> From: Pankaj Bansal 
>
> Some NXP SOCs have some specialized IP blocks (like MC), which
> require DDR memory to operate. This DDR memory should not be managed
> by OS or UEFI.
>
> Moreover to ensure that these IP blocks always get memory, and maximum
> contiguous RAM is available for UEFI and OS to use, add the support for
> reserving a chunk from RAM before reporting available RAM to UEFI.

I can't shake the feeling this code has the wrong level of
complexity. It's reserving *one* memory window, at a given alignment.

> Signed-off-by: Pankaj Bansal 
> ---
>  Silicon/NXP/NxpQoriqLs.dec|  10 ++
>  Silicon/NXP/LX2160A/LX2160A.dsc.inc   |   4 +
>  Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf |   3 +
>  Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c   | 142 
> +++-
>  4 files changed, 157 insertions(+), 2 deletions(-)
>
> diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec
> index 188a9fe1f382..0e762066e547 100644
> --- a/Silicon/NXP/NxpQoriqLs.dec
> +++ b/Silicon/NXP/NxpQoriqLs.dec
> @@ -41,3 +41,13 @@ [PcdsDynamic.common]
>gNxpQoriqLsTokenSpaceGuid.PcdPciCfgShiftEnable|FALSE|BOOLEAN|0x0600
>gNxpQoriqLsTokenSpaceGuid.PcdPciLsGen4Ctrl|FALSE|BOOLEAN|0x0601
>gNxpQoriqLsTokenSpaceGuid.PcdPciHideRootPort|FALSE|BOOLEAN|0x0602
> +
> +  # Reserved RAM Base address alignment. This number ought to be Power of two
> +  # in case no alignment is needed, this number should be 1.

(As has been pointed out to me in the past, 1 is also a power of 2...)

> +  gNxpQoriqLsTokenSpaceGuid.PcdReservedMemAlignment|0x1|UINT64|0x0603
> +  # Size of the RAM to be reserved. This RAM region is neither reported to 
> UEFI
> +  # nor to OS

"Reported" is an inaccurate description of the mechanism involved.

> +  gNxpQoriqLsTokenSpaceGuid.PcdReservedMemSize|0x0|UINT64|0x0604
> +  # Reserved RAM Base address which is calculated based on PcdReservedMemSize
> +  # and PcdReservedMemAlignment
> +  gNxpQoriqLsTokenSpaceGuid.PcdReservedMemBase|0x0|UINT64|0x0605

Why  use a Pcd for something that is calculated at runtime and needs
to be used immediately? Moreover, I see this Pcd getting set, but I
then don't see it getting used ever?

> diff --git a/Silicon/NXP/LX2160A/LX2160A.dsc.inc 
> b/Silicon/NXP/LX2160A/LX2160A.dsc.inc
> index 43e361464c8e..755ca169f213 100644
> --- a/Silicon/NXP/LX2160A/LX2160A.dsc.inc
> +++ b/Silicon/NXP/LX2160A/LX2160A.dsc.inc
> @@ -29,6 +29,10 @@ [PcdsDynamicDefault.common]
>gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x620
>gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0xC0C
>
> +[PcdsDynamicHii]
> +  
> gNxpQoriqLsTokenSpaceGuid.PcdReservedMemAlignment|L"ReservedMemAlignment"|gEfiGlobalVariableGuid|0x0|0x2000|NV,BS
> +  
> gNxpQoriqLsTokenSpaceGuid.PcdReservedMemSize|L"ReservedMemSize"|gEfiGlobalVariableGuid|0x0|0x2000|NV,BS
> +

And here we get Hii involved, but I see no connection to a user
interface form.

>  [PcdsFixedAtBuild.common]
>gArmTokenSpaceGuid.PcdGenericWatchdogControlBase|0x23A
>gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase|0x239
> diff --git a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf 
> b/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf
> index a33f8cd3f743..ed23a86b43d9 100644
> --- a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf
> +++ b/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf
> @@ -49,6 +49,9 @@ [FixedPcd]
>  [Pcd]
>gArmTokenSpaceGuid.PcdSystemMemoryBase
>gArmTokenSpaceGuid.PcdSystemMemorySize
> +  gNxpQoriqLsTokenSpaceGuid.PcdReservedMemAlignment
> +  gNxpQoriqLsTokenSpaceGuid.PcdReservedMemBase
> +  gNxpQoriqLsTokenSpaceGuid.PcdReservedMemSize
>
>  [Depex]
>TRUE
> diff --git a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c 
> b/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c
> index 11d1f1260b35..b416323a4ced 100644
> --- a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c
> +++ b/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c
> @@ -118,6 +118,127 @@ GetDramRegionsInfo (
>return EFI_BUFFER_TOO_SMALL;
>  }
>
> +/**
> +  Calculate the base address of Reserved RAM.
> +  Reserved RAM is not reported to either UEFI or OS.

Here is the word "reported" again.
A region is included in the memory map or not.
If we are setting parts of the memory map aside, then we should do
that by mar

[edk2-devel] [PATCH v2 1/2] .pytool/Plugin: Enable BUILDREPORT on server CI builds

2020-08-05 Thread Bret Barkelew
Update the CI invocable that builds host-based unit tests to make
sure that BUILDREPORT is built for all tests. This is useful for
determining which libraries were consumed in the build.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Bret Barkelew 
---
 .pytool/Plugin/CompilerPlugin/CompilerPlugin.py | 2 ++
 .pytool/Plugin/HostUnitTestCompilerPlugin/HostUnitTestCompilerPlugin.py | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/.pytool/Plugin/CompilerPlugin/CompilerPlugin.py 
b/.pytool/Plugin/CompilerPlugin/CompilerPlugin.py
index e8657940d71b..e804fd5ed89a 100644
--- a/.pytool/Plugin/CompilerPlugin/CompilerPlugin.py
+++ b/.pytool/Plugin/CompilerPlugin/CompilerPlugin.py
@@ -54,6 +54,8 @@ class CompilerPlugin(ICiBuildPlugin):
 #   - output_stream the StringIO output stream from this plugin via logging
 def RunBuildPlugin(self, packagename, Edk2pathObj, pkgconfig, environment, 
PLM, PLMHelper, tc, output_stream=None):
 self._env = environment
+environment.SetValue("BUILDREPORTING", "TRUE", "Set in CompilerPlugin")
+environment.SetValue("BUILDREPORT_TYPES", "PCD DEPEX LIBRARY 
BUILD_FLAGS", "Set in CompilerPlugin")
 
 # Parse the config for required DscPath element
 if "DscPath" not in pkgconfig:
diff --git 
a/.pytool/Plugin/HostUnitTestCompilerPlugin/HostUnitTestCompilerPlugin.py 
b/.pytool/Plugin/HostUnitTestCompilerPlugin/HostUnitTestCompilerPlugin.py
index f21b40caf291..43abd1f4795b 100644
--- a/.pytool/Plugin/HostUnitTestCompilerPlugin/HostUnitTestCompilerPlugin.py
+++ b/.pytool/Plugin/HostUnitTestCompilerPlugin/HostUnitTestCompilerPlugin.py
@@ -86,6 +86,8 @@ class HostUnitTestCompilerPlugin(ICiBuildPlugin):
 def RunBuildPlugin(self, packagename, Edk2pathObj, pkgconfig, environment, 
PLM, PLMHelper, tc, output_stream=None):
 self._env = environment
 environment.SetValue("CI_BUILD_TYPE", "host_unit_test", "Set in 
HostUnitTestCompilerPlugin")
+environment.SetValue("BUILDREPORTING", "TRUE", "Set in 
HostUnitTestCompilerPlugin")
+environment.SetValue("BUILDREPORT_TYPES", "PCD DEPEX LIBRARY 
BUILD_FLAGS", "Set in HostUnitTestCompilerPlugin")
 
 # Parse the config for required DscPath element
 if "DscPath" not in pkgconfig:
-- 
2.27.0.windows.1


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

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



[edk2-devel] [PATCH v2 2/2] .azurepipelines: Add BUILD_REPORT to collected artifacts

2020-08-05 Thread Bret Barkelew
Make sure that the BUILD_REPORT is collected on server builds
following the PR gate steps.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Bret Barkelew 
---
 .azurepipelines/templates/pr-gate-steps.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.azurepipelines/templates/pr-gate-steps.yml 
b/.azurepipelines/templates/pr-gate-steps.yml
index c1c0c04d6c17..414f3e0910da 100644
--- a/.azurepipelines/templates/pr-gate-steps.yml
+++ b/.azurepipelines/templates/pr-gate-steps.yml
@@ -119,6 +119,7 @@ steps:
   TestSuites.xml
   **/BUILD_TOOLS_REPORT.html
   **/OVERRIDELOG.TXT
+  **/BUILD_REPORT.TXT
 flattenFolders: true
   condition: succeededOrFailed()
 
-- 
2.27.0.windows.1


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

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



[edk2-devel] [PATCH v2 0/2] Add BUILDREPORT to server builds

2020-08-05 Thread Bret Barkelew
Update CI plugins to generate a BUILDREPORT on build steps.
This is especially useful for HostBased tests which are often run
locally and which use unique library combinations. Helps to figure
out which libraries were standard and which were for unit tests.

Bret Barkelew (2):
  .pytool/Plugin: Enable BUILDREPORT on server CI builds
  .azurepipelines: Add BUILD_REPORT to collected artifacts

 .azurepipelines/templates/pr-gate-steps.yml | 1 +
 .pytool/Plugin/CompilerPlugin/CompilerPlugin.py | 2 ++
 .pytool/Plugin/HostUnitTestCompilerPlugin/HostUnitTestCompilerPlugin.py | 2 ++
 3 files changed, 5 insertions(+)

-- 
2.27.0.windows.1


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

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



Re: [edk2-devel] [PATCH v1 7/7] FmpDevicePkg/FmpDxe: Improve function parameter validation

2020-08-05 Thread Michael D Kinney
Hi Michael,

A few minor comments included below.  With those updates,

Reviewed-bv: Michael D Kinney 

Mike

> -Original Message-
> From: michael.kuba...@outlook.com 
> Sent: Thursday, July 30, 2020 8:15 PM
> To: devel@edk2.groups.io
> Cc: Gao, Liming ; Kinney, Michael D 
> 
> Subject: [PATCH v1 7/7] FmpDevicePkg/FmpDxe: Improve function parameter 
> validation
> 
> From: Michael Kubacki 
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2869
> 
> Makes some minor improvements to function parameter validation
> in FmpDxe, in particular to externally exposed functions such
> as those that back EFI_FIRMWARE_MANAGEMENT_PROTOCOL.
> 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Signed-off-by: Michael Kubacki 
> ---
>  FmpDevicePkg/FmpDxe/FmpDxe.c | 56 +---
>  FmpDevicePkg/FmpDxe/FmpDxe.h | 10 ++--
>  2 files changed, 54 insertions(+), 12 deletions(-)
> 
> diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
> index a3e342591936..958d9b394b71 100644
> --- a/FmpDevicePkg/FmpDxe/FmpDxe.c
> +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
> @@ -278,6 +278,11 @@ PopulateDescriptor (
>EFI_STATUS  Status;
>UINT32  DependenciesSize;
> 
> +  if (Private == NULL) {
> +DEBUG ((DEBUG_ERROR, "FmpDxe(%s): PopulateDescriptor() - Private is 
> NULL.\n", mImageIdName));
> +return;
> +  }
> +
>if (Private->DescriptorPopulated) {
>  return;
>}
> @@ -429,7 +434,7 @@ PopulateDescriptor (
>@retval EFI_SUCCESSThe device was successfully updated 
> with the new image.
>@retval EFI_BUFFER_TOO_SMALL   The ImageInfo buffer was too small. The 
> current buffer size
>   needed to hold the image(s) information 
> is returned in ImageInfoSize.
> -  @retval EFI_INVALID_PARAMETER  ImageInfoSize is NULL.
> +  @retval EFI_INVALID_PARAMETER  A required pointer is NULL.
>@retval EFI_DEVICE_ERROR   Valid information could not be 
> returned. Possible corrupted image.
> 
>  **/
> @@ -451,6 +456,12 @@ GetTheImageInfo (
> 
>Status = EFI_SUCCESS;
> 
> +  if (This == NULL) {
> +DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetImageInfo() - This is NULL.\n", 
> mImageIdName));
> +Status = EFI_INVALID_PARAMETER;
> +goto cleanup;
> +  }
> +
>//
>// Retrieve the private context structure
>//
> @@ -536,7 +547,7 @@ GetTheImageInfo (
>@retval EFI_BUFFER_TOO_SMALL   The buffer specified by ImageSize is too 
> small to hold the
>   image. The current buffer size needed to 
> hold the image is returned
>   in ImageSize.
> -  @retval EFI_INVALID_PARAMETER  The Image was NULL.
> +  @retval EFI_INVALID_PARAMETER  A required pointer is NULL or ImageIndex is 
> invalid.
>@retval EFI_NOT_FOUND  The current image is not copied to the 
> buffer.
>@retval EFI_UNSUPPORTEDThe operation is not supported.
>@retval EFI_SECURITY_VIOLATION The operation could not be performed due to 
> an authentication failure.
> @@ -561,6 +572,12 @@ GetTheImage (
> 
>Status = EFI_SUCCESS;
> 
> +  if (This == NULL) {
> +DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetImage() - This is NULL.\n", 
> mImageIdName));
> +Status = EFI_INVALID_PARAMETER;
> +goto cleanup;
> +  }
> +
>//
>// Retrieve the private context structure
>//
> @@ -615,7 +632,8 @@ GetTheImage (
>@param[in]   Image Pointer to the image.
>@param[in]   ImageSize Size of the image.
>@param[in]   AdditionalHeaderSize  Size of any headers that cannot be 
> calculated by this function.
> -  @param[out]  PayloadSize
> +  @param[out]  PayloadSize   An optional pointer to a UINTN that 
> holds the size of the payload
> + (image size minus headers)
> 
>@retval  !NULL  Valid pointer to the header.
>@retval  NULL   Structure is bad and pointer cannot be found.
> @@ -626,7 +644,7 @@ GetFmpHeader (
>IN  CONST EFI_FIRMWARE_IMAGE_AUTHENTICATION  *Image,
>IN  CONST UINTN  ImageSize,
>IN  CONST UINTN  AdditionalHeaderSize,
> -  OUT UINTN*PayloadSize
> +  OUT UINTN*PayloadSize OPTIONAL
>)
>  {
>//
> @@ -640,7 +658,10 @@ GetFmpHeader (
>  return NULL;
>}
> 
> -  *PayloadSize = ImageSize - (sizeof (Image->MonotonicCount) + 
> Image->AuthInfo.Hdr.dwLength + AdditionalHeaderSize);
> +  if (PayloadSize != NULL) {
> +*PayloadSize = ImageSize - (sizeof (Image->MonotonicCount) + 
> Image->AuthInfo.Hdr.dwLength + AdditionalHeaderSize);
> +  }
> +
>return (VOID *)((UINT8 *)Image + sizeof (Image->MonotonicCount) + 
> Image->AuthInfo.Hdr.dwLength  + AdditionalHeaderSize);
>  }
> 
> @@ -663,6 +684,10 @@ GetAllHeaderSize (
>  {
>UINT32  CalculatedSize;
> 
> +  if (Image == NULL) {

This is an internal helper function.  If Image is 

Re: [edk2-devel] [PATCH v1 1/7] FmpDevicePkg/FmpDependencyLib: Correct ValidateDependency() documentation

2020-08-05 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: michael.kuba...@outlook.com
> 
> Sent: Thursday, July 30, 2020 8:15 PM
> To: devel@edk2.groups.io
> Cc: Gao, Liming ; Kinney, Michael
> D 
> Subject: [PATCH v1 1/7] FmpDevicePkg/FmpDependencyLib:
> Correct ValidateDependency() documentation
> 
> From: Michael Kubacki 
> 
> Modifies the return value documentation to state that
> the BOOLEAN
> value indicates whether a given dependency expression is
> valid
> not a capsule.
> 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Signed-off-by: Michael Kubacki
> 
> ---
> 
> FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c
> | 5 +++--
>  FmpDevicePkg/Include/Library/FmpDependencyLib.h
> | 5 +++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git
> a/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib
> .c
> b/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib
> .c
> index 91dc0b9abd33..28358069950a 100644
> ---
> a/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib
> .c
> +++
> b/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib
> .c
> @@ -1,6 +1,7 @@
>  /** @file
>Supports Fmp Capsule Dependency Expression.
> 
> +  Copyright (c) Microsoft Corporation.
>Copyright (c) 2020, Intel Corporation. All rights
> reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -433,8 +434,8 @@ EvaluateDependency (
>@param[in]   MaxDepexSize   Max size of the
> dependency.
>@param[out]  DepexSize  Size of dependency.
> 
> -  @retval TRUEThe capsule is valid.
> -  @retval FALSE   The capsule is invalid.
> +  @retval TRUEThe dependency expression is valid.
> +  @retval FALSE   The dependency expression is invalid.
> 
>  **/
>  BOOLEAN
> diff --git
> a/FmpDevicePkg/Include/Library/FmpDependencyLib.h
> b/FmpDevicePkg/Include/Library/FmpDependencyLib.h
> index 1110eefa9a54..c732903425b4 100644
> --- a/FmpDevicePkg/Include/Library/FmpDependencyLib.h
> +++ b/FmpDevicePkg/Include/Library/FmpDependencyLib.h
> @@ -2,6 +2,7 @@
>Fmp Capsule Dependency support functions for Firmware
> Management Protocol based
>firmware updates.
> 
> +  Copyright (c) Microsoft Corporation.
>Copyright (c) 2020, Intel Corporation. All rights
> reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -29,8 +30,8 @@ typedef struct {
>@param[in]   MaxDepexSize   Max size of the
> dependency.
>@param[out]  DepexSize  Size of dependency.
> 
> -  @retval TRUEThe capsule is valid.
> -  @retval FALSE   The capsule is invalid.
> +  @retval TRUEThe dependency expression is valid.
> +  @retval FALSE   The dependency expression is invalid.
> 
>  **/
>  BOOLEAN
> --
> 2.27.0.windows.1


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

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



Re: [edk2-devel] [PATCH v1 6/7] FmpDevicePkg/FmpDxe: Indicate ESRT GUID on invalid ImageIdName

2020-08-05 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: devel@edk2.groups.io  On
> Behalf Of Michael Kubacki
> Sent: Thursday, July 30, 2020 8:15 PM
> To: devel@edk2.groups.io
> Cc: Gao, Liming ; Kinney, Michael
> D 
> Subject: [edk2-devel] [PATCH v1 6/7]
> FmpDevicePkg/FmpDxe: Indicate ESRT GUID on invalid
> ImageIdName
> 
> From: Michael Kubacki 
> 
> Updates the debug error message to include the GUID of
> the FMP
> instance that encountered the issue to help the user
> better
> isolate the problem.
> 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Signed-off-by: Michael Kubacki
> 
> ---
>  FmpDevicePkg/FmpDxe/FmpDxe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c
> b/FmpDevicePkg/FmpDxe/FmpDxe.c
> index 14994ce4ee0e..a3e342591936 100644
> --- a/FmpDevicePkg/FmpDxe/FmpDxe.c
> +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
> @@ -1679,7 +1679,7 @@ FmpDxeEntryPoint (
>  //
>  // PcdFmpDeviceImageIdName must be set to a non-
> empty Unicode string
>  //
> -DEBUG ((DEBUG_ERROR, "FmpDxe:
> PcdFmpDeviceImageIdName is an empty string.\n"));
> +DEBUG ((DEBUG_ERROR, "FmpDxe(%g):
> PcdFmpDeviceImageIdName is an empty string.\n",
> &gEfiCallerIdGuid));
>  ASSERT (FALSE);
>  return EFI_UNSUPPORTED;
>}
> --
> 2.27.0.windows.1
> 
> 
> 


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

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



Re: [edk2-devel] [PATCH v1 4/7] FmpDevicePkg/FmpDependencyCheckLib: Return unsatisfied on handle failure

2020-08-05 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: michael.kuba...@outlook.com
> 
> Sent: Thursday, July 30, 2020 8:15 PM
> To: devel@edk2.groups.io
> Cc: Gao, Liming ; Kinney, Michael
> D 
> Subject: [PATCH v1 4/7]
> FmpDevicePkg/FmpDependencyCheckLib: Return unsatisfied
> on handle failure
> 
> From: Michael Kubacki 
> 
> CheckFmpDependency () will currently return that
> dependencies are
> satisfied if the initial call in the function to locate
> handles
> that have gEfiFirmwareManagementProtocolGuid installed
> fails.
> 
> This change updates the error handling to return FALSE
> (dependencies
> are not satisfied) if this handle search fails.
> 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Signed-off-by: Michael Kubacki
> 
> ---
> 
> FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependency
> CheckLib.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git
> a/FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependen
> cyCheckLib.c
> b/FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependen
> cyCheckLib.c
> index 5e0241b25957..02ed600e0e95 100644
> ---
> a/FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependen
> cyCheckLib.c
> +++
> b/FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependen
> cyCheckLib.c
> @@ -2,6 +2,7 @@
>Provides FMP capsule dependency check services when
> updating the firmware
>image of a FMP device.
> 
> +  Copyright (c) Microsoft Corporation.
>Copyright (c) 2020, Intel Corporation. All rights
> reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -75,6 +76,7 @@ CheckFmpDependency (
>  );
>if (EFI_ERROR (Status)) {
>  DEBUG ((DEBUG_ERROR, "CheckFmpDependency: Get
> Firmware Management Protocol failed. (%r)", Status));
> +IsSatisfied = FALSE;
>  goto cleanup;
>}
> 
> --
> 2.27.0.windows.1


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

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



Re: [edk2-devel] [PATCH v1 5/7] FmpDevicePkg/FmpDxe: Better warn of potential ImageTypeId misconfig

2020-08-05 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: michael.kuba...@outlook.com
> 
> Sent: Thursday, July 30, 2020 8:15 PM
> To: devel@edk2.groups.io
> Cc: Gao, Liming ; Kinney, Michael
> D 
> Subject: [PATCH v1 5/7] FmpDevicePkg/FmpDxe: Better warn
> of potential ImageTypeId misconfig
> 
> From: Michael Kubacki 
> 
> A user may fall through to the case they depend on the
> PcdFmpDeviceImageTypeIdGuid value to get the ImageTypeId
> GUID
> value. The default PCD value is 0 (NULL) so the code
> would
> further fall back on the gEfiCallerIdGuid value.
> 
> This change modifies the print error level for the
> message that
> indicates this occurred to DEBUG_WARN from DEBUG_INFO to
> better
> warn the user that this occurred.
> 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Signed-off-by: Michael Kubacki
> 
> ---
> 
> Notes:
> The PCD documentation indicates it is valid behavior
> for the user
> to fall back to gEfiCallerIdGuid. Is that really
> expected?
> 
> Would an ASSERT be appropriate?
> 
>  FmpDevicePkg/FmpDxe/FmpDxe.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c
> b/FmpDevicePkg/FmpDxe/FmpDxe.c
> index 58841774fee0..14994ce4ee0e 100644
> --- a/FmpDevicePkg/FmpDxe/FmpDxe.c
> +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
> @@ -3,7 +3,7 @@
>image stored in a firmware device with platform and
> firmware device specific
>information provided through PCDs and libraries.
> 
> -  Copyright (c) 2016, Microsoft Corporation. All rights
> reserved.
> +  Copyright (c) Microsoft Corporation.
>Copyright (c) 2018 - 2020, Intel Corporation. All
> rights reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -179,7 +179,7 @@ GetImageTypeIdGuid (
>  if (ImageTypeIdGuidSize == sizeof (EFI_GUID)) {
>FmpDeviceLibGuid = (EFI_GUID *)PcdGetPtr
> (PcdFmpDeviceImageTypeIdGuid);
>  } else {
> -  DEBUG ((DEBUG_INFO, "FmpDxe(%s): Fall back to
> ImageTypeIdGuid of gEfiCallerIdGuid\n", mImageIdName));
> +  DEBUG ((DEBUG_WARN, "FmpDxe(%s): Fall back to
> ImageTypeIdGuid of gEfiCallerIdGuid\n", mImageIdName));
>FmpDeviceLibGuid = &gEfiCallerIdGuid;
>  }
>}
> --
> 2.27.0.windows.1


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

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



Re: [edk2-devel] [PATCH v1 3/7] FmpDevicePkg/FmpDependencyLib: Handle version string overflow

2020-08-05 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: michael.kuba...@outlook.com
> 
> Sent: Thursday, July 30, 2020 8:15 PM
> To: devel@edk2.groups.io
> Cc: Gao, Liming ; Kinney, Michael
> D 
> Subject: [PATCH v1 3/7] FmpDevicePkg/FmpDependencyLib:
> Handle version string overflow
> 
> From: Michael Kubacki 
> 
> This change recognizes the condition of the DEPEX
> version string
> extending beyond the end of the dependency expression as
> an error.
> 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Signed-off-by: Michael Kubacki
> 
> ---
> 
> Notes:
> This is particularly helpful for the user to isolate
> the issue
> when stepping through the control flow as this case
> will be the
> last executed before jumping to the Error label to
> return from
> the function.
> 
> 
> FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c
> | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git
> a/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib
> .c
> b/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib
> .c
> index ba89eb22d9f0..5ef25d2415cf 100644
> ---
> a/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib
> .c
> +++
> b/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib
> .c
> @@ -286,6 +286,7 @@ EvaluateDependency (
>Iterator += AsciiStrnLenS ((CHAR8 *) Iterator,
> DependenciesSize - (Iterator - Dependencies-
> >Dependencies));
>if (Iterator == (UINT8 *) Dependencies-
> >Dependencies + DependenciesSize) {
>  DEBUG ((DEBUG_ERROR, "EvaluateDependency:
> STRING extends beyond end of dependency
> expression!\n"));
> +goto Error;
>}
>break;
>  case EFI_FMP_DEP_AND:
> --
> 2.27.0.windows.1


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

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



Re: [edk2-devel] [PATCH v1 2/7] FmpDevicePkg/FmpDependencyLib: Fix "exression" typo

2020-08-05 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: michael.kuba...@outlook.com
> 
> Sent: Thursday, July 30, 2020 8:15 PM
> To: devel@edk2.groups.io
> Cc: Gao, Liming ; Kinney, Michael
> D 
> Subject: [PATCH v1 2/7] FmpDevicePkg/FmpDependencyLib:
> Fix "exression" typo
> 
> From: Michael Kubacki 
> 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Signed-off-by: Michael Kubacki
> 
> ---
> 
> FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c
> | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib
> .c
> b/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib
> .c
> index 28358069950a..ba89eb22d9f0 100644
> ---
> a/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib
> .c
> +++
> b/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib
> .c
> @@ -421,7 +421,7 @@ EvaluateDependency (
>  Iterator++;
>}
> 
> -  DEBUG ((DEBUG_ERROR, "EvaluateDependency: No
> EFI_FMP_DEP_END Opcode in exression!\n"));
> +  DEBUG ((DEBUG_ERROR, "EvaluateDependency: No
> EFI_FMP_DEP_END Opcode in expression!\n"));
> 
>  Error:
>return FALSE;
> --
> 2.27.0.windows.1


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

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



Re: [edk2-devel] [Patch 4/4] Readme.rst: List submodules and links to licenses

2020-08-05 Thread Michael D Kinney
Hi Leif,

Thank you for the reviews!

For generated files, I think there are two categories

1) Files generated as part of the build process that are
   placed in the build output directly and are never
   checked into a repository.  

2) Files that are generated from a tool used by a developer,
   and a developer then checks the generated files into
   a repository.

Which recent events are you referring to?

Thanks,

Mike

> -Original Message-
> From: Leif Lindholm 
> Sent: Wednesday, August 5, 2020 3:14 AM
> To: devel@edk2.groups.io; Kinney, Michael D
> 
> Cc: Andrew Fish ; Laszlo Ersek
> 
> Subject: Re: [edk2-devel] [Patch 4/4] Readme.rst: List
> submodules and links to licenses
> 
> Hi Mike,
> 
> For the series:
> Reviewed-by: Leif Lindholm 
> 
> Recent events make me think though - should we have an
> explicit
> statement regarding those files we have that are
> generated without an
> explicit license?
> 
> /
> Leif
> 
> On Tue, Aug 04, 2020 at 12:10:10 -0700, Michael D Kinney
> wrote:
> > Update list of content that is covered by a license
> other than
> > the BSD-2-Clause Plus Patent License and break out
> list of
> > content that is included as a git submodule from
> upstream
> > projects.
> >
> > * Use alphabetic order of content
> > * Remove references to IntelFrameworkModulePkg
> > * Add reference for UnitTestFrameworkPkg use of cmocka
> >
> > Cc: Andrew Fish 
> > Cc: Laszlo Ersek 
> > Cc: Leif Lindholm 
> > Signed-off-by: Michael D Kinney
> 
> > ---
> >  ReadMe.rst | 22 --
> >  1 file changed, 16 insertions(+), 6 deletions(-)
> >
> > diff --git a/ReadMe.rst b/ReadMe.rst
> > index d597e34efc..a16e13547f 100644
> > --- a/ReadMe.rst
> > +++ b/ReadMe.rst
> > @@ -69,16 +69,26 @@ The majority of the content in the
> EDK II open source project uses a
> >  source project contains the following components that
> are covered by additional
> >  licenses:
> >
> > --  `BaseTools/Source/C/BrotliCompress/brotli
> `_
> _
> > --
> `MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> `_
> _
> >  -  `BaseTools/Source/C/LzmaCompress
> `__
> > --  `MdeModulePkg/Library/LzmaCustomDecompressLib
>  README.txt>`__
> > --
> `IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib
> /Sdk
>  /LZMA-SDK-README.txt>`__
> >  -  `BaseTools/Source/C/VfrCompile/Pccts
> `__
> > --
> `MdeModulePkg/Universal/RegularExpressionDxe/oniguruma
>  >`__
> > +-
> `CryptoPkg\Library\BaseCryptLib\SysCall\inet_pton.c
> `__
> > +-  `CryptoPkg\Library\Include\crypto\dso_conf.h
>  8d6aafaa34d4172f56f1ffb72/LICENSE>`__
> > +-  `CryptoPkg\Library\Include\openssl\opensslconf.h
>  8d6aafaa34d4172f56f1ffb72/LICENSE>`__
> > +-  `EmbeddedPkg/Library/FdtLib
> `__.  (EDK II uses BSD
> License)
> > +-  `EmbeddedPkg/Include/fdt.h
> `__.  (EDK II uses BSD
> Licence)
> > +-  `EmbeddedPkg/Include/libfdt.h
> `__.  (EDK II uses BSD
> License)
> > +-  `MdeModulePkg/Library/LzmaCustomDecompressLib
>  README.txt>`__
> >  -  `OvmfPkg `__
> > --  `CryptoPkg/Library/OpensslLib/openssl
>  259de725451f201e784599687/LICENSE>`__
> > +
> > +The EDK II open source project uses content from
> upstream projects as git submodules
> > +that are covered by additional licenses.
> > +
> >  -  `ArmPkg/Library/ArmSoftFloatLib/berkeley-
> softfloat-3  softfloat-
> 3/blob/b64af41c3276f97f0e181920400ee056b9c88037/COPYING.
> txt>`__
> > +-  `BaseTools/Source/C/BrotliCompress/brotli
>  c303d79a83d4ffbdd12cc8d/LICENSE>`__
> > +-  `CryptoPkg/Library/OpensslLib/openssl
>  8d6aafaa34d4172f56f1ffb72/LICENSE>`__
> > +-
> `MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
>  c303d79a83d4ffbdd12cc8d/LICENSE>`__
> > +-
> `MdeModulePkg/Universal/RegularExpressionDxe/oniguruma
>  309032467785e06975678f0d/COPYING>`__
> > +-  `UnitTestFrameworkPkg/Library/CmockaLib/cmocka
>  YING?h=cmocka-
> 1.1.5&id=f5e2cd77c88d9f792562888d2b70c5a396bfbf7a>`__
> >
> >  The EDK II Project is composed of packages. The
> maintainers for each package
> >  are listed in `Maintainers.txt `__.
> > --
> > 2.21.0.windows.1
> >
> >
> > 
> >

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

View/Reply Online (#63728): https://edk2.groups.io/g/devel/message/63728
Mute This Topic: https://groups.io/mt/75993660/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/

Re: [edk2-devel] question about MSFT compiler/link option

2020-08-05 Thread Michael D Kinney
Hi,

I think you are seeing the impact of compiler optimizations.

If a global variable is never referenced after optimizing the
code, then the global variable will be optimized away.  This
type of optimization is important for size constrained 
environment like firmware.  

By using the /Gw- flag, you are disabling the ability of the
compiler to optimize away unreferenced global variables.

If you update the code in your example to guarantee the
global variable is always accessed for all types of builds,
then I suspect you will always see the global in the map.

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On
> Behalf Of Tiger Liu(BJ-RD)
> Sent: Tuesday, August 4, 2020 11:34 PM
> To: devel@edk2.groups.io; Gao, Liming
> 
> Subject: Re: [edk2-devel] question about MSFT
> compiler/link option
> 
> Hi, Liming:
> Thanks for your reply!
> 
> I checked map file, not find this global data array.
> 
> I found if added this build option in this PEIM's inf,
> then it seems ok.
> [BuildOptions]
> MSFT:*_*_IA32_CC_FLAGS   = /Gw-
> 
> Thanks
> 
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表
> Liming Gao
> 发送时间: 2020年8月4日 23:21
> 收件人: devel@edk2.groups.io; Tiger Liu(BJ-RD)
> 
> 主题: Re: [edk2-devel] question about MSFT compiler/link
> option
> 
> If this global variable is used by code, it will be
> linked into the final EFI image. You can check whether
> the generate map file includes it.
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On
> Behalf Of Tiger
> > Liu(BJ-RD)
> > Sent: Tuesday, August 4, 2020 5:34 PM
> > To: devel@edk2.groups.io
> > Subject: [edk2-devel] question about MSFT
> compiler/link option
> >
> > Hi, Experts:
> > I have a question about MSFT compiler/link option.
> >
> > I wrote a PEIM, which had a large global data array
> definition in a C file.
> > Such as:
> > PRI_DATA_STRUCT  PdataStructTable[] = {
> > {01,   0x75,0xF0, 0x0, 0x0,
> 0x0 },
> > {02,   0x77,0xF0, 0x0, 0x0,
> 0x0 },
> > {03,   0x79,0xF0, 0x0, 0x0,
> 0x0 },
> > {04,   0x7B,0xF0, 0x0, 0x0,
> 0x0 },
> > {05,   0x7D,0xF0, 0x0, 0x0,
> 0x0 },
> > {06,   0x7F,0xF0, 0x0, 0x0,
> 0x0 },
> > ..
> > };
> >
> > This global data array is very large, about 20KB.
> >
> > But I found the PEIM's compiled size is about 5KB, it
> seems not include this global data array in the efi
> binary statically.
> > Even the release version PEIM's size is larger than
> debug version.
> >
> > I found when compiling release version, the link
> option has :
> > /MERGE:.rdata=.data It seems release binary included
> the global data array in the final efi image.
> >
> > So, my question is:
> > Will the global data array be in linked into the final
> efi binary image when compiling debug version?
> >
> > Thanks
> >
> >
> > 保密声明:
> > 本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内
> 容做任何未经授权的查阅、使用、复制或转发。
> > CONFIDENTIAL NOTE:
> > This email contains confidential or legally privileged
> information and
> > is for the sole use of its intended recipient. Any
> unauthorized review, use, copying or forwarding of this
> email or the content of this email is strictly
> prohibited.
> >
> >
> 
> 
> 
> 
> 
> 
> 保密声明:
> 本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容
> 做任何未经授权的查阅、使用、复制或转发。
> CONFIDENTIAL NOTE:
> This email contains confidential or legally privileged
> information and is for the sole use of its intended
> recipient. Any unauthorized review, use, copying or
> forwarding of this email or the content of this email is
> strictly prohibited.
> 
> 


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

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



Re: [edk2-devel] [edk2-platforms PATCH 1/5] Silicon/Synopsys/DesignWare: Import DesignWare USB3 peripheral driver

2020-08-05 Thread Vin Xue
Hi Leif,

Sorry I missed your mail.

For License issue I will update it later.

I know there are some DesignWare USB controller driver, but most of them
are for USB Host Mode. The driver "UsbDeviceDxe" is for USB Device Mode
(i.e. peripheral). Usually it can be as the driver to support Android Fastboot
feature. How about your suggestion about directory name? (Also change driver
name?)

Best regards,
Vin


From: Leif Lindholm 
Sent: Thursday, July 30, 2020 8:18 PM
To: Vin Xue 
Cc: devel@edk2.groups.io ; Michael D Kinney 

Subject: Re: [edk2-platforms PATCH 1/5] Silicon/Synopsys/DesignWare: Import 
DesignWare USB3 peripheral driver

Hi Vin, +Mike,

Sorry for delay in responding.
OK, so we know where it comes from - but we can no longer accept code
under the plan 2-clause BSD license into edk2-platforms master.
However, 2-clause BSD can be relicensed as 2-clause BSD + patent.

Please do so, converting the comment header license statements to
SPDX-License-Identifier: BSD-2-Clause-Patent
tags.

I also think there is more than one DesignWare USB controller, so we
could probably do with a more specific directory name than
"UsbDeviceDxe".

Best Regards,

Leif

On Tue, Jul 21, 2020 at 03:51:19 +, Vin Xue wrote:
> Hi Leif,
>
> The origin code is from edk2-platforms
> /devel-IntelAtomProcessorE3900 branch.
> https://github.com/tianocore/edk2-platforms/
> tree/devel-IntelAtomProcessorE3900/Platform/
> BroxtonPlatformPkg/Common/Features/UsbDeviceDxe
>
> In Patch 1/5 is the origin source code with BSD2 license, and
> I updated license to BSD+Patent license in Patch 2/5.
> Please check it.
>
> From my review, the driver code flow is similar to Linux kernel
> DWC3 driver. Maybe it's feasible to ARM platform if do some changes.
>
> Best regards,
> Vin
>
> 
> From: Leif Lindholm 
> Sent: Tuesday, July 21, 2020 1:43 AM
> To: Vin Xue 
> Cc: devel@edk2.groups.io ; Ard Biesheuvel 
> ; Meenakshi Aggarwal 
> Subject: Re: [edk2-platforms PATCH 1/5] Silicon/Synopsys/DesignWare: Import 
> DesignWare USB3 peripheral driver
>
> Hi Vin, +Meenakshi
>
> Can you clarify the exact origin of this source code please?
> We can only accept bsd+patent code contributions, and these days we
> use only SPDX tags rather than full license statements at top of
> files.
>
> Meenakshi - I would certainly prefer to have a single (and
> Arm-functional) driver for DWC3 rather than init-only drivers per
> platform. Can you have a look at this code plese and see if it looks
> feasible to integrate in the NXP platforms?
>
> Regards,
>
> Leif
>
> On Fri, Jul 17, 2020 at 18:01:59 +0800, Vin Xue wrote:
> > Incorporate the driver for the DesignWare USB3 DRD controller device
> > mode (peripheral) that is defined in
> > edk2-platforms/devel-IntelAtomProcessorE3900 branch.
> >
> > The driver is supported by Intel Atom series (Merrifield/BayTrail/
> > CherryTrail/Broxton/ApoloLake/GeminiLake etc.) and Core series
> > (6th Generation and newer).
> >
> > The driver verified on AAEON UP Squared developer board (Intel
> > ApoloLake platform).
> >
> > The driver supports Synopsys DesignWare DWC_usb3 and DWC_usb31 IP.
> >
> > It is better if the driver can be ported to ARM silicon.
> >
> > Cc: Ard Biesheuvel 
> > Cc: Leif Lindholm 
> > Signed-off-by: Vin Xue 
> > ---
> >  .../Drivers/UsbDeviceDxe/ComponentName.c  |  305 ++
> >  .../Drivers/UsbDeviceDxe/UsbDeviceDxe.c   |  395 ++
> >  .../Drivers/UsbDeviceDxe/UsbDeviceDxe.h   |  159 +
> >  .../Drivers/UsbDeviceDxe/UsbDeviceDxe.inf |   74 +
> >  .../Drivers/UsbDeviceDxe/UsbDeviceMode.c  | 1489 ++
> >  .../Drivers/UsbDeviceDxe/UsbDeviceMode.h  |   39 +
> >  .../Drivers/UsbDeviceDxe/UsbFuncIo.c  | 2221 +
> >  .../Drivers/UsbDeviceDxe/UsbFuncIo.h  |  234 +
> >  .../Drivers/UsbDeviceDxe/UsbIoNode.c  |  177 +
> >  .../Drivers/UsbDeviceDxe/UsbIoNode.h  |   90 +
> >  .../Drivers/UsbDeviceDxe/XdciCommon.h |  156 +
> >  .../DesignWare/Drivers/UsbDeviceDxe/XdciDWC.c | 4030 +
> >  .../DesignWare/Drivers/UsbDeviceDxe/XdciDWC.h |  741 +++
> >  .../Drivers/UsbDeviceDxe/XdciDevice.c |  695 +++
> >  .../Drivers/UsbDeviceDxe/XdciDevice.h |  184 +
> >  .../Drivers/UsbDeviceDxe/XdciInterface.h  |  241 +
> >  .../Drivers/UsbDeviceDxe/XdciTable.c  |   55 +
> >  .../Drivers/UsbDeviceDxe/XdciUtility.c|  148 +
> >  .../Drivers/UsbDeviceDxe/XdciUtility.h|   62 +
> >  .../DesignWare/Include/Library/UsbDeviceLib.h |  323 ++
> >  .../DesignWare/Include/Protocol/EfiUsbFnIo.h  |  430 ++
> >  .../Include/Protocol/UsbDeviceModeProtocol.h  |  104 +
> >  22 files changed, 12352 insertions(+)
> >  create mode 100644 
> > Silicon/Synopsys/DesignWare/Drivers/UsbDeviceDxe/ComponentName.c
> >  create mode 100644 
> > Silicon/Synopsys/DesignWare/Drivers/UsbDeviceDxe/UsbDeviceDxe.c
> >  create mode 100644 
> > Silicon/Synopsys/DesignWare/Drivers/UsbDeviceDxe/UsbD

Re: [edk2-devel] [PATCH edk2-platforms 2/3] Silicon/NXP: Add support for reserving a chunk from RAM

2020-08-05 Thread Leif Lindholm
On Wed, Jul 08, 2020 at 00:19:32 -0500, Pankaj Bansal wrote:
> From: Pankaj Bansal 
> 
> Some NXP SOCs have some specialized IP blocks (like MC), which
> require DDR memory to operate. This DDR memory should not be managed
> by OS or UEFI.
> 
> Moreover to ensure that these IP blocks always get memory, and maximum
> contiguous RAM is available for UEFI and OS to use, add the support for
> reserving a chunk from RAM before reporting available RAM to UEFI.

I can't shake the feeling this code has the wrong level of
complexity. It's reserving *one* memory window, at a given alignment.

> Signed-off-by: Pankaj Bansal 
> ---
>  Silicon/NXP/NxpQoriqLs.dec|  10 ++
>  Silicon/NXP/LX2160A/LX2160A.dsc.inc   |   4 +
>  Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf |   3 +
>  Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c   | 142 
> +++-
>  4 files changed, 157 insertions(+), 2 deletions(-)
> 
> diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec
> index 188a9fe1f382..0e762066e547 100644
> --- a/Silicon/NXP/NxpQoriqLs.dec
> +++ b/Silicon/NXP/NxpQoriqLs.dec
> @@ -41,3 +41,13 @@ [PcdsDynamic.common]
>gNxpQoriqLsTokenSpaceGuid.PcdPciCfgShiftEnable|FALSE|BOOLEAN|0x0600
>gNxpQoriqLsTokenSpaceGuid.PcdPciLsGen4Ctrl|FALSE|BOOLEAN|0x0601
>gNxpQoriqLsTokenSpaceGuid.PcdPciHideRootPort|FALSE|BOOLEAN|0x0602
> +
> +  # Reserved RAM Base address alignment. This number ought to be Power of two
> +  # in case no alignment is needed, this number should be 1.

(As has been pointed out to me in the past, 1 is also a power of 2...)

> +  gNxpQoriqLsTokenSpaceGuid.PcdReservedMemAlignment|0x1|UINT64|0x0603
> +  # Size of the RAM to be reserved. This RAM region is neither reported to 
> UEFI
> +  # nor to OS

"Reported" is an inaccurate description of the mechanism involved.

> +  gNxpQoriqLsTokenSpaceGuid.PcdReservedMemSize|0x0|UINT64|0x0604
> +  # Reserved RAM Base address which is calculated based on PcdReservedMemSize
> +  # and PcdReservedMemAlignment
> +  gNxpQoriqLsTokenSpaceGuid.PcdReservedMemBase|0x0|UINT64|0x0605

Why  use a Pcd for something that is calculated at runtime and needs
to be used immediately? Moreover, I see this Pcd getting set, but I
then don't see it getting used ever?

> diff --git a/Silicon/NXP/LX2160A/LX2160A.dsc.inc 
> b/Silicon/NXP/LX2160A/LX2160A.dsc.inc
> index 43e361464c8e..755ca169f213 100644
> --- a/Silicon/NXP/LX2160A/LX2160A.dsc.inc
> +++ b/Silicon/NXP/LX2160A/LX2160A.dsc.inc
> @@ -29,6 +29,10 @@ [PcdsDynamicDefault.common]
>gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x620
>gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0xC0C
>  
> +[PcdsDynamicHii]
> +  
> gNxpQoriqLsTokenSpaceGuid.PcdReservedMemAlignment|L"ReservedMemAlignment"|gEfiGlobalVariableGuid|0x0|0x2000|NV,BS
> +  
> gNxpQoriqLsTokenSpaceGuid.PcdReservedMemSize|L"ReservedMemSize"|gEfiGlobalVariableGuid|0x0|0x2000|NV,BS
> +

And here we get Hii involved, but I see no connection to a user
interface form.

>  [PcdsFixedAtBuild.common]
>gArmTokenSpaceGuid.PcdGenericWatchdogControlBase|0x23A
>gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase|0x239
> diff --git a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf 
> b/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf
> index a33f8cd3f743..ed23a86b43d9 100644
> --- a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf
> +++ b/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf
> @@ -49,6 +49,9 @@ [FixedPcd]
>  [Pcd]
>gArmTokenSpaceGuid.PcdSystemMemoryBase
>gArmTokenSpaceGuid.PcdSystemMemorySize
> +  gNxpQoriqLsTokenSpaceGuid.PcdReservedMemAlignment
> +  gNxpQoriqLsTokenSpaceGuid.PcdReservedMemBase
> +  gNxpQoriqLsTokenSpaceGuid.PcdReservedMemSize
>  
>  [Depex]
>TRUE
> diff --git a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c 
> b/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c
> index 11d1f1260b35..b416323a4ced 100644
> --- a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c
> +++ b/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c
> @@ -118,6 +118,127 @@ GetDramRegionsInfo (
>return EFI_BUFFER_TOO_SMALL;
>  }
>  
> +/**
> +  Calculate the base address of Reserved RAM.
> +  Reserved RAM is not reported to either UEFI or OS.

Here is the word "reported" again.
A region is included in the memory map or not.
If we are setting parts of the memory map aside, then we should do
that by marking them as EfiReservedMemoryType.

> +
> +  @param[in, out] DramRegions  Array of type DRAM_REGION_INFO. The size of 
> this
> +   array must be one more (+ 1) than the maximum
> +   regions supported on platform. This is 
> because,
> +   if due to Reserved RAM alignment requirements 
> a
> +   hole is created in any DRAM region, then the 
> RAM
> + 

Re: [edk2-devel] [PATCH edk2-platforms 3/3] Silicon/NXP: Add Support for git commit info print

2020-08-05 Thread Leif Lindholm
On Wed, Jul 08, 2020 at 00:19:33 -0500, Pankaj Bansal wrote:
> From: Pankaj Bansal 
> 
> This patch adds the Support for printing the git commit information
> in linux build environment.
> 
> Ideal place of retrieving this information should be python script in
> BaseTools.
> 
> A Feature request for the same has been created:
> https://bugzilla.tianocore.org/show_bug.cgi?id=2838
> 
> Signed-off-by: Pankaj Bansal 
> ---
>  Silicon/NXP/NxpQoriqLs.dsc.inc   |  3 ++
>  Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf   |  5 +++
>  Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.inf |  5 +++
>  Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.c | 17 +
>  Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.c   | 17 +
>  Silicon/NXP/set_firmware_ver.sh  | 36 
> 
>  6 files changed, 83 insertions(+)
> 
> diff --git a/Silicon/NXP/NxpQoriqLs.dsc.inc b/Silicon/NXP/NxpQoriqLs.dsc.inc
> index 06ee012c227a..a0762a6ef61d 100644
> --- a/Silicon/NXP/NxpQoriqLs.dsc.inc
> +++ b/Silicon/NXP/NxpQoriqLs.dsc.inc
> @@ -224,6 +224,9 @@ [PcdsDynamicHii.common.DEFAULT]
>
> gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|10
>  
>  [PcdsFixedAtBuild.common]
> +  !ifdef $(FIRMWARE_VER)
> +
> gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)"
> +  !endif
>gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
>gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x2800
>gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE
> diff --git a/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf 
> b/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf
> index f5dbd1349dc5..69f884af9e34 100644
> --- a/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf
> +++ b/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf
> @@ -16,6 +16,7 @@ [Defines]
>  
>  [Packages]
>ArmPkg/ArmPkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
>MdePkg/MdePkg.dec
>Silicon/NXP/Chassis2/Chassis2.dec
>Silicon/NXP/NxpQoriqLs.dec
> @@ -24,6 +25,7 @@ [LibraryClasses]
>IoAccessLib
>IoLib
>PcdLib
> +  PrintLib
>SerialPortLib
>  
>  [Sources.common]
> @@ -31,3 +33,6 @@ [Sources.common]
>  
>  [FeaturePcd]
>gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian
> +
> +[FixedPcd]
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
> diff --git a/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.inf 
> b/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.inf
> index 75b68cc4ca2d..632acc52b20a 100644
> --- a/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.inf
> +++ b/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.inf
> @@ -16,6 +16,7 @@ [Defines]
>  
>  [Packages]
>ArmPkg/ArmPkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
>MdePkg/MdePkg.dec
>Silicon/NXP/Chassis3V2/Chassis3V2.dec
>Silicon/NXP/NxpQoriqLs.dec
> @@ -24,6 +25,7 @@ [LibraryClasses]
>IoAccessLib
>IoLib
>PcdLib
> +  PrintLib
>SerialPortLib
>  
>  [Sources.common]
> @@ -31,3 +33,6 @@ [Sources.common]
>  
>  [FeaturePcd]
>gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian
> +
> +[FixedPcd]
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
> diff --git a/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.c 
> b/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.c
> index 91b19f832f00..bc782e7e3873 100644
> --- a/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.c
> +++ b/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.c
> @@ -12,6 +12,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  
>  /**
> @@ -89,10 +90,26 @@ ChassisInit (
>VOID
>)
>  {
> +  CHAR8 Buffer[100];
> +  UINTN CharCount;
> +
>//
>// Early init serial Port to get board information.
>//
>SerialPortInitialize ();
>  
> +  CharCount = AsciiSPrint (
> +Buffer, sizeof (Buffer),
> +"UEFI firmware built at %a on %a. version:\n\r",
> +__TIME__, __DATE__
> +  );
> +  SerialPortWrite ((UINT8 *) Buffer, CharCount);

Drop space before Buffer.

> +
> +  CharCount = AsciiSPrint (
> +Buffer, sizeof (Buffer), "%s\n\r",
> +(CHAR16 *)PcdGetPtr (PcdFirmwareVersionString)
> +  );
> +  SerialPortWrite ((UINT8 *) Buffer, CharCount);
> +
>SmmuInit ();
>  }
> diff --git a/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.c 
> b/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.c
> index 30f8f945b233..6d546f4754f9 100644
> --- a/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.c
> +++ b/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.c
> @@ -12,6 +12,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  
>  /**
> @@ -64,8 +65,24 @@ ChassisInit (
>VOID
>)
>  {
> +  CHAR8 Buffer[100];
> +  UINTN CharCount;
>

Re: [edk2-devel] [PATCH edk2-platforms 1/3] Silicon/NXP: Use runtime safe version of DebugLib

2020-08-05 Thread Leif Lindholm
On Wed, Jul 08, 2020 at 00:19:31 -0500, Pankaj Bansal wrote:
> From: Pankaj Bansal 
> 
> For DXE_RUNTIME_DRIVER runtime safe version of DebugLib should be
> used. Otherwise, any DEBUG print in code can result in abort in OS.
> 
> Signed-off-by: Pankaj Bansal 

For this patch:
Reviewed-by: Leif Lindholm 
Pushed as e5c5ad8bfb03.

> ---
>  Silicon/NXP/NxpQoriqLs.dsc.inc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Silicon/NXP/NxpQoriqLs.dsc.inc b/Silicon/NXP/NxpQoriqLs.dsc.inc
> index ee639d552483..06ee012c227a 100644
> --- a/Silicon/NXP/NxpQoriqLs.dsc.inc
> +++ b/Silicon/NXP/NxpQoriqLs.dsc.inc
> @@ -163,6 +163,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
>
> MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
>CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
>
> ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf
> +  
> DebugLib|MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf
>  
>  [LibraryClasses.AARCH64]
>#
> -- 
> 2.17.1
> 

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

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



Re: [edk2-devel] [Patch 4/4] Readme.rst: List submodules and links to licenses

2020-08-05 Thread Leif Lindholm
Hi Mike,

For the series:
Reviewed-by: Leif Lindholm 

Recent events make me think though - should we have an explicit
statement regarding those files we have that are generated without an
explicit license?

/
Leif

On Tue, Aug 04, 2020 at 12:10:10 -0700, Michael D Kinney wrote:
> Update list of content that is covered by a license other than
> the BSD-2-Clause Plus Patent License and break out list of
> content that is included as a git submodule from upstream
> projects.
> 
> * Use alphabetic order of content
> * Remove references to IntelFrameworkModulePkg
> * Add reference for UnitTestFrameworkPkg use of cmocka
> 
> Cc: Andrew Fish 
> Cc: Laszlo Ersek 
> Cc: Leif Lindholm 
> Signed-off-by: Michael D Kinney 
> ---
>  ReadMe.rst | 22 --
>  1 file changed, 16 insertions(+), 6 deletions(-)
> 
> diff --git a/ReadMe.rst b/ReadMe.rst
> index d597e34efc..a16e13547f 100644
> --- a/ReadMe.rst
> +++ b/ReadMe.rst
> @@ -69,16 +69,26 @@ The majority of the content in the EDK II open source 
> project uses a
>  source project contains the following components that are covered by 
> additional
>  licenses:
>  
> --  `BaseTools/Source/C/BrotliCompress/brotli 
> `__
> --  `MdeModulePkg/Library/BrotliCustomDecompressLib/brotli 
> `__
>  -  `BaseTools/Source/C/LzmaCompress 
> `__
> --  `MdeModulePkg/Library/LzmaCustomDecompressLib 
> `__
> --  `IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/Sdk 
> `__
>  -  `BaseTools/Source/C/VfrCompile/Pccts 
> `__
> --  `MdeModulePkg/Universal/RegularExpressionDxe/oniguruma 
> `__
> +-  `CryptoPkg\Library\BaseCryptLib\SysCall\inet_pton.c 
> `__
> +-  `CryptoPkg\Library\Include\crypto\dso_conf.h 
> `__
> +-  `CryptoPkg\Library\Include\openssl\opensslconf.h 
> `__
> +-  `EmbeddedPkg/Library/FdtLib `__.  (EDK 
> II uses BSD License)
> +-  `EmbeddedPkg/Include/fdt.h `__.  (EDK II uses 
> BSD Licence)
> +-  `EmbeddedPkg/Include/libfdt.h `__.  (EDK II 
> uses BSD License)
> +-  `MdeModulePkg/Library/LzmaCustomDecompressLib 
> `__
>  -  `OvmfPkg `__
> --  `CryptoPkg/Library/OpensslLib/openssl 
> `__
> +
> +The EDK II open source project uses content from upstream projects as git 
> submodules
> +that are covered by additional licenses.
> +
>  -  `ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 
> `__
> +-  `BaseTools/Source/C/BrotliCompress/brotli 
> `__
> +-  `CryptoPkg/Library/OpensslLib/openssl 
> `__
> +-  `MdeModulePkg/Library/BrotliCustomDecompressLib/brotli 
> `__
> +-  `MdeModulePkg/Universal/RegularExpressionDxe/oniguruma 
> `__
> +-  `UnitTestFrameworkPkg/Library/CmockaLib/cmocka 
> `__
>  
>  The EDK II Project is composed of packages. The maintainers for each package
>  are listed in `Maintainers.txt `__.
> -- 
> 2.21.0.windows.1
> 
> 
> 
> 

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

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



Re: [edk2-devel] [PATCH edk2-platforms v1 0/3] Casts to avoid void* pointer arithmetic

2020-08-05 Thread Leif Lindholm
On Thu, Jul 30, 2020 at 20:15:08 +0100, PierreGondois wrote:
> These patches cast void* pointers to UINTN, preventing to do
> void* pointer arithmetc.
> 
> Pierre Gondois (3):
>   Silicon/Marvell/Drivers: Casts to avoid void* pointer arithmetic
>   Silicon/Socionext/SynQuacer: Casts to avoid void* pointer arithmetic
>   Silicon/Synopsys/DesignWare: Casts to avoid void* pointer arithmetic

Thanks!
For the series:
Reviewed-by: Leif Lindholm 
Pushed as 02cf0dcf8f93..b2eebc1d593e.

>  Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c  
>  |  5 +++--
>  Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.c  
>  |  5 +++--
>  Silicon/Marvell/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c
>  |  4 ++--
>  Silicon/Marvell/Drivers/Spi/MvSpiFlashDxe/MvSpiFlashDxe.c
>  |  9 ++---
>  Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/NetsecDxe.c
>  | 14 +++---
>  
> Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
>  |  3 ++-
>  Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDxe/DriverBinding.c 
>  |  3 ++-
>  Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDxe/DwEmacSnpDxe.c  
>  |  5 +++--
>  8 files changed, 32 insertions(+), 16 deletions(-)
> 
> -- 
> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
> 

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

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