Re: [EXTERNAL] Re: [edk2-devel] [PATCH v1 05/16] ArmPkg and MdePkg: Move the Arm CompilerIntrinsicsLib to MdePkg

2021-11-02 Thread Bret Barkelew via groups.io
I’d be amenable to that. @Sean?

- Bret

From: Leif Lindholm via groups.io
Sent: Tuesday, November 2, 2021 2:51 AM
To: brbar...@microsoft.com
Cc: devel@edk2.groups.io; Ard 
Biesheuvel; Kinney, Michael 
D; Liming 
Gao; Zhiguang 
Liu; Sami Mujawar; 
Yao, Jiewen; Supreeth 
Venkatesh; Maciej 
Rabeda; Jiaxin 
Wu; Siyuan Fu; Ni, 
Ray; Zhichao Gao; Sean 
Brogan
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v1 05/16] ArmPkg and MdePkg: Move 
the Arm CompilerIntrinsicsLib to MdePkg

On Mon, Nov 01, 2021 at 12:56:37 -0700, brbar...@microsoft.com wrote:
> From: Bret Barkelew 
>
> This aligns better with Mu's philosophy around dependency structuring
> and is one of the steps to enable Basecore to have zero CI dependencies
> on other Mu repos.
>
> REF: 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3649&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C6acadbd5a03f44edf9c408d99de642ee%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637714434603817528%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=AmwBKl6uWTs1VYo3Hw3I3RglkhPrWXhKPkobrwQid84%3D&reserved=0
>

Only one comment on this patch really.

>  ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf => 
> MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf | 3 +--

Could we just keep the .inf name as is?

I think we're getting closer to the x86 folk accepting that they
need this too, rather than keep inventing new dialects of C in the
desperate hope that the compiler won't generate stdlib calls it's
fully permitted to generate whenever it feels like.

/
Leif







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#83153): https://edk2.groups.io/g/devel/message/83153
Mute This Topic: https://groups.io/mt/86775234/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] Re: [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools

2021-11-02 Thread Bret Barkelew via groups.io
Good call. Maintainers, your opinion?

- Bret

From: Leif Lindholm via groups.io
Sent: Tuesday, November 2, 2021 2:55 AM
To: brbar...@microsoft.com
Cc: devel@edk2.groups.io; Ard 
Biesheuvel; Feng, Bob 
C; Liming Gao; 
Chen, Yuwei; Sean 
Brogan
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: 
Move the GccLto binaries from ArmPkg to BaseTools

On Mon, Nov 01, 2021 at 12:56:38 -0700, brbar...@microsoft.com wrote:
> From: Bret Barkelew 
>
> This aligns better with Mu's philosophy around dependency structuring
> and is one of the steps to enable Basecore to have zero CI dependencies
> on other Mu repos.
>
> REF: 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3650&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Cc9129586336447a44c3908d99de6e1d1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637714437251132216%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ijjQG1L4fScVxSn5nIBQGrFHLVtNbuTfd0YYLGdw8sg%3D&reserved=0
>
> Cc: Leif Lindholm 
> Cc: Ard Biesheuvel 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Yuwei Chen 
> Cc: Sean Brogan 
> Signed-off-by: Bret Barkelew 

No objections to this for any of my use-cases, but I'd like for one of
the BaseTools maintainers to comment on whether this breaks anything
with regards to EDK_TOOLS_PATH, or if we can finally get rid of that
and replace it with $WORKSPACE/BaseTools globally.

/
Leif

> ---
>  {ArmPkg/Library => BaseTools/Bin}/GccLto/liblto-aarch64.a | Bin
>  {ArmPkg/Library => BaseTools/Bin}/GccLto/liblto-aarch64.s |   0
>  {ArmPkg/Library => BaseTools/Bin}/GccLto/liblto-arm.a | Bin
>  {ArmPkg/Library => BaseTools/Bin}/GccLto/liblto-arm.s |   0
>  BaseTools/Conf/tools_def.template |  19 
> ++-
>  5 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/ArmPkg/Library/GccLto/liblto-aarch64.a 
> b/BaseTools/Bin/GccLto/liblto-aarch64.a
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-aarch64.a
> rename to BaseTools/Bin/GccLto/liblto-aarch64.a
> diff --git a/ArmPkg/Library/GccLto/liblto-aarch64.s 
> b/BaseTools/Bin/GccLto/liblto-aarch64.s
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-aarch64.s
> rename to BaseTools/Bin/GccLto/liblto-aarch64.s
> diff --git a/ArmPkg/Library/GccLto/liblto-arm.a 
> b/BaseTools/Bin/GccLto/liblto-arm.a
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-arm.a
> rename to BaseTools/Bin/GccLto/liblto-arm.a
> diff --git a/ArmPkg/Library/GccLto/liblto-arm.s 
> b/BaseTools/Bin/GccLto/liblto-arm.s
> similarity index 100%
> rename from ArmPkg/Library/GccLto/liblto-arm.s
> rename to BaseTools/Bin/GccLto/liblto-arm.s
> diff --git a/BaseTools/Conf/tools_def.template 
> b/BaseTools/Conf/tools_def.template
> index 2e6b382ab623..cd8899d24d4a 100755
> --- a/BaseTools/Conf/tools_def.template
> +++ b/BaseTools/Conf/tools_def.template
> @@ -15,7 +15,8 @@
>  # 2.00 - Initial version with changes for CI
>  #  - Change RC path to use plugin
>  #
> -#!VERSION=2.00
> +# 2.10 - Move GccLto files to a tools path to be more repository layout 
> agnostic
> +#!VERSION=2.10
>
>  IDENTIFIER = Default TOOL_CHAIN_CONF
>
> @@ -2386,10 +2387,10 @@ RELEASE_GCC5_X64_DLINK_FLAGS = 
> DEF(GCC5_X64_DLINK_FLAGS) -flto -Os
>  *_GCC5_ARM_CC_XIPFLAGS   = DEF(GCC5_ARM_CC_XIPFLAGS)
>
>DEBUG_GCC5_ARM_CC_FLAGS= DEF(GCC5_ARM_CC_FLAGS) -flto 
> -Wno-unused-but-set-variable -Wno-unused-const-variable
> -  DEBUG_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os 
> -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm 
> -Wl,-plugin-opt=-pass-through=-llto-arm
> +  DEBUG_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os 
> -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm 
> -Wl,-plugin-opt=-pass-through=-llto-arm
>
>  RELEASE_GCC5_ARM_CC_FLAGS= DEF(GCC5_ARM_CC_FLAGS) -flto 
> -Wno-unused-but-set-variable -Wno-unused-const-variable
> -RELEASE_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os 
> -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm 
> -Wl,-plugin-opt=-pass-through=-llto-arm
> +RELEASE_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os 
> -L$(WORKSPACE)/BaseTools/Bin/GccLto -llto-arm 
> -Wl,-plugin-opt=-pass-through=-llto-arm
>
>NOOPT_GCC5_ARM_CC_FLAGS= DEF(GCC5_ARM_CC_FLAGS) -O0
>NOOPT_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -O0
> @@ -2420,11 +2421,11 @@ RELEASE_GCC5_ARM_DLINK_FLAGS = 
> DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKS
>  *_GCC5_AARCH64_CC_XIPFLAGS   = DEF(GCC5_AARCH64_CC_XIPFLAGS)
>
>DEBUG_GCC5_AARCH64_CC_FLAGS= DEF(GCC5_AARCH64_CC_FLAGS) -flto 
> -Wno-un

Re: [EXTERNAL] [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: Move the GccLto binaries from ArmPkg to BaseTools

2021-11-03 Thread Bret Barkelew via groups.io
Sounds good. Will update in v3.

- Bret

From: Feng, Bob C 
Sent: Wednesday, November 3, 2021 8:35:33 AM
To: Andrew Fish ; edk2-devel-groups-io ; 
Bret Barkelew 
Cc: Lindholm, Leif ; brbar...@microsoft.com 
; Ard Biesheuvel ; Liming Gao 
; Chen, Yuwei ; Sean Brogan 

Subject: RE: [EXTERNAL] [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: 
Move the GccLto binaries from ArmPkg to BaseTools


I’d prefer to use EDK_TOOLS_PATH. Because of PACKAGES_PATH, the relative path 
does not depend on the WORKSPACE, the WORKSPACE can be set to anywhere. So we 
can’t assume the BaseTools is under WORKSPACE. But EDK_TOOLS_PATH always points 
to edk2/BaseTools.



This patch does not break any of the use-cases on my side.



Thanks,

Bob



From: Andrew Fish 
Sent: Wednesday, November 3, 2021 7:34 AM
To: edk2-devel-groups-io ; bret.barke...@microsoft.com
Cc: Lindholm, Leif ; brbar...@microsoft.com 
; Ard Biesheuvel ; Feng, Bob C 
; Liming Gao ; Chen, Christine 
; Sean Brogan 
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: 
Move the GccLto binaries from ArmPkg to BaseTools







On Nov 2, 2021, at 12:45 PM, Bret Barkelew via 
groups.io<https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgroups.io%2F&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C06f295b9903a44c7b8d408d99edff565%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637715507056865024%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=7IeYGfQir8xUiKwmZ9N%2BTsiLRc8%2F03Rzsr%2FwJ08qmvQ%3D&reserved=0>
 
mailto:bret.barkelew=microsoft@groups.io>>
 wrote:



Good call. Maintainers, your opinion?



- Bret



From: Leif Lindholm via groups.io<mailto:leif=nuviainc@groups.io>
Sent: Tuesday, November 2, 2021 2:55 AM
To: brbar...@microsoft.com<mailto:b...@corthon.com>
Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Ard 
Biesheuvel<mailto:ardb+tianoc...@kernel.org>; Feng, Bob 
C<mailto:bob.c.f...@intel.com>; Liming Gao<mailto:gaolim...@byosoft.com.cn>; 
Chen, Yuwei<mailto:yuwei.c...@intel.com>; Sean 
Brogan<mailto:sean.bro...@microsoft.com>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v1 06/16] ArmPkg and BaseTools: 
Move the GccLto binaries from ArmPkg to BaseTools



On Mon, Nov 01, 2021 at 12:56:38 -0700, 
brbar...@microsoft.com<mailto:brbar...@microsoft.com> wrote:
> From: Bret Barkelew mailto:brbar...@microsoft.com>>
>
> This aligns better with Mu's philosophy around dependency structuring
> and is one of the steps to enable Basecore to have zero CI dependencies
> on other Mu repos.
>
> REF: 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3650&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Cc9129586336447a44c3908d99de6e1d1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637714437251132216%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ijjQG1L4fScVxSn5nIBQGrFHLVtNbuTfd0YYLGdw8sg%3D&reserved=0<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3650&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C06f295b9903a44c7b8d408d99edff565%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637715507056865024%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=oBOJo5g2DzNrgu2Py0sjxAd%2BHekQBxrlDylc%2BkIwEow%3D&reserved=0>
>
> Cc: Leif Lindholm mailto:l...@nuviainc.com>>
> Cc: Ard Biesheuvel 
> mailto:ardb+tianoc...@kernel.org>>
> Cc: Bob Feng mailto:bob.c.f...@intel.com>>
> Cc: Liming Gao mailto:gaolim...@byosoft.com.cn>>
> Cc: Yuwei Chen mailto:yuwei.c...@intel.com>>
> Cc: Sean Brogan mailto:sean.bro...@microsoft.com>>
> Signed-off-by: Bret Barkelew 
> mailto:bret.barke...@microsoft.com>>

No objections to this for any of my use-cases, but I'd like for one of
the BaseTools maintainers to comment on whether this breaks anything
with regards to EDK_TOOLS_PATH, or if we can finally get rid of that
and replace it with $WORKSPACE/BaseTools globally.

Our internal repo uses EDK_TOOLS_PATH. In our case it is 
$(WORKSPACE)/edk2/BaseTools. We have a PACKAGES_PATH set to $(WORKSPACE)/edk2 
and magic happens.



So I’m thinking maybe:

  $(EDK_TOOLS_PATH)/Bin/GccLto

Vs:

  $(WORKSPACE)/BaseTools/Bin/GccLto



If EDK_TOOLS_PATH gets ripped out, it should be one atomic remove, but let us 
not stick that on Bret.



Thanks,



Andrew Fish



/
Leif

> ---
>  {ArmPkg/Library => BaseTools/Bin}/GccLto/liblto-aarch64.a | Bin
>  {ArmPkg/Library => BaseTools/Bin}/GccLto/liblto-aarch64.s |   0
>  {ArmPkg/Library => BaseTools/Bin}/GccLto/liblto-arm.a | Bin
>  {ArmPkg/Library => BaseTools/Bin}/

Re: [edk2-devel] [EXTERNAL] [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds

2021-11-03 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 

- Bret

From: Michael D Kinney
Sent: Wednesday, November 3, 2021 4:00 PM
To: devel@edk2.groups.io
Cc: Hao A Wu; Liming 
Gao; Bret 
Barkelew; Philippe 
Mathieu-Daude
Subject: [EXTERNAL] [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: 
Fix 32-bit GCC builds

When using will_return() on a pointer value, it must be
cast to UINTN to be compatible with 32-bit GCC builds.
This uses the same approach in samples provided in the
UnitTestFramworkPkg when passing pointer values to
UT_ASSERT_EQUAL().

Cc: Hao A Wu 
Cc: Liming Gao 
Cc: Bret Barkelew 
Signed-off-by: Michael D Kinney 
Reviewed-by: Philippe Mathieu-Daude 
---
 .../RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c
 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c
index 44d70e639d77..880994fe71fc 100644
--- 
a/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c
+++ 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c
@@ -287,7 +287,7 @@ LockingAnUnlockedVariableShouldFail (
   // With a policy, make sure that writes still work, since the variable 
doesn't exist.
   will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL );// 
Attributes
   will_return( StubGetVariableNull, 0 );  // Size
-  will_return( StubGetVariableNull, NULL );   // 
DataPtr
+  will_return( StubGetVariableNull, (UINTN)NULL );// 
DataPtr
   will_return( StubGetVariableNull, EFI_NOT_FOUND);   // Status

   Status = VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &mTestGuid1);
@@ -342,7 +342,7 @@ LockingALockedVariableWithMatchingDataShouldSucceed (
   Data = 1;
   will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL );// 
Attributes
   will_return( StubGetVariableNull, sizeof (Data) );  // Size
-  will_return( StubGetVariableNull, &Data );  // 
DataPtr
+  will_return( StubGetVariableNull, (UINTN)&Data );   // 
DataPtr
   will_return( StubGetVariableNull, EFI_SUCCESS); // Status

   Status = VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &mTestGuid1);
@@ -397,7 +397,7 @@ LockingALockedVariableWithNonMatchingDataShouldFail (
   Data = 2;
   will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL );// 
Attributes
   will_return( StubGetVariableNull, sizeof (Data) );  // Size
-  will_return( StubGetVariableNull, &Data );  // 
DataPtr
+  will_return( StubGetVariableNull, (UINTN)&Data );   // 
DataPtr
   will_return( StubGetVariableNull, EFI_SUCCESS); // Status

   Status = VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &mTestGuid1);
--
2.32.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#83304): https://edk2.groups.io/g/devel/message/83304
Mute This Topic: https://groups.io/mt/86805498/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] Re: [edk2-devel] [PATCH v2 16/16] ArmPlatformPkg: Resolve build errors resulting from package moves

2021-11-08 Thread Bret Barkelew via groups.io
Marvin,

Thanks for the question! You’re right, I need to squash this patch into the 
applicable patches in the series so that the build fixes are present when the 
initial changes are added (to maintain bisectability). Surprised no one had 
mentioned it yet. 😉

I would actually be happy to keep the Arm entry point in StandaloneMmPkg if 
someone else wanted to tackle the work needed to remove the ArmPkg interface 
dependencies from the implementation. The necessary abstractions are beyond my 
ability to bite off right now, so the most direct solution was to relocate the 
implementation (leveraging the abstraction at the EntryPoint level) to the 
ArmPkg so that the necessary platforms could consume it. I could also see an 
argument that it should be platform code, but I think it’s more common than 
that and would prefer to keep it in EDK2.

- Bret

From: Marvin Häuser via groups.io
Sent: Saturday, November 6, 2021 2:50 AM
To: devel@edk2.groups.io; 
b...@corthon.com
Cc: devel@edk2.groups.io; Lindholm, 
Leif; Ard 
Biesheuvel; Sean 
Brogan
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v2 16/16] ArmPlatformPkg: Resolve 
build errors resulting from package moves

Hey Bret,

If I understood this correctly, this fixes build issues introduced with
the move patch of the same series? In that case, is there no edk2 rule
that every commit must compile for the whole tree? We have such a rule
downstream that overrides any colliding rules (e.g. "mod only one
package at a time") to not break bisectioning. We actually have
per-commit builds readily available in a database for some projects to
ease it further. No big deal for us as we don't do that with edk2 (yet),
but maybe worth considering for the future? :)

I'll just ask about another patch here because it doesn't matter for
review, but why move the ARM entry point to ArmPkg? I guess because
abstracting the ARM-specific things would more or less just make the
StandaloneMm library a trivial wrapper? My "issue" with this is that ARM
kind of has its own ecosystem in edk2 and without keeping up, it's hard
to tell whether to look for ARM implementations of modules and libraries
in the "generic" or the ARM packages.

Thanks a lot for the series!

Best regards,
Marvin

02.11.2021 21:21:59 Bret Barkelew :

> From: Bret Barkelew 
>
> REF: 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3652&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C2d061d1ff7a845914be808d9a10addee%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637717890363754993%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=r5yRvqRrCGPQLNCXfXv4KdmldhxFTpCwdsjMoPcvl4M%3D&reserved=0
>
> Cc: Leif Lindholm 
> Cc: Ard Biesheuvel 
> Cc: Sean Brogan 
> Signed-off-by: Bret Barkelew 
> ---
> ArmPlatformPkg/ArmPlatformPkg.dsc | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/ArmPlatformPkg/ArmPlatformPkg.dsc 
> b/ArmPlatformPkg/ArmPlatformPkg.dsc
> index 661a4cea220d..3ed0bae87c41 100644
> --- a/ArmPlatformPkg/ArmPlatformPkg.dsc
> +++ b/ArmPlatformPkg/ArmPlatformPkg.dsc
> @@ -79,6 +79,8 @@ [LibraryClasses.common]
>NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
>NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
>
> +  ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
> +
> [LibraryClasses.common.PEIM]
>HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
>
> MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
> @@ -92,7 +94,7 @@ [LibraryClasses.common.SEC]
>
> MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf
>
> PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf
>
> -[LibraryClasses.AARCH64.MM_STANDALONE]
> +[LibraryClasses.common.MM_STANDALONE]
>HobLib|StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf
>
> MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
>
> MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
> --
> 2.31.1.windows.1
>
>
>
>







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#83459): https://edk2.groups.io/g/devel/message/83459
Mute This Topic: https://groups.io/mt/86914454/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [EXTERNAL] [Patch 12/12] UnitTestFrameworkPkg: Update YAML to ignore specific ECC files/errors

2021-11-26 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 

- Bret

From: Michael D Kinney
Sent: Tuesday, November 23, 2021 1:21 PM
To: devel@edk2.groups.io
Cc: Sean Brogan; Bret 
Barkelew; Liming 
Gao; Michael 
Kubacki
Subject: [EXTERNAL] [Patch 12/12] UnitTestFrameworkPkg: Update YAML to ignore 
specific ECC files/errors

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3749&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C7f8dbf0e635b435fe38a08d9aec73d99%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637732993028966105%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=z5uy6%2BorMDeC%2BhrPZe%2Bi4WBAdWWkBqQSbdwJZqe9jCo%3D&reserved=0

Update package YAML files to ignore ECC errors that are
already present.  These issues must be fixed in the future,
but should not block source code changes for these known
issues.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Liming Gao 
Cc: Michael Kubacki 
Signed-off-by: Michael D Kinney 
---
 UnitTestFrameworkPkg/UnitTestFrameworkPkg.ci.yaml | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.ci.yaml 
b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.ci.yaml
index 9e9ffc1af113..1b247a831593 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.ci.yaml
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.ci.yaml
@@ -15,10 +15,13 @@
 ## "", ""
 ## ]
 "ExceptionList": [
+"9005", "@MRT",
+"7007", "_UNIT_TEST_FAILURE_TYPE_STRING"
 ],
 ## Both file path and directory path are accepted.
 "IgnoreFiles": [
-"Library/CmockaLib/cmocka"
+"Library/CmockaLib/cmocka",
+"Library/UnitTestLib/RunTestsCmocka.c"
 ]
 },
 ## options defined .pytool/Plugin/CompilerPlugin
--
2.32.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#84109): https://edk2.groups.io/g/devel/message/84109
Mute This Topic: https://groups.io/mt/87331471/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] TianoCore Community Meeting Minutes - 2/4

2021-02-05 Thread Bret Barkelew via groups.io
@Desimone, Nathaniel L, I’m interested 
in mentorship for the GSC project. Would like to talk offline about potential 
projects and past experience.

RE: ECC, we’re internally evaluating ‘uncrustify’ as an option to 1) check for 
formatting violations and 2) provide a tool to automatically format code prior 
to submission. There are changes that we’ve made to the tool to support ECC, 
but there are some small places that we’re coming up short. What would be the 
appetite to evaluate our progress and discuss possibly adjusting the ECC to be 
more flexible where we’ve come up short?

- Bret

From: Soumya Guptha via groups.io
Sent: Thursday, February 4, 2021 8:12 PM
To: annou...@edk2.groups.io; 
devel@edk2.groups.io
Subject: [EXTERNAL] Re: [edk2-announce] TianoCore Community Meeting Minutes - 
2/4

TianoCore Community Meeting Minutes (APAC/NMO)

February 4, 2021



EVENTS:

No new updates.



STABLE TAG:



edk2-stable202102 - Feature Planning freeze on 2/15

https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FEDK-II-Release-Planning&data=04%7C01%7CBret.Barkelew%40microsoft.com%7Ca97d5c438d514d0859ea08d8c98c43a6%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637480951557144463%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=UA13OI0UuZ2QSboHsE4dZY5J0Az1uL8Boxldw0jdtmU%3D&reserved=0





STEWARDS DOWNLOAD (Mike Kinney)

  *   Design meeting - we discussed on Automation & CI system.



  *   Community Action: Need help from the community on ECC tool (EFI code 
checker), we have critical issues, need help quickly.
 *   Kevin - will explore to see if someone has any expertise wrt ECC tool.



  *   Sean plans to send to the info to the community on the tool to help 
format the source code. Sean will send it to the mailing list.
Suggests making ECC smaller.



  *   Addressed all issues related to cmocka.



  *   Workflow for maintainers: some maintainers like to work on multiple pull 
requests, causing extra work, process issue. We are investigating on 
automation. Task is to Evaluate the automation feature and get feedback.



  *   Bugzilla Feature request - update on NASM compiler version will start 
now. This is not required by developers until after the Q1 stable tag.





Opens:

  1.  Nate - Google summer code (sponsored internship program run by google). 
Need some mentors to mentor the interns. Tianocore open source needs to apply. 
Application deadline Feb 19th. We need to develop interesting ideas for summer 
projects. Nate will start an offline thread to discuss ideas for projects. 
Couple of people have expressed some interest in becoming mentors.
Community Action: If you are interested in either mentoring or have a project 
idea, please send an email to (nathaniel.l.desim...@intel.com).



  1.  Sean - code contribution, project management - are we doing anything to 
improve.



Acknowledgments:

Community Action: Please send Soumya if you like to acknowledge anyone from the 
community, if anyone helped you close bugs or reviewed code etc..We will post 
those acknowledgements on the community page.



Soumya Guptha
Firmware Ecosystem Enabling Manager, SFP/IAGS












-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71374): https://edk2.groups.io/g/devel/message/71374
Mute This Topic: https://groups.io/mt/80399013/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] Re: 回复: [edk2-devel] Soft Feature Freeze starts now for edk2-stable202102

2021-03-01 Thread Bret Barkelew via groups.io
Did the NASM CI patch make it in? I never saw another response after v3.

- Bret

From: Laszlo Ersek via groups.io
Sent: Monday, March 1, 2021 7:29 AM
To: gaoliming; 
devel@edk2.groups.io; 
annou...@edk2.groups.io; 'Andrew 
Fish'; l...@nuviainc.com; 
Kinney, Michael D
Cc: 'Soumya Guptha'; Ni, 
Ray; w.sh...@intel.com; 
'Ming Huang'; Yao, 
Jiewen
Subject: [EXTERNAL] Re: 回复: [edk2-devel] Soft Feature Freeze starts now for 
edk2-stable202102

Hi Liming,

On 02/26/21 07:27, gaoliming wrote:
> Hi, Stewards and All:
>
>  So far, there are still three patch sets to be requested to catch this
> stable tag. They are bug fixes, and pass code review in soft feature freeze
> phase. Have you any comments for them?
>
>
>
> 1.  Fix two issue in ArmGicLib
> (https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F72175&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ce5040db931b846722c3e08d8dcc6bb7d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637502093407405739%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=S%2FU2%2F2FBDDWs9T7gLK0vt7rcfiap1vD0LgR%2Flw55STA%3D&reserved=0)
>
> 2.  Fix CET shadow stack token busy bit clear issue
> (https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F71864&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ce5040db931b846722c3e08d8dcc6bb7d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637502093407405739%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=bF9pY1HTiqIXCvps6Igp%2BAbZoBGd%2FiF5IDxOtvXd42k%3D&reserved=0)
>
> [Liming] this version uses DB for the instruction. BZ
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3227&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ce5040db931b846722c3e08d8dcc6bb7d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637502093407405739%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=mhgx1IHCmtA6ro0SquHX5D4Hw2nKhw9QG7qbrb1S1J8%3D&reserved=0
>  is create for future
> enhancement.
>
> 3.  Use XADD to avoid lock acquire/release
> (https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F71516&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ce5040db931b846722c3e08d8dcc6bb7d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637502093407405739%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ZMO70jJEJEdXhxY71X5oQUoDFhb9b957%2BCVcc0od9cc%3D&reserved=0)

I agree that the first two patch sets are bugfixes, but I'm not entirely
convinced the third one is a bugfix as well -- it is a performance
optimization, to my understanding. Without that patch set, there is no
misbehavior, things are just slower.

The bugfixes can be merged of course; I wouldn't merge the 3rd series
however.

... I can see Ray pushed the first patch of the third series:


I disagree with that. Here's an excerpt from the commit message:

  With this patch, OVMF when running in a 255 threads QEMU spends about
  one second to wakeup all APs. Original implementation needs more than
  10 seconds.

I wouldn't call the pre-patch behavior a bug.

And the review for "[PATCH v3 1/4] UefiCpuPkg/MpInitLib: Use XADD to
avoid lock acquire/release" only arrived (from Mike) after the SFF, so I
don't think it should have been pushed.

On the other hand, I also won't ask for a revert.

Thanks
Laszlo


>
>
>
> Thanks
>
> Liming
>
> 发件人: bounce+27952+71922+4905953+8761...@groups.io
>  代表 gaoliming
> 发送时间: 2021年2月22日 16:23
> 收件人: devel@edk2.groups.io; annou...@edk2.groups.io
> 抄送: 'Andrew Fish' ; 'Laszlo Ersek' ;
> l...@nuviainc.com; 'Michael D Kinney' ; 'Soumya
> Guptha' 
> 主题: [edk2-devel] Soft Feature Freeze starts now for edk2-stable202102
>
>
>
> Hi, all
>
> We will enter into Soft Feature Freeze phase. In this phase, the feature
> under review will not be allowed to be merged. The feature passed review can
> still be merged.
>
>
>
> The patch review can continue without break in edk2 community. If the patch
> is sent befor

Re: [edk2-devel] [edk2-platforms][RFC] SpiFlashCommonLib Refactor

2021-03-03 Thread Bret Barkelew via groups.io
Furthermore, is it the code that cannot cross the repo boundary, or the 
interface?
Is there any use in defining the interface at a lower level such as 
MdeModulePkg? Then a platform can consume the implementation from 
IntelSiliconPkg if it so chooses?

- Bret

From: Ni, Ray via groups.io
Sent: Wednesday, March 3, 2021 3:38 PM
To: Dong, Guo; Michael 
Kubacki; 
devel@edk2.groups.io
Cc: Chaganty, Rangasai V; Chiu, 
Chasel; Desimone, Nathaniel 
L; Luo, Heng; 
Agyeman, Prince; 
gaolim...@byosoft.com.cn; Dong, 
Eric
Subject: [EXTERNAL] Re: [edk2-devel] [edk2-platforms][RFC] SpiFlashCommonLib 
Refactor

Guo,
I understand your concern that UefiPayloadPkg should NOT use any components 
outside of edk2 repo (edk2-platform repo in this case).
If the two SPI drivers you are talking about are the same one, we could go back 
to put the driver to PcAtchipsetPkg.
Let's see what the driver contains and then decide where to put.

Thanks,
Ray

> -Original Message-
> From: Dong, Guo 
> Sent: Thursday, March 4, 2021 7:22 AM
> To: Michael Kubacki ; devel@edk2.groups.io; Ni, 
> Ray 
> Cc: Chaganty, Rangasai V ; Chiu, Chasel 
> ; Desimone, Nathaniel L
> ; Luo, Heng ; Agyeman, 
> Prince ;
> gaolim...@byosoft.com.cn; Dong, Eric 
> Subject: RE: [edk2-devel] [edk2-platforms][RFC] SpiFlashCommonLib Refactor
>
>
> Hi Michael,
>
> I didn't initiate any discussion on this yet. And I am not sure if this idea 
> could be accepted.
> From my view point, IntelSiliconPkg is a proper place for SPI flash library.
> But UefiPayloadPkg could not use that package since it is in another repo.
> Since these dependencies, you could go a head to put it into IntelSiliconPkg.
>
> Once I clean up my branch (expected complete next week), I could send my 
> patch for your
> reference so that we could at least share code if possible to reduce the code 
> maintenance.
>
> Thanks,
> Guo
>
> > -Original Message-
> > From: Michael Kubacki 
> > Sent: Wednesday, March 3, 2021 3:54 PM
> > To: devel@edk2.groups.io; Dong, Guo ; Ni, Ray
> > 
> > Cc: Chaganty, Rangasai V ; Chiu, Chasel
> > ; Desimone, Nathaniel L
> > ; Luo, Heng ;
> > Agyeman, Prince ; gaolim...@byosoft.com.cn;
> > Dong, Eric 
> > Subject: Re: [edk2-devel] [edk2-platforms][RFC] SpiFlashCommonLib
> > Refactor
> >
> > Hi Guo,
> >
> > That's good to hear.
> >
> > Does this new "common SPI flash library" and "SMM FVB driver" have
> > equivalent functionality to the instances being discussed here?
> >
> > For the platforms I have in mind, IntelSiliconPkg is an allowed
> > dependency whereas UefiPayloadPkg is not.
> >
> > I have begun the work (at low priority) discussed earlier in the thread,
> > please let me know if I should continue.
> >
> > Thanks,
> > Michael
> >
> > On 3/3/2021 1:58 PM, Guo Dong wrote:
> > >
> > > Hi Michael,
> > >
> > > We had created a common SPI flash library and a common SMM FVB driver
> > for all the platforms I have (including Apollo lake, Coffee lake, Kaby Lake,
> > Comet Lake, Tiger Lake, Elkhart Lake, etc.).  we plan to upstream this for 
> > UEFI
> > Payload.
> > > If this one could be upstream to UefiPayloadPkg, then each platform could
> > leverage it.
> > >
> > > BTW, together with this, we plan to upstream SMM support, secure boot
> > and measured boot for UEFI Payload.
> > > So we could use a single UEFI Payload with these advanced features  on
> > different platforms.
> > >
> > > Thanks,
> > > Guo
> > >
> > >
> > >> -Original Message-
> > >> From: Ni, Ray 
> > >> Sent: Monday, March 1, 2021 5:52 PM
> > >> To: Michael Kubacki ;
> > >> devel@edk2.groups.io
> > >> Cc: Chaganty, Rangasai V ; Chiu, Chasel
> > >> ; Desimone, Nathaniel L
> > >> ; Luo, Heng ;
> > >> Agyeman, Prince ;
> > gaolim...@byosoft.com.cn;
> > >> Dong, Eric ; Dong, Guo 
> > >> Subject: RE: [edk2-devel] [edk2-platforms][RFC] SpiFlashCommonLib
> > >> Refactor
> > >>
> > >> Michael,
> > >> I am good with that. I am also curious how you merge all the different 
> > >> SPI
> > >> flash implementation into one.
> > >>
> > >> Thanks,
> > >> Ray
> > >>
> > >>> -Original Message-
> > >>> From: Michael Kubacki 
> > >>> Sent: Tuesday, March 2, 2021 3:16 AM
> > >>> To: devel@edk2.groups.io; Ni, Ray 
> > >>> Cc: Chaganty, Rangasai V ; Chiu, Chasel
> > >> ; Desimone, Nathaniel L
> > >>> ; Luo, Heng ;
> > >> Agyeman, Prince ;
> > >>> gaolim...@byosoft.com.cn; Dong, Eric 
> > >>> Subject: Re: [edk2-devel] [edk2-platforms][RFC] SpiFlashCommonLib
> > >> Refactor
> > >>>
> > >>> Hi Ray,
> > >>>
> > >>> That sounds reasonable to me.
> > >>>
> > >>> I was attempting to preserve the design that isolates the
> > >>> silicon-specific logic to 

Re: [EXTERNAL] Re: [edk2-devel] generating the test matrix for local CI runs

2021-03-04 Thread Bret Barkelew via groups.io
*An* answer is:
- There’s a DevOps virtual environment that you can run that will pretend to be 
a build agent. I played with it years ago, but that was before the CI tooling 
(and it was years ago) so I don’t know how the capabilities compare.

My real answer is:
- If you run the three commands -- setup, update, and build -- without any 
parameters other than your TOOL_CHAIN_TAG, it should run all tests on all 
packages for that particular OS/toolchain.

- Bret

From: Rebecca Cran via groups.io
Sent: Thursday, March 4, 2021 9:45 AM
To: devel@edk2.groups.io; 
ler...@redhat.com
Cc: Sean Brogan; Bret 
Barkelew; Kinney, Michael 
D
Subject: [EXTERNAL] Re: [edk2-devel] generating the test matrix for local CI 
runs

On 3/4/21 10:04 AM, Laszlo Ersek wrote:
> (Sigh, my address book pulled one over me -- resending to the correct
> list address now. Please ignore the previous posting that you may have
> gotten "in private".)
>
> Hi All,
>
> while I can run specific CI tests locally, using the commands listed at:
>
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Ftree%2Fmaster%2F.pytool&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ce4e5493578cf45b804c608d8df354b05%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637504767278995847%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=l8WblhD%2B7dpkFaCZ8roSfNUmj1imytHi5eUT%2F%2BKrLCo%3D&reserved=0
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Ftree%2Fmaster%2FArmVirtPkg%2FPlatformCI&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ce4e5493578cf45b804c608d8df354b05%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637504767278995847%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8yG7Mro9Li4XeCvfmPhfReBbipz47nyAjUmMKMGfh%2Bo%3D&reserved=0
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Ftree%2Fmaster%2FOvmfPkg%2FPlatformCI&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ce4e5493578cf45b804c608d8df354b05%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637504767278995847%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=NUhAJ8zkITwPkvCrUqb7ZogSQTJuBXv0eL6Au0sYC2M%3D&reserved=0
>
> I don't know how I can determine and drive the whole "test plan" locally.
>
> When I submit a PR to github, "something" generates (say) 83 test cases.
> How can I run that "something" locally?
>
> Assume I have the following:
> - a Linux builder VM, with up-to-date tools,
> - a Windows builder VM, with up-to-date tools,
> - a topic branch, on top of "master".
>
> How do I generate and run those same 83 tests, locally?
>
> It has happened to me that all my local CI steps succeeded (meaning both
> the Windows and the Linux builder), but github still rejected the PR --
> the reason was that I failed to think of a particular test that github
> would run. Composing 83 "stuart" command lines isn't something I'd like
> to do manually.

FWIW it looks like people have been looking for similar functionality of
testing a pipeline locally, and not found it.

e.g.:
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fazure-pipelines-agent%2Fissues%2F1764&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ce4e5493578cf45b804c608d8df354b05%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637504767278995847%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=XMxZesyKxVN9Wg3SyRpUbnnmKzojevHCqQhzQ1Pc4%2Bg%3D&reserved=0
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdevelopercommunity.visualstudio.com%2Ft%2Fyaml-how-to-test-yaml-locally-before-commit%2F1302759&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ce4e5493578cf45b804c608d8df354b05%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637504767278995847%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=gwGZAQJAIXIS0LODFpglrCf5Ua2JeMnNm3A3auCrhx8%3D&reserved=0

--
Rebecca Cran







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#72438): https://edk2.groups.io/g/devel/message/72438
Mute This Topic: https://groups.io/mt/81083112/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] Re: [edk2-devel] generating the test matrix for local CI runs

2021-03-04 Thread Bret Barkelew via groups.io
Thinking further, it will skip some tests if you haven’t installed the 
prerequisites (e.g. spell check). We could potentially add a single script to 
install the prerequisites, but then there are the prereqs for the prereqs (e.g. 
Node).

To more clearly address your question, the “tests” that a GitHub CI is broken 
up into are arbitrary subdivisions of the tests that run locally (when you run 
“stuart_ci_build” without parameters) so that the workload can be divided 
amongst the available worker agents. If you were to compare the individual test 
logs against your local, monolithic test log, you would find that all cases 
were covered in both (assuming the aforementioned prereqs are installed).

- Bret

From: Bret Barkelew via groups.io<mailto:bret.barkelew=microsoft@groups.io>
Sent: Thursday, March 4, 2021 9:57 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
rebe...@nuviainc.com<mailto:rebe...@nuviainc.com>; 
ler...@redhat.com<mailto:ler...@redhat.com>
Cc: Sean Brogan<mailto:sean.bro...@microsoft.com>; Kinney, Michael 
D<mailto:michael.d.kin...@intel.com>
Subject: Re: [EXTERNAL] Re: [edk2-devel] generating the test matrix for local 
CI runs

*An* answer is:
- There’s a DevOps virtual environment that you can run that will pretend to be 
a build agent. I played with it years ago, but that was before the CI tooling 
(and it was years ago) so I don’t know how the capabilities compare.

My real answer is:
- If you run the three commands -- setup, update, and build -- without any 
parameters other than your TOOL_CHAIN_TAG, it should run all tests on all 
packages for that particular OS/toolchain.

- Bret

From: Rebecca Cran via groups.io<mailto:rebecca=nuviainc@groups.io>
Sent: Thursday, March 4, 2021 9:45 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
ler...@redhat.com<mailto:ler...@redhat.com>
Cc: Sean Brogan<mailto:sean.bro...@microsoft.com>; Bret 
Barkelew<mailto:bret.barke...@microsoft.com>; Kinney, Michael 
D<mailto:michael.d.kin...@intel.com>
Subject: [EXTERNAL] Re: [edk2-devel] generating the test matrix for local CI 
runs

On 3/4/21 10:04 AM, Laszlo Ersek wrote:
> (Sigh, my address book pulled one over me -- resending to the correct
> list address now. Please ignore the previous posting that you may have
> gotten "in private".)
>
> Hi All,
>
> while I can run specific CI tests locally, using the commands listed at:
>
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Ftree%2Fmaster%2F.pytool&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ce4e5493578cf45b804c608d8df354b05%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637504767278995847%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=l8WblhD%2B7dpkFaCZ8roSfNUmj1imytHi5eUT%2F%2BKrLCo%3D&reserved=0<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Ftree%2Fmaster%2F.pytool&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C385eef1d988f4a56155a08d8df36ecce%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637504774296518259%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=UPVktVmDdChYhoc6zErhuz57Dllw21gqcwi9crhUdp8%3D&reserved=0>
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Ftree%2Fmaster%2FArmVirtPkg%2FPlatformCI&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ce4e5493578cf45b804c608d8df354b05%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637504767278995847%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8yG7Mro9Li4XeCvfmPhfReBbipz47nyAjUmMKMGfh%2Bo%3D&reserved=0<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Ftree%2Fmaster%2FArmVirtPkg%2FPlatformCI&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C385eef1d988f4a56155a08d8df36ecce%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637504774296518259%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=mcoSK9x7FSSJzlI86mdvs%2Btp7zdeF42IJn62mJxxozo%3D&reserved=0>
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Ftree%2Fmaster%2FOvmfPkg%2FPlatformCI&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ce4e5493578cf45b804c608d8df354b05%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637504767278995847%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=NUhAJ8zkITwPkvCrUqb7ZogSQTJuBXv0eL6Au0sYC2M%3D&reserved=0<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Ftree%2Fmaster%2FOvmfPkg%2FPlatformCI&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C385eef

Re: [EXTERNAL] Re: [edk2-devel] generating the test matrix for local CI runs

2021-03-04 Thread Bret Barkelew via groups.io
Digging in even further, it looks like you’re asking about tests across test 
pipelines, including some of the platform pipelines. I don’t believe there’s a 
cohesive way to do that, as some of them require platform-specific parameters 
(such as the --FlashRom parameter for OvmfPkg).

Can you share the specific PR you’re failing so that we can talk in concrete 
terms?

My guess (from experience failing this myself) is that you are failing the 
spell check remotely and not running it locally (because Node, npm, or cspell 
are not installed). It’s possible that we should investigate documenting 
cross-pipeline and cross-package CI dependencies in a central place. Right now 
it’s distributed (e.g. did you follow the steps here: 
https://github.com/tianocore/edk2/tree/master/.pytool#spell-checking---cspell).

- Bret

From: Bret Barkelew via groups.io<mailto:bret.barkelew=microsoft@groups.io>
Sent: Thursday, March 4, 2021 10:22 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
rebe...@nuviainc.com<mailto:rebe...@nuviainc.com>; 
ler...@redhat.com<mailto:ler...@redhat.com>
Cc: Sean Brogan<mailto:sean.bro...@microsoft.com>; Kinney, Michael 
D<mailto:michael.d.kin...@intel.com>
Subject: Re: [EXTERNAL] Re: [edk2-devel] generating the test matrix for local 
CI runs

Thinking further, it will skip some tests if you haven’t installed the 
prerequisites (e.g. spell check). We could potentially add a single script to 
install the prerequisites, but then there are the prereqs for the prereqs (e.g. 
Node).

To more clearly address your question, the “tests” that a GitHub CI is broken 
up into are arbitrary subdivisions of the tests that run locally (when you run 
“stuart_ci_build” without parameters) so that the workload can be divided 
amongst the available worker agents. If you were to compare the individual test 
logs against your local, monolithic test log, you would find that all cases 
were covered in both (assuming the aforementioned prereqs are installed).

- Bret

From: Bret Barkelew via groups.io<mailto:bret.barkelew=microsoft@groups.io>
Sent: Thursday, March 4, 2021 9:57 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
rebe...@nuviainc.com<mailto:rebe...@nuviainc.com>; 
ler...@redhat.com<mailto:ler...@redhat.com>
Cc: Sean Brogan<mailto:sean.bro...@microsoft.com>; Kinney, Michael 
D<mailto:michael.d.kin...@intel.com>
Subject: Re: [EXTERNAL] Re: [edk2-devel] generating the test matrix for local 
CI runs

*An* answer is:
- There’s a DevOps virtual environment that you can run that will pretend to be 
a build agent. I played with it years ago, but that was before the CI tooling 
(and it was years ago) so I don’t know how the capabilities compare.

My real answer is:
- If you run the three commands -- setup, update, and build -- without any 
parameters other than your TOOL_CHAIN_TAG, it should run all tests on all 
packages for that particular OS/toolchain.

- Bret

From: Rebecca Cran via groups.io<mailto:rebecca=nuviainc@groups.io>
Sent: Thursday, March 4, 2021 9:45 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
ler...@redhat.com<mailto:ler...@redhat.com>
Cc: Sean Brogan<mailto:sean.bro...@microsoft.com>; Bret 
Barkelew<mailto:bret.barke...@microsoft.com>; Kinney, Michael 
D<mailto:michael.d.kin...@intel.com>
Subject: [EXTERNAL] Re: [edk2-devel] generating the test matrix for local CI 
runs

On 3/4/21 10:04 AM, Laszlo Ersek wrote:
> (Sigh, my address book pulled one over me -- resending to the correct
> list address now. Please ignore the previous posting that you may have
> gotten "in private".)
>
> Hi All,
>
> while I can run specific CI tests locally, using the commands listed at:
>
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Ftree%2Fmaster%2F.pytool&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ce4e5493578cf45b804c608d8df354b05%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637504767278995847%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=l8WblhD%2B7dpkFaCZ8roSfNUmj1imytHi5eUT%2F%2BKrLCo%3D&reserved=0<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Ftree%2Fmaster%2F.pytool&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C17527a8762f346729ca508d8df3a3118%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637504789795390940%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=nKugKAbKDAjSZASwvAAnvDTvaev1IezlePOxvURGrF8%3D&reserved=0>
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Ftree%2Fmaster%2FArmVirtPkg%2FPlatformCI&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ce4e5493578cf45b804c608d8df354b05%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C

Re: [EXTERNAL] Re: [edk2-devel] [PATCH v6 0/7] Add MmUnblockMemoryLib Interface and Usages

2021-03-05 Thread Bret Barkelew via groups.io
“I had to jump through hoops to collect the individual patches from my list 
folder”
Man, it’s almost like you had Outlook. *shudder*

- Bret

From: Laszlo Ersek via groups.io
Sent: Friday, March 5, 2021 7:28 AM
To: devel@edk2.groups.io; 
ku...@outlook.com
Cc: Kinney, Michael D; Liming 
Gao; Zhiguang 
Liu; Yao, Jiewen; 
Jian J Wang; Hao A Wu; 
Ard Biesheuvel; Jordan 
Justen; Qi Zhang; 
Rahul Kumar
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v6 0/7] Add MmUnblockMemoryLib 
Interface and Usages

On 03/05/21 05:59, Kun Qin wrote:
> Hi,
>
> Thanks to all the reviewers helping through this patch series. Each 
> individual patch has received reviewed-by tag in this v6 version. It has also 
> just passed all CI build tests here: Unblock mem v6 by kuqin12 · Pull Request 
> #1473 · tianocore/edk2 
> (github.com)
>  Could one of the maintainers help to merge these patches into the mainline 
> when you have a chance?
>
> Please let me know if there is anything needed from me to merge in these 
> patches. Thanks in advance!

(1) Series merged as commit range c5740f360636..59a3ccb09e7a, via
.


(2) I couldn't tell if there was a TianoCore BZ specifically associated
with this series. Some patches in the series do not reference any BZs,
while some other patches reference two different BZs, namely #3168 and
#3169.

Neither #3168 nor #3169 contains links to *all six* postings (versions)
of the patch series. So I can't decide if now, with the v6 series
merged, I should close these tickets, or not. (IOW, if other tasks
remain, for solving the BZs.)

In case the tickets should be closed at this point, please go ahead and
close them yourself, as RESOLVED|FIXED. Please also include a new
comment in each ticket, repeating my point (1) above, verbatim -- each
solved BZ should highlight the commit range and the pull request that
solved it.


(3) For the future, please fix up your email setup. I'm not sure what's
happening -- it looks like whatever SMTP server you use throws away the
Message-Id headers generated by git-send-email, and generates new
Message-Ids. Or something similar -- FWIW, the In-Reply-To headers look
questionable as well.

Whatever the background, the threading in your posted patch set is
broken; I had to jump through hoops to collect the individual patches
from my list folder. Please fix this issue for your next contribution.

Thanks,
Laszlo


>
> Regards,
> Kun
>
> From: Kun Qin
> Sent: Thursday, March 4, 2021 20:13
> To: devel@edk2.groups.io
> Cc: Michael D Kinney; Liming 
> Gao; Zhiguang 
> Liu; Jiewen Yao; 
> Jian J Wang; Hao A 
> Wu; Laszlo Ersek; Ard 
> Biesheuvel; Jordan 
> Justen; Qi 
> Zhang; Rahul Kumar
> Subject: [edk2-devel] [PATCH v6 0/7] Add MmUnblockMemoryLib Interface and 
> Usages
>
> This patch series is a follow up of previous submission:
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F72442&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C043a8827bad043bd7e9d08d8dfeb49ff%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637505548948688125%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=cNexu92PbyNbxrUN7l%2BdZqVcwfvHfKFohUuWPvO2Py4%3D&reserved=0
>
> v6 patches mainly focus on feedback for reviewed commits in v5 patches,
> including:
> a. Adding "Reviewed-by" and "Acked-by" tags for a

[edk2-devel] New Year, New PR Thread

2021-03-05 Thread Bret Barkelew via groups.io
Can we move to PRs yet? Maybe after the stabilization?

- Bret



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#72504): https://edk2.groups.io/g/devel/message/72504
Mute This Topic: https://groups.io/mt/81108115/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [EXTERNAL] [patch V2 27/29] UnitTestFrameworkPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib

2021-03-22 Thread Bret Barkelew via groups.io
Is there a PR somewhere that has a branch with all these changes applied? I’d 
like to poke around a little.

Thanks!

- Bret

From: Dandan Bi
Sent: Monday, March 22, 2021 1:10 AM
To: devel@edk2.groups.io
Cc: Kinney, Michael D; Sean 
Brogan; Bret 
Barkelew
Subject: [EXTERNAL] [patch V2 27/29] UnitTestFrameworkPkg: Consume 
MdeLibs.dsc.inc for RegisterFilterLib

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3246&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C77dd99e3296941afb9b408d8ed09fd3c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637519974445661033%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=oDafPDNi1k2MRYGrp%2Frhy1dB43tk%2B0YwF8%2FxdLqBXt8%3D&reserved=0

MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.

So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.

Cc: Michael D Kinney 
Cc: Sean Brogan 
Cc: Bret Barkelew 
Signed-off-by: Dandan Bi 
---
 UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc 
b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
index 8adf690098..4adb98aff5 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
@@ -1,14 +1,16 @@
 ## @file
 # UnitTestFrameworkPkg DSC include file for target based test DSC
 #
-# Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##

 [LibraryClasses]
+  !include MdePkg/MdeLibs.dsc.inc
+
   #
   # Entry point
   #
   PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
   
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
--
2.18.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73144): https://edk2.groups.io/g/devel/message/73144
Mute This Topic: https://groups.io/mt/81532403/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] [edk2-devel] [PATCH 1/1] MdeModulePkg/BmpSupportLib: Allow BMP with extra data

2021-03-23 Thread Bret Barkelew via groups.io
Is this a *good* idea?

What is considered valid extra data? If it’s immaterial to the FW displaying 
the image, our policy has been to strip it off BEFORE adding it to the FW image.

- Bret

From: Jeff Brasen via groups.io
Sent: Tuesday, March 23, 2021 10:29 AM
To: devel@edk2.groups.io
Cc: jian.j.w...@intel.com; 
ao.a...@intel.com; Jeff 
Brasen
Subject: [EXTERNAL] [edk2-devel] [PATCH 1/1] MdeModulePkg/BmpSupportLib: Allow 
BMP with extra data

Add support for processing BMP data that contains extra data after the
image array, this data will not be parsed in anyway in the library but
images that contain this will not be rejected from processing.

---
 MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c 
b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
index 3ac31f6723d0..944d01fe7cdf 100644
--- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
+++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
@@ -213,7 +213,7 @@ TranslateBmpToGopBlt (

   if ((BmpHeader->Size != BmpImageSize) ||
   (BmpHeader->Size < BmpHeader->ImageOffset) ||
-  (BmpHeader->Size - BmpHeader->ImageOffset != DataSize)) {
+  (BmpHeader->Size - BmpHeader->ImageOffset < DataSize)) {

 DEBUG ((DEBUG_ERROR, "TranslateBmpToGopBlt: invalid BmpImage... \n"));
 DEBUG ((DEBUG_ERROR, "   BmpHeader->Size: 0x%x\n", BmpHeader->Size));
--
2.25.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73194): https://edk2.groups.io/g/devel/message/73194
Mute This Topic: https://groups.io/mt/81556871/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [EXTERNAL] [patch V2 27/29] UnitTestFrameworkPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib

2021-03-25 Thread Bret Barkelew via groups.io
Thanks, Dandan!

Apologies if this has already been asked, but is this necessary because C 
doesn’t have any options for symbol namespacing?
In other words, would it be just as easy to do this with a new implementation 
of IoLib if we didn’t have to worry about the symbol collisions?

- Bret

From: Bi, Dandan
Sent: Monday, March 22, 2021 6:52 PM
To: Bret Barkelew; 
devel@edk2.groups.io
Cc: Kinney, Michael D; Sean 
Brogan
Subject: RE: [EXTERNAL] [patch V2 27/29] UnitTestFrameworkPkg: Consume 
MdeLibs.dsc.inc for RegisterFilterLib

Hi Bret,

Here is the branch and PR I just created for this change, please help review. 
Thanks.
https://github.com/dandanbi/edk2/tree/RegisterFilterLibV2
https://github.com/tianocore/edk2/pull/1509



Thanks,
Dandan

From: Bret Barkelew 
Sent: Tuesday, March 23, 2021 2:25 AM
To: Bi, Dandan ; devel@edk2.groups.io
Cc: Kinney, Michael D ; Sean Brogan 

Subject: RE: [EXTERNAL] [patch V2 27/29] UnitTestFrameworkPkg: Consume 
MdeLibs.dsc.inc for RegisterFilterLib

Is there a PR somewhere that has a branch with all these changes applied? I’d 
like to poke around a little.

Thanks!

- Bret

From: Dandan Bi
Sent: Monday, March 22, 2021 1:10 AM
To: devel@edk2.groups.io
Cc: Kinney, Michael D; Sean 
Brogan; Bret 
Barkelew
Subject: [EXTERNAL] [patch V2 27/29] UnitTestFrameworkPkg: Consume 
MdeLibs.dsc.inc for RegisterFilterLib

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3246&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C77dd99e3296941afb9b408d8ed09fd3c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637519974445661033%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=oDafPDNi1k2MRYGrp%2Frhy1dB43tk%2B0YwF8%2FxdLqBXt8%3D&reserved=0

MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.

So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.

Cc: Michael D Kinney 
mailto:michael.d.kin...@intel.com>>
Cc: Sean Brogan mailto:sean.bro...@microsoft.com>>
Cc: Bret Barkelew 
mailto:bret.barke...@microsoft.com>>
Signed-off-by: Dandan Bi mailto:dandan...@intel.com>>
---
 UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc 
b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
index 8adf690098..4adb98aff5 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
@@ -1,14 +1,16 @@
 ## @file
 # UnitTestFrameworkPkg DSC include file for target based test DSC
 #
-# Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##

 [LibraryClasses]
+  !include MdePkg/MdeLibs.dsc.inc
+
   #
   # Entry point
   #
   PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
   
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
--
2.18.0.windows.1




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#7

Re: [EXTERNAL] Re: [edk2-devel] !!! DEPRECATED INTERFACE !!! VariableLockRequestToLock

2021-03-25 Thread Bret Barkelew via groups.io
Yes, this is expected behavior. The messages are to encourage code owners to 
move from using the VariableLockRequestToLock() interface to the VariablePolicy 
interface so that the RTL interface may be removed in the future.

The correct solution is to find the offending code and submit a patch that 
updates it to not use RTL. My guess is that this is the location that you’re 
hitting, if you’re using the edk2 BdsDxe:
https://github.com/tianocore/edk2/blob/4bf2a5b045ebf8b5e90d9210ad5190699bddb592/MdeModulePkg/Universal/BdsDxe/BdsEntry.c#L723

I can try to submit a patch next week (I’m slammed this week) to port this over 
to VariablePolicy.
Note, however, that the messages are not affecting the functionality. They’re 
purely nag messages.

- Bret

From: Laszlo Ersek
Sent: Thursday, March 25, 2021 12:04 PM
To: Bret Barkelew
Cc: devel@edk2.groups.io; 
m...@semihalf.com
Subject: [EXTERNAL] Re: [edk2-devel] !!! DEPRECATED INTERFACE !!! 
VariableLockRequestToLock

Hi Bret,

can you help Marcin please?

Thanks
Laszlo

On 03/25/21 10:19, Marcin Wojtas wrote:
> Hi,
>
> When booting the latest edk2 on Marvell SoCs I get a number of prints as
> below:
>
> !!! DEPRECATED INTERFACE !!! VariableLockRequestToLock() will go away soon!
> !!! DEPRECATED INTERFACE !!! Please move to use Variable Policy!
> !!! DEPRECATED INTERFACE !!! Variable: 8BE4DF61-93CA-11D2-AA0D-00E098032B8C
> PlatformLangCodes
> !!! DEPRECATED INTERFACE !!! VariableLockRequestToLock() will go away soon!
> !!! DEPRECATED INTERFACE !!! Please move to use Variable Policy!
> !!! DEPRECATED INTERFACE !!! Variable: 8BE4DF61-93CA-11D2-AA0D-00E098032B8C
> LangCodes
> ...
>
> I cleared variable storage, looked into code, compared VariablePolicy
> library resolution to other platforms (it looks the same and was updated
> along with all others in
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2-platforms%2Fcommit%2F8034e3b2ae9470adb&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C98c3d9be0b2c4654874d08d8efc0cdb5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637522958656548916%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=mwHi%2BAwmh5rh%2BAfdXBBx0ZXobV1bT1%2Bsi8%2BpcLxVNsQ%3D&reserved=0),
>  but
> still don't see, how to get rid of those.
>
> Is it expected behavior? Any suggestions how to properly remove those
> messages?
>
> Best regards,
> Marcin
>
>
> 
>
>
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73292): https://edk2.groups.io/g/devel/message/73292
Mute This Topic: https://groups.io/mt/81614021/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] GSoC 2021 (MinPlatform, Ext2, ACPICA, etc)

2021-03-28 Thread Bret Barkelew via groups.io
I agree that this does seem like a fun and useful project. Great to have you 
working with us, Pedro!

- Bret

From: Nate DeSimone via 
groups.io
Sent: Sunday, March 28, 2021 3:31 PM
To: Pedro Falcato; 
devel@edk2.groups.io
Subject: [EXTERNAL] Re: [edk2-devel] GSoC 2021 (MinPlatform, Ext2, ACPICA, etc)

Hi Pedro,

No problem, I’ve been really busy recently too 😊. I definitely recommend 
setting up filtering rules for the edk2 mailing list(s) because there is a LOT 
of volume. Personally, set up my filter rules so that PATCH emails go in a 
separate folder, that makes the list much more readable.

For the Raspberry Pi… yeah it is more of a refactoring activity. For some of 
the other board ports it is more interesting. We already went over the x86 
board porting, which I think would be an interesting and unique project, the 
problem is finding a suitable board… and most x86 boards are expensive. The 
Qemu OpenBoard also has a bit more meat to it I think. Since it involves 
figuring out how to merge ArmVirtPkg and OvmfPkg in a way that makes sense, it 
probably involves building some new advanced features. I think it is possible 
to spice up the Raspberry Pi project a bit though. Maybe add support for the 
Raspberry Pi Zero? Right now we only support the Raspberry Pi 3 & 4.

The ext2/4 disk driver would certainly also be interesting! My understanding is 
that ext4 is pretty much the same filesystem as ext2, they just added some 
features on top of ext2. I took a quick peek and your boilerplate and it looks 
like a good start. The one thing you will have to be VERY careful about is 
keeping TianoCore GPL-free. You need to be very careful to not read a single 
line of Linux kernel source code. You can read the kernel’s ext2/3/4 
documentation but do NOT read the kernel’s source code. I think that should be 
doable since FreeBSD 12 (circa 2018) now has full read/write support for ext4 
in their ext2 driver and has had a GPL-free ext2 driver for quite some time 
(FreeBSD 9 circa 2012.) You are welcome to read (and even use) the FreeBSD 
source code (as long as it is newer than 2012 of course.) In your proposal, I 
would recommend you set an achievable target. Maybe promise read-only as a 
baseline success criteria and then make writing a stretch goal. I strongly 
prefer that everyone ends up with a successful project.

I do this this project would be useful. If full write support is achieved 
GPL-free, this driver could be integrated into the firmware distributed in OEM 
motherboards. This would make it really easy for us to boot Linux kernels 
directly from the UEFI boot manager, eliminating the need for GRUB and a 
separate EFI system partition for loading Linux.

Our disk I/O subsystem does not need to reach the performance level of an 
operating system. We usually only need to load a few MBs from disk before we 
handoff to the OS kernel. In general, UEFI is designed to favor simplicity over 
performance. The biggest bottleneck is the fact that UEFI uses exclusively 
polling I/O and does not have any interrupt handlers except for the timer 
interrupt. My guess is a disk cache is probably overkill because the filesystem 
driver is unlikely to be the bottleneck.

For comparison, currently our only filesystem driver is the FAT32 driver, and 
the FAT32 driver is definitely fast enough for our purposes. On an Intel Tiger 
Lake platform with the EFI System Partition stored on a NVMe SSD, it takes 60ms 
(milliseconds) to initialize the NVMe driver, enumerate the partition table, 
and mount the FAT32 filesystem. Out of that 60ms, only 1.4ms is directly 
consumed by the FAT32 driver, the rest of it is initialization of the lower 
level drivers. After initialization is complete, it takes the FAT32 driver 
3.5ms to load bootmgfw.efi from disk to memory. To put that into perspective, 
after bootmgfw.efi is loaded into memory it takes the DXE core 13.5ms to verify 
that the signature on the file is valid and was signed by a code signing 
certificate that is in the UEFI secure boot trusted certificate list as well as 
processing PE/COFF relocation fixups needed to execute the file.

Thinking about performance, bootmgfw.efi (the Windows boot manager) is a little 
over 1.5MB, so that works out to a disk I/O subsystem performance of roughly 
450MB/sec… while this is not the ~1000MB/sec you would expect from a high 
performance NVMe driver, it is still not bad considering it is being done using 
polling I/O and the EDK II NVMe driver doesn’t build the largest possible 
scatter gather list that the NVMe controller can handle.

If you look at all of this at the high level, we ended up spending 64ms on disk 
I/O, when the entire Tiger Lake UEFI firmware takes 1.74 sec to run. So, only 
~4% of the system boot time was spent on disk I/O, so right now the filesystem 
drivers are a small drop in the bucket of the overall boot

Re: [EXTERNAL] [edk2-devel] [PATCH 1/1] BaseTools/Ecc: Update structpcd parsing method.

2021-04-01 Thread Bret Barkelew via groups.io
What does “update” mean in this context? What behavior is changing?

- Bret

From: Yuwei Chen via groups.io
Sent: Thursday, April 1, 2021 12:04 AM
To: devel@edk2.groups.io
Cc: mliang2x; Feng, Bob 
C; Liming Gao
Subject: [EXTERNAL] [edk2-devel] [PATCH 1/1] BaseTools/Ecc: Update structpcd 
parsing method.

From: mliang2x 

Update the pcdparser method in Dec and DSC files.

Signed-off-by: Mingyue Liang 
Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
---
 .../Ecc/MetaFileWorkspace/MetaFileParser.py   | 464 ++
 1 file changed, 265 insertions(+), 199 deletions(-)

diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py 
b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
index 9c27c8e16a05..588d3dbe6ed5 100644
--- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
@@ -22,7 +22,7 @@ import Ecc.EccToolError as EccToolError
 from CommonDataClass.DataClass import *
 from Common.DataType import *
 from Common.StringUtils import *
-from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, 
PathClass, AnalyzePcdData
+from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, 
PathClass, AnalyzePcdData, AnalyzeDscPcd, AnalyzePcdExpression, 
ParseFieldValue, StructPattern
 from Common.Expression import *
 from CommonDataClass.Exceptions import *

@@ -31,6 +31,8 @@ from GenFds.FdfParser import FdfParser
 from Common.LongFilePathSupport import OpenLongFilePath as open
 from Common.LongFilePathSupport import CodecOpenLongFilePath

+CODEPattern = re.compile(r"{CODE\([a-fA-F0-9Xx\{\},\s]*\)}")
+
 ## A decorator used to parse macro definition
 def ParseMacro(Parser):
 def MacroParser(self):
@@ -174,6 +176,11 @@ class MetaFileParser(object):
 # UNI object and extra UNI object
 self._UniObj = None
 self._UniExtraObj = None
+# StructPcd var
+self._PcdCodeValue = ""
+self._PcdDataTypeCODE = False
+self._CurrentPcdName = ""
+self._GuidDict = {}  # for Parser PCD value {GUID(gTokeSpaceGuidName)}

 ## Store the parsed data in table
 def _Store(self, *Args):
@@ -395,6 +402,40 @@ class MetaFileParser(object):
 Macros.update(self._SectionsMacroDict[(self._SectionType, 
Scope1, Scope2)])
 return Macros

+def ProcessMultipleLineCODEValue(self, Content):
+CODEBegin = False
+CODELine = ""
+continuelinecount = 0
+newContent = []
+for Index in range(0, len(Content)):
+Line = Content[Index]
+if CODEBegin:
+CODELine = CODELine + Line
+continuelinecount +=1
+if ")}" in Line:
+newContent.append(CODELine)
+for _ in range(continuelinecount):
+newContent.append("")
+CODEBegin = False
+CODELine = ""
+continuelinecount = 0
+else:
+if not Line:
+newContent.append(Line)
+continue
+if "{CODE(" not in Line:
+newContent.append(Line)
+continue
+elif CODEPattern.findall(Line):
+newContent.append(Line)
+continue
+else:
+CODEBegin = True
+CODELine = Line
+
+return newContent
+
+
 _SectionParser  = {}
 Finished= property(_GetFinished, _SetFinished)
 _Macros = property(_GetMacros)
@@ -812,6 +853,8 @@ class DscParser(MetaFileParser):
 Content = open(str(self.MetaFile.Path), 'r').readlines()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
+
+Content = self.ProcessMultipleLineCODEValue(Content)
 #
 # Insert a record for file
 #
@@ -1018,24 +1061,71 @@ class DscParser(MetaFileParser):
 #
 @ParseMacro
 def _PcdParser(self):
+if self._PcdDataTypeCODE:
+self._PcdCodeValue = self._PcdCodeValue + "\n " + self._CurrentLine
+if self._CurrentLine.endswith(")}"):
+self._CurrentLine = "|".join((self._CurrentPcdName, 
self._PcdCodeValue))
+self._PcdDataTypeCODE = False
+self._PcdCodeValue = ""
+else:
+self._ValueList = None
+return
 TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)
+self._CurrentPcdName = TokenList[0]
+if len(TokenList) == 2 and TokenList[1].strip().startswith("{CODE"):
+self._PcdDataTypeCODE = True
+self._PcdCodeValue = TokenList[1].strip()
+
+  

Re: [EXTERNAL] [edk2-devel] [PATCH 1/1] MdeModulePkg/BmpSupportLib: Allow BMP with extra data

2021-04-01 Thread Bret Barkelew via groups.io
I agree with the proposal for a deeper security review.

I also would suggest that we can provide tooling with BaseTools to check and/or 
correct the format of a BMP to match what the code expects (since there seems 
to be ambiguity in the spec/implementation). We’ve got a validator in Mu and 
would be happy to put together some patches to at least get this started for 
the community to hammer on.

- Bret

From: Gao, Zhichao via groups.io
Sent: Monday, March 29, 2021 6:35 PM
To: devel@edk2.groups.io; 
af...@apple.com; Laszlo Ersek
Cc: Jeff Brasen; Bret 
Barkelew; Wang, Jian 
J; Wu, Hao A; Yao, 
Jiewen; Liming 
Gao; Ni, Ray
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH 1/1] MdeModulePkg/BmpSupportLib: 
Allow BMP with extra data

The patch would let the BMP file that with a bunch of data pass the check, no 
matter the data is valid or not. Do we have other docs to descript which data 
is allowed and valid?

Correct the Cc mail address and invite more experts for security review.

Thanks,
Zhichao

From: devel@edk2.groups.io  On Behalf Of Andrew Fish via 
groups.io
Sent: Thursday, March 25, 2021 11:00 AM
To: edk2-devel-groups-io ; Laszlo Ersek 

Cc: Jeff Brasen ; bret.barke...@microsoft.com; Wang, Jian J 
; ao.a...@intel.com
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH 1/1] MdeModulePkg/BmpSupportLib: 
Allow BMP with extra data



On Mar 24, 2021, at 11:26 AM, Laszlo Ersek 
mailto:ler...@redhat.com>> wrote:

On 03/24/21 16:25, Jeff Brasen wrote:
Some of the logo files we received for the group that makes our assets like 
this (not sure what tool they were created with) look like they pad the BMP 
size to 8 bytes.

TranslateBmpToGopBlt: invalid BmpImage...
  BmpHeader->Size: 0xE1038
  BmpHeader->ImageOffset: 0x36
  BmpImageSize: 0xE1038
  DataSize: 0xE1000
TranslateBmpToGopBlt: invalid BmpImage...
  BmpHeader->Size: 0x2A3038
  BmpHeader->ImageOffset: 0x36
  BmpImageSize: 0x2A3038
  DataSize: 0x2A3000
TranslateBmpToGopBlt: invalid BmpImage...
  BmpHeader->Size: 0x5EEC38
  BmpHeader->ImageOffset: 0x36
  BmpImageSize: 0x5EEC38
  DataSize: 0x5EEC00

So, each of these has 2 bytes of padding at the end of the file. We could write 
a tool that would do the same size recalculation in order to update the size in 
the header and remove the two bytes but it seems that this is a valid BMP file 
and it doesn't seem correct that UEFI is rejecting it. I can update the commit 
message with more context if needed as well.

If there's a spec describing the BMP format,

Yes and there are various flavors as at some point I had some graphics given to 
me in a format that did not work (I think it was BITMAPV4HEADER) :(.

https://en.wikipedia.org/wiki/BMP_file_format#cite_note-DIBhelp-5

edk2 supports ‘BM’ and the BITMAPINFOHEADER DIB. I seem to remember DIBs are 
defined by the size. So ‘BM' is a Microsoft Spec:
https://docs.microsoft.com/en-us/previous-versions/ms969901(v=msdn.10)?redirectedfrom=MSDN

The quote in that spec is:

The file extension of a Windows DIB file is BMP. The file consists of a 
BITMAPFILEHEADER structure followed by the DIB itself. Unfortunately, because 
the BITMAPFILEHEADER structure is never actually passed to the API, not every 
application that generates BMP files fills out the data structure carefully. To 
add to this confusion, the "proper" definition of the structure is at odds with 
the documentation. Properly, the data structure contains the following fields:

The explanation of size field is:
A DWORD that specifies the size of the file in bytes. The Microsoft Windows 
Software Development Kit (SDK) documentation claims otherwise. To be on the 
safe side, many applications calculate their own sizes for reading in a file.

I would say that is not exactly a ringing endorsement from a spec point 

Re: [EXTERNAL] [edk2-devel][edk2-platforms][PATCH V1 1/1] MinPlatformPkg/Variable*Lib: Build VariableRead and VariableWrite libs

2021-09-08 Thread Bret Barkelew via groups.io
Question:

I’ve recently brought up with some that the GetVariable##() functions in 
UefiLib are probably incorrect as they are written (because they assume things 
like gRT and gBS availability). Would it perhaps make sense to move this 
interface up into the MdePkg scope and leverage it to start removing some of 
those assumptions?

I already have a TODO to start splitting UefiLib along phase lines (PEI, DXE, 
MM, etc), but that work could largely be obviated with this abstraction.

- Bret

From: Oram, Isaac W via groups.io
Sent: Wednesday, September 8, 2021 3:29 PM
To: devel@edk2.groups.io
Cc: Chasel Chiu; Desimone, Nathaniel 
L; Liming 
Gao; Dong, Eric
Subject: [EXTERNAL] [edk2-devel][edk2-platforms][PATCH V1 1/1] 
MinPlatformPkg/Variable*Lib: Build VariableRead and VariableWrite libs

Add the VariableReadLib and VariableWriteLib instances to Components to
ensure build when building MinPlatformPkg.dsc.
Add a NULL library instance that provides the non-functional library
instance for VariableReadLib designed for all phase use.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Isaac Oram 
---
 
Platform/Intel/MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVariableReadLibNull.c
   | 75 
 
Platform/Intel/MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVariableReadLibNull.inf
 | 37 ++
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc   
   |  6 +-
 3 files changed, 117 insertions(+), 1 deletion(-)

diff --git 
a/Platform/Intel/MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVariableReadLibNull.c
 
b/Platform/Intel/MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVariableReadLibNull.c
new file mode 100644
index 00..f276b7b6b4
--- /dev/null
+++ 
b/Platform/Intel/MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVariableReadLibNull.c
@@ -0,0 +1,75 @@
+/** @file
+  NULL implementation of Variable Read Lib
+
+  This library provides phase agnostic access to the UEFI Variable Services.
+  This is done by implementing a wrapper on top of the phase specific mechanism
+  for reading from UEFI variables. For example, the PEI implementation of this
+  library uses EFI_PEI_READ_ONLY_VARIABLE2_PPI. The DXE implementation accesses
+  the UEFI Runtime Services Table, and the SMM implementation uses
+  EFI_SMM_VARIABLE_PROTOCOL.
+
+  Using this library allows code to be written in a generic manner that can be
+  used in PEI, DXE, or SMM without modification.
+
+  @copyright
+  Copyright 2021 Intel Corporation. 
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include 
+
+/**
+  Returns the value of a variable.
+
+  @param[in]   VariableName  A Null-terminated string that is the name of 
the vendor's
+ variable.
+  @param[in]   VendorGuidA unique identifier for the vendor.
+  @param[out]  AttributesIf not NULL, a pointer to the memory location 
to return the
+ attributes bitmask for the variable.
+  @param[in, out]  DataSize  On input, the size in bytes of the return 
Data buffer.
+ On output the size of data returned in Data.
+  @param[out]  Data  The buffer to return the contents of the 
variable. May be NULL
+ with a zero DataSize in order to determine 
the size buffer needed.
+
+  @retval EFI_UNSUPPORTEDThis function is not implemented by this 
instance of the LibraryClass
+
+**/
+EFI_STATUS
+EFIAPI
+VarLibGetVariable (
+  IN CHAR16  *VariableName,
+  IN EFI_GUID*VendorGuid,
+  OUTUINT32  *Attributes,OPTIONAL
+  IN OUT UINTN   *DataSize,
+  OUTVOID*Data   OPTIONAL
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  Enumerates the current variable names.
+
+  @param[in, out]  VariableNameSize The size of the VariableName buffer. The 
size must be large
+enough to fit input string supplied in 
VariableName buffer.
+  @param[in, out]  VariableName On input, supplies the last VariableName 
that was returned
+by GetNextVariableName(). On output, 
returns the Nullterminated
+string of the current variable.
+  @param[in, out]  VendorGuid   On input, supplies the last VendorGuid 
that was returned by
+GetNextVariableName(). On output, returns 
the
+VendorGuid of the current variable.
+
+  @retval EFI_UNSUPPORTED   This function is not implemented by this 
instance of the LibraryClass
+
+**/
+EFI_STATUS
+EFIAPI
+VarLibGe

Re: [edk2-devel] ArmVirt and Self-Updating Code

2021-07-22 Thread Bret Barkelew via groups.io
Expanding audience to the full dev list…
See below…

- Bret

From: Thomas Abraham
Sent: Wednesday, July 7, 2021 11:07 PM
To: Bret Barkelew; Ard Biesheuvel 
(TianoCore); Lindholm, 
Leif; Laszlo Ersek; Marvin 
Häuser; Sami Mujawar
Cc: nd
Subject: [EXTERNAL] RE: ArmVirt and Self-Updating Code

+ Sami

From: Bret Barkelew 
Sent: Thursday, July 8, 2021 11:05 AM
To: Thomas Abraham ; Ard Biesheuvel (TianoCore) 
; Lindholm, Leif ; Laszlo Ersek 
; Marvin Häuser 
Subject: ArmVirt and Self-Updating Code

All,

Marvin asked me a question on the UEFI Talkbox Discord that’s a little beyond 
my ken…

“There is self-relocating code in ArmVirtPkg:
https://github.com/tianocore/edk2/blob/17143c4837393d42c484b42d1789b85b2cff1aaf/ArmVirtPkg/PrePi/PrePi.c#L133-L165
According to comments in the ASM, it seems like this is for Linux-based RAM 
boot (I saw further stuff for KVM, so it makes sense I guess?). It seems 
unfortunate it cannot be mapped into a known address range so that 
self-relocation is not necessary, but that's out of my scope to understand.

“Now, StandaloneMmPkg has similar (self-)relocation code too: 
https://github.com/tianocore/edk2/blob/17143c4837393d42c484b42d1789b85b2cff1aaf/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c#L379-L386
Because I cannot find such elsewhere, I assume it must be for the same ARM 
virtualised environment as above. The binary it applies the Relocations to is 
documented to be the Standalone MM core, but in fact SecCore is located:
https://github.com/tianocore/edk2/blob/17143c4837393d42c484b42d1789b85b2cff1aaf/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c#L131-L158

“This yields the following questions to me:
1) What even invokes Standalone MM on ARM? It is documented it is spawned 
during SEC, but I could not find any actual invocation.
2) Why does Standalone MM (self-)relocation locate SecCore? Should it not 
already have been relocated with the code from ArmPlatformPkg? Is Standalone MM 
embedded into ARM SecCore?
3) Why is SecCore the only module relocated? Are all others guaranteed to be 
"properly" loaded?
4) Is there maybe some high-level documented about the ARM boot flow? It seems 
to be significantly different from the x86 routes quite vastly.”

Hoping that one of you could get me closer to an answer for him. Also happy to 
take this to the greater mailing list, but thought I’d avoid churn.

Thanks in advance!
- Bret




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78093): https://edk2.groups.io/g/devel/message/78093
Mute This Topic: https://groups.io/mt/84380729/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] [edk2-devel] Missing TPM 2 related call to Tpm2HierarchyChangeAuth

2021-07-27 Thread Bret Barkelew via groups.io
Adding @Jeremiah…

Jeremiah, weren’t you or @Michael 
shopping this change to MinPlatform?

- Bret

From: Stefan Berger via groups.io
Sent: Monday, July 26, 2021 7:48 AM
To: Yao, Jiewen; 
devel@edk2.groups.io
Cc: Marc-André Lureau
Subject: [EXTERNAL] [edk2-devel] Missing TPM 2 related call to 
Tpm2HierarchyChangeAuth

Hello!

   The TPM 2 code in EDK2 is missing an important call to
Tpm2HierarchyChangeAuth for the platform hierarchy. We have to set the
password of that hierarchy and discard the password. See also specs
section 11:
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftrustedcomputinggroup.org%2Fwp-content%2Fuploads%2FTCG_PCClient_PFP_r1p05_v22_02dec2020.pdf&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Cf2a2262eee2c44b3760c08d95044601a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637629077356686202%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=N7VQIw87rHqUAFQ54TvhNwcsPFEwJzdZQ9JZrmX1S4E%3D&reserved=0

"Platform Firmware MUST protect access to the Platform Hierarchy and
prevent access to the platform hierarchy by
non-manufacturer-controlled components.  "

I was wondering where we could put that call so it's invoked after the
user has possibly interacted with the menu and before passing control to
the next stage such as boot loader.

Regards,

   Stefan









-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78230): https://edk2.groups.io/g/devel/message/78230
Mute This Topic: https://groups.io/mt/84485285/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib

2021-07-30 Thread Bret Barkelew via groups.io
Note, even though this keeps with the style of the rest of the file, it breaks 
ECC:
SecurityPkg/Library: Add Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib by 
corthon · Pull Request #1848 · tianocore/edk2 
(github.com)<https://github.com/tianocore/edk2/pull/1848>

PROGRESS - --Running SecurityPkg: EccCheck Test NO-TARGET --
ERROR -
ERROR -
ERROR - EFI coding style error
ERROR - *Error code: 8001
ERROR - *Only capital letters are allowed to be used for #define declarations
ERROR - *file: 
//home/vsts/work/1/s/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
ERROR - *Line number: 27
ERROR - *The #define name [RC_NV_UndefineSpaceSpecial_nvIndex] does no

Thoughts?

- Bret

From: Bret Barkelew via groups.io<mailto:bret=corthon@groups.io>
Sent: Friday, July 30, 2021 10:55 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Yao, Jiewen<mailto:jiewen@intel.com>; Jian J 
Wang<mailto:jian.j.w...@intel.com>; Qi Zhang<mailto:qi1.zh...@intel.com>; Rahul 
Kumar<mailto:rahul1.ku...@intel.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib

Used to provision and maintain certain HW-defined NV spaces.

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2994&data=04%7C01%7CBret.Barkelew%40microsoft.com%7Cb7ae3c62047c48fc85d908d953833ca0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637632645397602953%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=s96M3RvxMOY831Vfr1nt%2Fz1h3cyb6jU9eFzvjKO7Dtc%3D&reserved=0

Signed-off-by: Bret Barkelew 
Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Qi Zhang 
Cc: Rahul Kumar 
---
 SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c | 122 
 SecurityPkg/Include/Library/Tpm2CommandLib.h   |  22 
 2 files changed, 144 insertions(+)

diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c 
b/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
index 87572de20164..7931fade9190 100644
--- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
+++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
@@ -24,6 +24,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define RC_NV_UndefineSpace_authHandle  (TPM_RC_H + TPM_RC_1)

 #define RC_NV_UndefineSpace_nvIndex (TPM_RC_H + TPM_RC_2)



+#define RC_NV_UndefineSpaceSpecial_nvIndex  (TPM_RC_H + TPM_RC_1)

+

 #define RC_NV_Read_authHandle   (TPM_RC_H + TPM_RC_1)

 #define RC_NV_Read_nvIndex  (TPM_RC_H + TPM_RC_2)

 #define RC_NV_Read_size (TPM_RC_P + TPM_RC_1)

@@ -74,6 +76,20 @@ typedef struct {
   TPMS_AUTH_RESPONSE AuthSession;

 } TPM2_NV_UNDEFINESPACE_RESPONSE;



+typedef struct {

+  TPM2_COMMAND_HEADER   Header;

+  TPMI_RH_NV_INDEX  NvIndex;

+  TPMI_RH_PLATFORM  Platform;

+  UINT32AuthSessionSize;

+  TPMS_AUTH_COMMAND AuthSession;

+} TPM2_NV_UNDEFINESPACESPECIAL_COMMAND;

+

+typedef struct {

+  TPM2_RESPONSE_HEADER   Header;

+  UINT32 AuthSessionSize;

+  TPMS_AUTH_RESPONSE AuthSession;

+} TPM2_NV_UNDEFINESPACESPECIAL_RESPONSE;

+

 typedef struct {

   TPM2_COMMAND_HEADER   Header;

   TPMI_RH_NV_AUTH   AuthHandle;

@@ -506,6 +522,112 @@ Done:
   return Status;

 }



+/**

+  This command removes an index from the TPM.

+

+  @param[in]  NvIndex The NV Index.

+  @param[in]  IndexAuthSessionAuth session context for the Index 
auth/policy

+  @param[in]  PlatAuthSession Auth session context for the Platform 
auth/policy

+

+  @retval EFI_SUCCESS Operation completed successfully.

+  @retval EFI_NOT_FOUND   The command was returned successfully, but 
NvIndex is not found.

+  @retval EFI_UNSUPPORTED Selected NvIndex does not support deletion 
through this call.

+  @retval EFI_SECURITY_VIOLATION  Deletion is not authorized by current policy 
session.

+  @retval EFI_INVALID_PARAMETER   The command was unsuccessful.

+  @retval EFI_DEVICE_ERRORThe command was unsuccessful.

+**/

+EFI_STATUS

+EFIAPI

+Tpm2NvUndefineSpaceSpecial (

+  IN  TPMI_RH_NV_INDEX  NvIndex,

+  IN  TPMS_AUTH_COMMAND *IndexAuthSession OPTIONAL,

+  IN  TPMS_AUTH_COMMAND *PlatAuthSession OPTIONAL

+  )

+{

+  EFI_STATUS  Status;

+  TPM2_NV_UNDEFINESPACESPECIAL_COMMANDSendBuffer;

+  TPM2_NV_UNDEFINESPACESPECIAL_RESPONSE   RecvBuffer;

+  UINT32  SendBufferSize;

+  UINT32  RecvBufferSize;

+  UINT8   *Buffer;

+  UINT32  IndexAuthSize, PlatAuthSize;

+  TPM_RC  ResponseCode;

+

+  //

+  // Construct command

+  //


Re: [EXTERNAL] [edk2-devel] [edk2][PATCH v1 1/1] StandaloneMmPkg: add support to populate StMM boot data from device tree

2021-07-30 Thread Bret Barkelew via groups.io
I don’t think this is a good dependency. StandaloneMmCore shouldn’t require 
anything from EmbeddedPkg, and if it does there’s probably some more 
generalization necessary.

Further, we can’t require the MmCore (which should be considered generic at the 
level of PEI Core or DXE Core) include some external library like Libfdt 
without significant justification.

- Bret

From: Sayanta Pattanayak via 
groups.io
Sent: Friday, July 30, 2021 10:36 AM
To: devel@edk2.groups.io
Cc: Ard Biesheuvel; Sami 
Mujawar; Achin Gupta
Subject: [EXTERNAL] [edk2-devel] [edk2][PATCH v1 1/1] StandaloneMmPkg: add 
support to populate StMM boot data from device tree

Introduce support to populate StMM boot data via DTS parsing. The DTB is
passed as a boot argument by a binary of higer exception level.
Previously it was achieved by placing the boot data structure in a
shared buffer and the address of this shared buffer was passed by the
binary of higher exception level. Now either of the option can be used
for populating StMM boot info.

StMM boot information structure binding in device tree can be of following
prototype. Property values are not mentioned here.

bootarg {
  compatible = "bootargs";
  h_type  = <..>;
  h_version = <..>;
  h_size= <..>;
  h_attr= <..>;
  sp_mem_base = <..>;
  sp_mem_limit= <..>;
  sp_image_base   = <..>;
  sp_stack_base   = <..>;
  sp_heap_base= <..>;
  sp_ns_comm_buf_base = <..>;fc
  sp_shared_buf_base  = <..>;
  sp_image_size   = <..>;
  sp_pcpu_stack_size  = <..>;
  sp_heap_size= <..>;
  sp_ns_comm_buf_size = <..>;
  sp_shared_buf_size  = <..>;
  num_sp_mem_regions  = <..>;
  num_cpus= <..>;
};

Addition of DTS supoort involves a dependency on FdtLib from EmbeddedPkg.

Signed-off-by: Sayanta Pattanayak 
---
 Link to github branch with this patch -
 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSayantaP-arm%2Fedk2%2Ftree%2Fstmm-dts&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Cb365266c83cb433d1e0108d953806c83%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637632633786132182%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=gJw%2BH8Dj9lih1DNrIzbNPToJn9nH%2BHqpvpSr2JJrS4I%3D&reserved=0

 StandaloneMmPkg/StandaloneMmPkg.dsc
 |   1 +
 
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
   |   3 +
 
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
 | 153 ++--
 3 files changed, 143 insertions(+), 14 deletions(-)

diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc 
b/StandaloneMmPkg/StandaloneMmPkg.dsc
index 0c45df95e2dd..e3a3a6ee3ba1 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -49,6 +49,7 @@
   HobLib|StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
   MemLib|StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf
+  FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf
   
MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.inf
   
MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
diff --git 
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
 
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
index 4fa426f58ef4..0a2e519dd664 100644
--- 
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
+++ 
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
@@ -30,6 +30,7 @@
   X64/StandaloneMmCoreEntryPoint.c

 [Packages]
+  EmbeddedPkg/EmbeddedPkg.dec
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
   StandaloneMmPkg/StandaloneMmPkg.dec
@@ -40,10 +41,12 @@
 [LibraryClasses]
   BaseLib
   DebugLib
+  FdtLib

 [LibraryClasses.AARCH64]
   StandaloneMmMmuLib
   ArmSvcLib
+  FdtLib

 [Guids]
   gMpInformationHobGuid
diff --git 
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
 
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
index 6c50f470aa35..cc09d75dac36 100644
--- 
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
+++ 
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
@@ -16,6 +16,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include 
 #include 

+#include 
 #include 
 #include 
 #include 
@@ -45,33 +46,31 @@ STATIC CONST UINT32 mSpmMinorVerFfa = SPM_MINOR_VERSION_FFA;

Re: [edk2-devel] Proposing a new area of the edk2-test repository

2021-08-03 Thread Bret Barkelew via groups.io
Yeah, go for the patch.

- Bret

From: Samer El-Haj-Mahmoud via 
groups.io
Sent: Tuesday, August 3, 2021 6:10 AM
To: Nelson, Eric; Bret 
Barkelew; 
devel@edk2.groups.io; G Edhaya 
Chandran; 
gao...@byosoft.com.cn; Kinney, Michael 
D
Cc: Samer El-Haj-Mahmoud
Subject: [EXTERNAL] Re: [edk2-devel] Proposing a new area of the edk2-test 
repository

I would think just sending the code contribution patch is sufficient.


From: Nelson, Eric 
Sent: Wednesday, July 28, 2021 3:05 PM
To: Samer El-Haj-Mahmoud ; Bret Barkelew 
; devel@edk2.groups.io; G Edhaya Chandran 
; gao...@byosoft.com.cn; Kinney, Michael D 

Subject: RE: Proposing a new area of the edk2-test repository


Adding ResumeOK.efi tool under /edk2-test/test-tools/TestToolsPkg would be 
great.

Should I propose this in the RFC and DEVEL mailing lists as a next step?

Thanks,
__e


From: Samer El-Haj-Mahmoud 
mailto:samer.el-haj-mahm...@arm.com>>
Sent: Friday, July 9, 2021 1:12 PM
To: Bret Barkelew 
mailto:bret.barke...@microsoft.com>>; 
devel@edk2.groups.io; Nelson, Eric 
mailto:eric.nel...@intel.com>>; G Edhaya Chandran 
mailto:edhaya.chand...@arm.com>>; 
gao...@byosoft.com.cn; Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
Subject: RE: Proposing a new area of the edk2-test repository

Interesting, thanks for sharing Bret. Some of those tests seem to be x64 
specific (SMM tests), and some can be more generic like MorLockTestApp

Like I said earlier, I am not against adding test tools to edk2-test. That in 
fact is welcomed, especially if their usefulness in validating the solutions 
extend beyond specific implementations.

What would a good tree structure look like to accommodate misc tools? Today we 
have

/edk2-test/uefi-sct/SctPkg

How about something like this?
/edk2-test/test-tools/TestToolsPkg
or /edk2-test/ TestToolsPkg

The “ResumeOK” can be placed there

Any other ideas?


From: Bret Barkelew 
mailto:bret.barke...@microsoft.com>>
Sent: Thursday, June 24, 2021 12:25 AM
To: devel@edk2.groups.io; 
eric.nel...@intel.com; Samer El-Haj-Mahmoud 
mailto:samer.el-haj-mahm...@arm.com>>; G Edhaya 
Chandran mailto:edhaya.chand...@arm.com>>; 
gao...@byosoft.com.cn; Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
Subject: RE: Proposing a new area of the edk2-test repository

Fun fact! Mu also has a number of apps and things that we could work on moving 
to EDK2 if there were a suitable location. Right now, many of them are here:
mu_plus/UefiTestingPkg at release/202102 · microsoft/mu_plus 
(github.com)

- Bret

From: Nelson, Eric via groups.io
Sent: Wednesday, June 23, 2021 3:38 PM
To: Samer El-Haj-Mahmoud; G Edhaya 
Chandran; 
gao...@byosoft.com.cn; 
devel@edk2.groups.io; Kinney, Michael 
D
Subject: [EXTERNAL] Re: [edk2-devel] Proposing a new area of the edk2-test 
repository


I have created a few other internal apps that build under WinTestPkg, although 
ResumeOK.efi is the only one I have received permissions to release sources for 
at this time.
And yes, they are primarily intended for validating Windows requirements.
I had some issues with my apps, needing to use different libraries than 
MdeModulePkg, and found it easier to create my own package, and use the libs I 
want.

__e


From: Samer El-Haj-Mahmoud 
mailto:samer.el-haj-mahm...@arm.com>>
Sent: Wednesday, June 23, 2021 1:56 PM
To: Nelson, Eric mailto:eric.nel...@intel.com>>; G 
Edhaya Chandran mailto:edhaya.chand...@arm.com>>; 
gao...@byosoft.com.cn; 
devel@edk2.groups.io
Cc: Samer El-Haj-Mahmoud 
mailto:samer.el-haj-mahm...@arm.com>>
Subject: RE: Proposing a new area of the edk2-test repository

+edk2 list

I am not against adding additional test tools to edk2-test. Just feel like 
there is a need to organize and have a strategy, rather than just use edk2-test 
as a dumping group of miscellaneous tools.

There is already a place for apps under 
https://github.com/

Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib

2021-08-04 Thread Bret Barkelew via groups.io
Poking this one.


  1.  It’s a easy review with small, obvious code change.
  2.  I need some answers on “when is it okay to violate ECC/PatchCheck, if the 
new code matches the style of the existing code. Should I endeavor to pass the 
PatchCheck and ECCCheck with this patch only, and leave it in conflict with the 
rest of the file?

Thanks!

- Bret

From: Bret Barkelew via groups.io<mailto:bret.barkelew=microsoft@groups.io>
Sent: Friday, July 30, 2021 11:08 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
b...@corthon.com<mailto:b...@corthon.com>
Cc: Yao, Jiewen<mailto:jiewen@intel.com>; Jian J 
Wang<mailto:jian.j.w...@intel.com>; Qi Zhang<mailto:qi1.zh...@intel.com>; Rahul 
Kumar<mailto:rahul1.ku...@intel.com>
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib

Note, even though this keeps with the style of the rest of the file, it breaks 
ECC:
SecurityPkg/Library: Add Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib by 
corthon · Pull Request #1848 · tianocore/edk2 
(github.com)<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fpull%2F1848&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C54f6a1acc6bb476e2ecb08d953850ece%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637632653231745775%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=FsjyOQ%2FlBlbUlCBndVhxVbROhW%2Bd66q2g4m63sBg%2BHc%3D&reserved=0>

PROGRESS - --Running SecurityPkg: EccCheck Test NO-TARGET --
ERROR -
ERROR -
ERROR - EFI coding style error
ERROR - *Error code: 8001
ERROR - *Only capital letters are allowed to be used for #define declarations
ERROR - *file: 
//home/vsts/work/1/s/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
ERROR - *Line number: 27
ERROR - *The #define name [RC_NV_UndefineSpaceSpecial_nvIndex] does no

Thoughts?

- Bret

From: Bret Barkelew via groups.io<mailto:bret=corthon@groups.io>
Sent: Friday, July 30, 2021 10:55 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Yao, Jiewen<mailto:jiewen@intel.com>; Jian J 
Wang<mailto:jian.j.w...@intel.com>; Qi Zhang<mailto:qi1.zh...@intel.com>; Rahul 
Kumar<mailto:rahul1.ku...@intel.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib

Used to provision and maintain certain HW-defined NV spaces.

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2994&data=04%7C01%7CBret.Barkelew%40microsoft.com%7Cb7ae3c62047c48fc85d908d953833ca0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637632645397602953%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=s96M3RvxMOY831Vfr1nt%2Fz1h3cyb6jU9eFzvjKO7Dtc%3D&reserved=0<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2994&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C54f6a1acc6bb476e2ecb08d953850ece%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637632653231755738%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=3Os5cZEtbmZ9h5Jz0Zz5er2gG%2FNO%2FSSmnqVGuoYiqdY%3D&reserved=0>

Signed-off-by: Bret Barkelew 
Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Qi Zhang 
Cc: Rahul Kumar 
---
 SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c | 122 
 SecurityPkg/Include/Library/Tpm2CommandLib.h   |  22 
 2 files changed, 144 insertions(+)

diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c 
b/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
index 87572de20164..7931fade9190 100644
--- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
+++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
@@ -24,6 +24,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define RC_NV_UndefineSpace_authHandle  (TPM_RC_H + TPM_RC_1)

 #define RC_NV_UndefineSpace_nvIndex (TPM_RC_H + TPM_RC_2)



+#define RC_NV_UndefineSpaceSpecial_nvIndex  (TPM_RC_H + TPM_RC_1)

+

 #define RC_NV_Read_authHandle   (TPM_RC_H + TPM_RC_1)

 #define RC_NV_Read_nvIndex  (TPM_RC_H + TPM_RC_2)

 #define RC_NV_Read_size (TPM_RC_P + TPM_RC_1)

@@ -74,6 +76,20 @@ typedef struct {
   TPMS_AUTH_RESPONSE AuthSession;

 } TPM2_NV_UNDEFINESPACE_RESPONSE;



+typedef struct {

+  TPM2_COMMAND_HEADER   Header;

+  TPMI_RH_NV_INDEX  NvIndex;

+  TPMI_RH_PLATFORM  Platform;

+  UINT32AuthSessionSize;

+  TPMS_AUTH_COMMAND AuthSession;

+} TPM2_NV_UNDEFINESPACESPECIAL_COMMAND;

+

+typedef struct {

+  TPM2_RESPONSE_HEADER   Header;

+  UINT32 AuthSessionSize;

+  TPMS_AUTH_RESPONSE AuthSessi

Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib

2021-08-11 Thread Bret Barkelew via groups.io
Thoughts?

- Bret


From: devel@edk2.groups.io  on behalf of Bret Barkelew 
via groups.io 
Sent: Wednesday, August 4, 2021 9:32:32 AM
To: devel@edk2.groups.io ; b...@corthon.com 

Cc: Yao, Jiewen ; Jian J Wang ; Qi 
Zhang ; Rahul Kumar 
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib


Poking this one.



  1.  It’s a easy review with small, obvious code change.
  2.  I need some answers on “when is it okay to violate ECC/PatchCheck, if the 
new code matches the style of the existing code. Should I endeavor to pass the 
PatchCheck and ECCCheck with this patch only, and leave it in conflict with the 
rest of the file?



Thanks!



- Bret



From: Bret Barkelew via groups.io<mailto:bret.barkelew=microsoft@groups.io>
Sent: Friday, July 30, 2021 11:08 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
b...@corthon.com<mailto:b...@corthon.com>
Cc: Yao, Jiewen<mailto:jiewen@intel.com>; Jian J 
Wang<mailto:jian.j.w...@intel.com>; Qi Zhang<mailto:qi1.zh...@intel.com>; Rahul 
Kumar<mailto:rahul1.ku...@intel.com>
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib



Note, even though this keeps with the style of the rest of the file, it breaks 
ECC:

SecurityPkg/Library: Add Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib by 
corthon · Pull Request #1848 · tianocore/edk2 
(github.com)<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fpull%2F1848&data=04%7C01%7CBret.Barkelew%40microsoft.com%7Cfe8eb7e487664492e2cc08d957657978%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637636917288577969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=02RQYngWn6MoSWUvzakivPEZKpu%2BQ0QzV1oDnrxugno%3D&reserved=0>



PROGRESS - --Running SecurityPkg: EccCheck Test NO-TARGET --

ERROR -

ERROR -

ERROR - EFI coding style error

ERROR - *Error code: 8001

ERROR - *Only capital letters are allowed to be used for #define declarations

ERROR - *file: 
//home/vsts/work/1/s/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c

ERROR - *Line number: 27

ERROR - *The #define name [RC_NV_UndefineSpaceSpecial_nvIndex] does no



Thoughts?



- Bret



From: Bret Barkelew via groups.io<mailto:bret=corthon@groups.io>
Sent: Friday, July 30, 2021 10:55 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Yao, Jiewen<mailto:jiewen@intel.com>; Jian J 
Wang<mailto:jian.j.w...@intel.com>; Qi Zhang<mailto:qi1.zh...@intel.com>; Rahul 
Kumar<mailto:rahul1.ku...@intel.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib



Used to provision and maintain certain HW-defined NV spaces.

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2994&data=04%7C01%7CBret.Barkelew%40microsoft.com%7Cb7ae3c62047c48fc85d908d953833ca0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637632645397602953%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=s96M3RvxMOY831Vfr1nt%2Fz1h3cyb6jU9eFzvjKO7Dtc%3D&reserved=0<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2994&data=04%7C01%7CBret.Barkelew%40microsoft.com%7Cfe8eb7e487664492e2cc08d957657978%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637636917288587926%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=0A5MYpi%2FFRfhR3UMP9GoXcakIsXTDMwoMpnIiWM%2FaXc%3D&reserved=0>

Signed-off-by: Bret Barkelew 
Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Qi Zhang 
Cc: Rahul Kumar 
---
 SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c | 122 
 SecurityPkg/Include/Library/Tpm2CommandLib.h   |  22 
 2 files changed, 144 insertions(+)

diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c 
b/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
index 87572de20164..7931fade9190 100644
--- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
+++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
@@ -24,6 +24,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define RC_NV_UndefineSpace_authHandle  (TPM_RC_H + TPM_RC_1)

 #define RC_NV_UndefineSpace_nvIndex (TPM_RC_H + TPM_RC_2)



+#define RC_NV_UndefineSpaceSpecial_nvIndex  (TPM_RC_H + TPM_RC_1)

+

 #define RC_NV_Read_authHandle   (TPM_RC_H + TPM_RC_1)

 #define RC_NV_Read_nvIndex  (TPM_RC_H + TPM_RC_2)

 #define RC_NV_Read_size (TPM_RC_P + TPM_RC_1)

@@ -74,6 +76,20 @@ typedef struct {
   TPMS_AUTH_RESPONSE AuthSession;

 } TPM2_NV_UNDEFINESPACE_RESPONSE;



+typede

Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib

2021-08-12 Thread Bret Barkelew via groups.io
Thoughts?

- Bret


From: devel@edk2.groups.io  on behalf of Bret Barkelew 
via groups.io 
Sent: Wednesday, August 11, 2021 12:37:52 PM
To: devel@edk2.groups.io ; b...@corthon.com 

Cc: Yao, Jiewen ; Jian J Wang ; Qi 
Zhang ; Rahul Kumar 
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib


Thoughts?



- Bret




From: devel@edk2.groups.io  on behalf of Bret Barkelew 
via groups.io 
Sent: Wednesday, August 4, 2021 9:32:32 AM
To: devel@edk2.groups.io ; b...@corthon.com 

Cc: Yao, Jiewen ; Jian J Wang ; Qi 
Zhang ; Rahul Kumar 
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib


Poking this one.



  1.  It’s a easy review with small, obvious code change.
  2.  I need some answers on “when is it okay to violate ECC/PatchCheck, if the 
new code matches the style of the existing code. Should I endeavor to pass the 
PatchCheck and ECCCheck with this patch only, and leave it in conflict with the 
rest of the file?



Thanks!



- Bret



From: Bret Barkelew via groups.io<mailto:bret.barkelew=microsoft@groups.io>
Sent: Friday, July 30, 2021 11:08 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
b...@corthon.com<mailto:b...@corthon.com>
Cc: Yao, Jiewen<mailto:jiewen@intel.com>; Jian J 
Wang<mailto:jian.j.w...@intel.com>; Qi Zhang<mailto:qi1.zh...@intel.com>; Rahul 
Kumar<mailto:rahul1.ku...@intel.com>
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib



Note, even though this keeps with the style of the rest of the file, it breaks 
ECC:

SecurityPkg/Library: Add Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib by 
corthon · Pull Request #1848 · tianocore/edk2 
(github.com)<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fpull%2F1848&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Cba78a3e7f9c74b56180308d95cff85ac%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637643074816403966%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=W6%2FZUYQmTc5I6ks8woDCoBw%2FtTmYrNn79jtLB8fEeYE%3D&reserved=0>



PROGRESS - --Running SecurityPkg: EccCheck Test NO-TARGET --

ERROR -

ERROR -

ERROR - EFI coding style error

ERROR - *Error code: 8001

ERROR - *Only capital letters are allowed to be used for #define declarations

ERROR - *file: 
//home/vsts/work/1/s/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c

ERROR - *Line number: 27

ERROR - *The #define name [RC_NV_UndefineSpaceSpecial_nvIndex] does no



Thoughts?



- Bret



From: Bret Barkelew via groups.io<mailto:bret=corthon@groups.io>
Sent: Friday, July 30, 2021 10:55 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Yao, Jiewen<mailto:jiewen@intel.com>; Jian J 
Wang<mailto:jian.j.w...@intel.com>; Qi Zhang<mailto:qi1.zh...@intel.com>; Rahul 
Kumar<mailto:rahul1.ku...@intel.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib



Used to provision and maintain certain HW-defined NV spaces.

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2994&data=04%7C01%7CBret.Barkelew%40microsoft.com%7Cb7ae3c62047c48fc85d908d953833ca0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637632645397602953%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=s96M3RvxMOY831Vfr1nt%2Fz1h3cyb6jU9eFzvjKO7Dtc%3D&reserved=0<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2994&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Cba78a3e7f9c74b56180308d95cff85ac%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637643074816413922%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=AaKL%2BDQTryN6x9nNVyvMDuV%2B04EkYV%2BVYuXC2aVw4n4%3D&reserved=0>

Signed-off-by: Bret Barkelew 
Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Qi Zhang 
Cc: Rahul Kumar 
---
 SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c | 122 
 SecurityPkg/Include/Library/Tpm2CommandLib.h   |  22 
 2 files changed, 144 insertions(+)

diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c 
b/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
index 87572de20164..7931fade9190 100644
--- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
+++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
@@ -24,6 +24,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define RC_NV_UndefineSpace_authHandle  (TPM_RC_H + TPM_RC_1)

 #define RC_NV_UndefineSpace_nvIndex (TPM_RC_H + TPM_RC_2)



Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib

2021-08-12 Thread Bret Barkelew via groups.io
+ @Kinney, Michael D<mailto:michael.d.kin...@intel.com>

Mike, any thoughts on when “sticking with the file convention” breaks ECC? 
Should I just ignore the rest of the file and pass ECC at all costs?

- Bret

From: Yao, Jiewen<mailto:jiewen@intel.com>
Sent: Thursday, August 12, 2021 5:06 PM
To: Bret Barkelew<mailto:bret.barke...@microsoft.com>; 
devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
b...@corthon.com<mailto:b...@corthon.com>
Cc: Wang, Jian J<mailto:jian.j.w...@intel.com>; Zhang, 
Qi1<mailto:qi1.zh...@intel.com>; Kumar, Rahul1<mailto:rahul1.ku...@intel.com>
Subject: RE: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib

I don’t know the answer about ECC or PatchChecker.
I  just know we need pass CI to merge the patch.

Thank you
Yao Jiewen

From: Bret Barkelew 
Sent: Friday, August 13, 2021 1:52 AM
To: devel@edk2.groups.io; b...@corthon.com
Cc: Yao, Jiewen ; Wang, Jian J ; 
Zhang, Qi1 ; Kumar, Rahul1 
Subject: RE: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib

Thoughts?

- Bret


From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>> on behalf of Bret Barkelew 
via groups.io 
mailto:bret.barkelew=microsoft@groups.io>>
Sent: Wednesday, August 11, 2021 12:37:52 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>>; 
b...@corthon.com<mailto:b...@corthon.com> 
mailto:b...@corthon.com>>
Cc: Yao, Jiewen mailto:jiewen@intel.com>>; Jian J 
Wang mailto:jian.j.w...@intel.com>>; Qi Zhang 
mailto:qi1.zh...@intel.com>>; Rahul Kumar 
mailto:rahul1.ku...@intel.com>>
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib


Thoughts?



- Bret



From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>> on behalf of Bret Barkelew 
via groups.io 
mailto:bret.barkelew=microsoft@groups.io>>
Sent: Wednesday, August 4, 2021 9:32:32 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>>; 
b...@corthon.com<mailto:b...@corthon.com> 
mailto:b...@corthon.com>>
Cc: Yao, Jiewen mailto:jiewen@intel.com>>; Jian J 
Wang mailto:jian.j.w...@intel.com>>; Qi Zhang 
mailto:qi1.zh...@intel.com>>; Rahul Kumar 
mailto:rahul1.ku...@intel.com>>
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib


Poking this one.



  1.  It’s a easy review with small, obvious code change.
  2.  I need some answers on “when is it okay to violate ECC/PatchCheck, if the 
new code matches the style of the existing code. Should I endeavor to pass the 
PatchCheck and ECCCheck with this patch only, and leave it in conflict with the 
rest of the file?



Thanks!



- Bret



From: Bret Barkelew via groups.io<mailto:bret.barkelew=microsoft@groups.io>
Sent: Friday, July 30, 2021 11:08 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
b...@corthon.com<mailto:b...@corthon.com>
Cc: Yao, Jiewen<mailto:jiewen@intel.com>; Jian J 
Wang<mailto:jian.j.w...@intel.com>; Qi Zhang<mailto:qi1.zh...@intel.com>; Rahul 
Kumar<mailto:rahul1.ku...@intel.com>
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib



Note, even though this keeps with the style of the rest of the file, it breaks 
ECC:

SecurityPkg/Library: Add Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib by 
corthon · Pull Request #1848 · tianocore/edk2 
(github.com)<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fpull%2F1848&data=04%7C01%7CBret.Barkelew%40microsoft.com%7Ce90f066a5a8c4feae73108d95dee3ec3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637644100117879377%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=7uX%2FX1sJDbWsxeqYtqfQIFXBbDRVnii7kcJ1nri65T4%3D&reserved=0>



PROGRESS - --Running SecurityPkg: EccCheck Test NO-TARGET --

ERROR -

ERROR -

ERROR - EFI coding style error

ERROR - *Error code: 8001

ERROR - *Only capital letters are allowed to be used for #define declarations

ERROR - *file: 
//home/vsts/work/1/s/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c

ERROR - *Line number: 27

ERROR - *The #define name [RC_NV_UndefineSpaceSpecial_nvIndex] does no



Thoughts?



- Bret



From: Bret Barkelew via groups.io<mailto:bret=corthon@groups.io>
Sent: Friday, July 30, 2021 10:55 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Yao, Jiewen<mailto:jiewen@intel.com>; Jian J 
Wang<mailto:jian.j.w...@intel.com>; Qi Zhang<m

Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib

2021-08-12 Thread Bret Barkelew via groups.io
Thanks, Jiewen! I’ll make those changes!

- Bret

From: Yao, Jiewen 
Sent: Thursday, August 12, 2021 7:47:04 PM
To: devel@edk2.groups.io ; Yao, Jiewen 
; gaolim...@byosoft.com.cn ; 
Bret Barkelew ; b...@corthon.com 
; Kinney, Michael D 
Cc: Wang, Jian J ; Zhang, Qi1 ; 
Kumar, Rahul1 
Subject: RE: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib


Hi Bret

Since it took much long time to get ECC feedback than I expected, I would give 
feedback on code while we are waiting.



1) Please confirm how you test the code, such as Microsoft platform ?

2) Please remove “+} // Tpm2NvUndefineSpaceSpecial()” at the end of the 
function. We do not use that style in other code.

3) Please copy the definition from TPM spec “This command allows removal of a 
platform-created NV Index that has TPMA_NV_POLICY_DELETE SET” to the function 
header description. The current one “This command removes an index from the 
TPM.” is for TPM2_NV_UndefineSpace instead of TPM2_NV_UndefineSpaceSpecial.



Since above comment does not impact any function, I would like to give RB.



With about change, reviewed-by: Jiewen Yao 



Thank you

Yao Jiewen



From: Bret Barkelew via groups.io<mailto:bret.barkelew=microsoft@groups.io>
Sent: Friday, July 30, 2021 11:08 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
b...@corthon.com<mailto:b...@corthon.com>
Cc: Yao, Jiewen<mailto:jiewen@intel.com>; Jian J 
Wang<mailto:jian.j.w...@intel.com>; Qi Zhang<mailto:qi1.zh...@intel.com>; Rahul 
Kumar<mailto:rahul1.ku...@intel.com>
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib



Note, even though this keeps with the style of the rest of the file, it breaks 
ECC:

SecurityPkg/Library: Add Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib by 
corthon · Pull Request #1848 · tianocore/edk2 
(github.com)<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fpull%2F1848&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C887b6ef599664679e21808d95e04a428%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637644196321232497%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1TMpHKJ9Mwh6VW4fBAjs0Cf2hIqcmbtDfNqsJY47z5U%3D&reserved=0>



PROGRESS - --Running SecurityPkg: EccCheck Test NO-TARGET --

ERROR -

ERROR -

ERROR - EFI coding style error

ERROR - *Error code: 8001

ERROR - *Only capital letters are allowed to be used for #define declarations

ERROR - *file: 
//home/vsts/work/1/s/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c

ERROR - *Line number: 27

ERROR - *The #define name [RC_NV_UndefineSpaceSpecial_nvIndex] does no



Thoughts?



- Bret



From: Bret Barkelew via groups.io<mailto:bret=corthon@groups.io>
Sent: Friday, July 30, 2021 10:55 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Yao, Jiewen<mailto:jiewen@intel.com>; Jian J 
Wang<mailto:jian.j.w...@intel.com>; Qi Zhang<mailto:qi1.zh...@intel.com>; Rahul 
Kumar<mailto:rahul1.ku...@intel.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] SecurityPkg/Library: Add 
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib



Used to provision and maintain certain HW-defined NV spaces.

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2994&data=04%7C01%7CBret.Barkelew%40microsoft.com%7Cb7ae3c62047c48fc85d908d953833ca0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637632645397602953%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=s96M3RvxMOY831Vfr1nt%2Fz1h3cyb6jU9eFzvjKO7Dtc%3D&reserved=0<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2994&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C887b6ef599664679e21808d95e04a428%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637644196321232497%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=q%2FGqsG776H1TD9bqGRw8ihZNDnJscXK0dwzEVGCNYf0%3D&reserved=0>

Signed-off-by: Bret Barkelew 
mailto:bret.barke...@microsoft.com>>
Cc: Jiewen Yao mailto:jiewen@intel.com>>
Cc: Jian J Wang mailto:jian.j.w...@intel.com>>
Cc: Qi Zhang mailto:qi1.zh...@intel.com>>
Cc: Rahul Kumar mailto:rahul1.ku...@intel.com>>
---
 SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c | 122 
 SecurityPkg/Include/Library/Tpm2CommandLib.h   |  22 
 2 files changed, 144 insertions(+)

diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c 
b/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
index 87572de20164..7931fade9190 100644
--- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
+++

Re: [edk2-devel] [edk2-platforms] [PATCH v2 0/4] Add Large Variable Libraries

2021-04-05 Thread Bret Barkelew via groups.io
Naïve question: if max variable size is not already configurable, why not just 
do that?

- Bret

From: Oram, Isaac W via groups.io
Sent: Monday, April 5, 2021 12:27 PM
To: Desimone, Nathaniel L; 
devel@edk2.groups.io
Cc: Chiu, Chasel; Liming 
Gao; Dong, Eric; 
Michael Kubacki
Subject: [EXTERNAL] Re: [edk2-devel] [edk2-platforms] [PATCH v2 0/4] Add Large 
Variable Libraries

Series Reviewed-by: Isaac Oram 

-Original Message-
From: Desimone, Nathaniel L 
Sent: Sunday, April 4, 2021 2:41 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel ; Liming Gao 
; Dong, Eric ; Michael Kubacki 
; Oram, Isaac W 
Subject: [edk2-platforms] [PATCH v2 0/4] Add Large Variable Libraries

Changes from V1:
 - Changed prefix from "Min" to "VarLib"
 - Better comments
 - Added more whitespace for readability
 - Removed unused INF sections
 - Better debug messages

This patch series introduces libaries that enable large data sets to be stored 
using the UEFI Variable Services. At present, most UEFI Variable Services 
implementations have a maximum variable size of <=64KB. The exact value varies 
depending on platform.

These libaries enable a data set to use as much space as needed, up to the 
remaining space in the UEFI Variable non-volatile storage.

To implement this, I have broken the problem down into two parts:

 1. Phase angostic UEFI Variable access.
 2. Storage of data across multiple UEFI Variables.

For the first part, I have created two new LibraryClasses:
VariableReadLib and VariableWriteLib. I have provided implementation instances 
of VariableReadLib for PEI, DXE, and SMM.
For VariableWriteLib, I have provided implementation instances for DXE and SMM. 
This enables code that accesses UEFI variables to be written in a matter than 
is phase agnostic, so the same code can be used in PEI, DXE, or SMM without 
modification.

The second part involves another two new LibaryClasses:
LargeVariableReadLib and LargeVariableWriteLib. Only one BASE implementation is 
needed for both of these as the phase dependent code was seperated out in the 
first piece. These libraries provide logic to calculate the maximum size of an 
individual UEFI variable and split the data into as many smaller pieces as 
needed to store the entire data set in the UEFI Variable storage. They also 
provide the ability to stitch the data back together when it is read.
Deleting the data will delete all variables used to store it.

Cc: Chasel Chiu 
Cc: Liming Gao 
Cc: Eric Dong 
Cc: Michael Kubacki 
Cc: Isaac Oram 
Signed-off-by: Nate DeSimone 

Nate DeSimone (4):
  MinPlatformPkg: Add VariableReadLib
  MinPlatformPkg: Add VariableWriteLib
  MinPlatformPkg: Add LargeVariableReadLib
  MinPlatformPkg: Add LargeVariableWriteLib

 .../Include/Dsc/CoreCommonLib.dsc |   6 +-
 .../MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc |  12 +-
 .../MinPlatformPkg/Include/Dsc/CorePeiLib.dsc |   9 +-
 .../Include/Library/LargeVariableReadLib.h|  50 ++
 .../Include/Library/LargeVariableWriteLib.h   |  58 +++
 .../Include/Library/VariableReadLib.h |  87 
 .../Include/Library/VariableWriteLib.h| 129 +
 .../BaseLargeVariableReadLib.inf  |  44 ++
 .../LargeVariableReadLib.c| 199 
 .../BaseLargeVariableWriteLib.inf |  44 ++
 .../LargeVariableWriteLib.c   | 479 ++
 .../DxeRuntimeVariableReadLib.c   | 115 +
 .../DxeRuntimeVariableReadLib.inf |  41 ++
 .../DxeRuntimeVariableWriteLib.c  | 256 ++
 .../DxeRuntimeVariableWriteLib.inf|  49 ++
 .../PeiVariableReadLib/PeiVariableReadLib.c   | 153 ++
 .../PeiVariableReadLib/PeiVariableReadLib.inf |  42 ++
 .../SmmVariableReadCommon.c   | 114 +
 .../StandaloneMmVariableReadLib.inf   |  50 ++
 .../StandaloneMmVariableReadLibConstructor.c  |  48 ++
 .../TraditionalMmVariableReadLib.inf  |  49 ++
 .../TraditionalMmVariableReadLibConstructor.c |  48 ++
 .../SmmVariableWriteCommon.c  | 167 ++
 .../StandaloneMmVariableWriteLib.inf  |  45 ++
 .../StandaloneMmVariableWriteLibConstructor.c |  48 ++
 .../TraditionalMmVariableWriteLib.inf |  44 ++
 ...TraditionalMmVariableWriteLibConstructor.c |  48 ++
 .../Intel/MinPlatformPkg/MinPlatformPkg.dsc   |   4 +-
 28 files changed, 2428 insertions(+), 10 deletions(-)  create mode 100644 
Platform/Intel/MinPlatformPkg/Include/Library/LargeVariableReadLib.h
 create mode 100644 
Platform/Intel/MinPlatformPkg/Include/Library/LargeVariableWriteLib.h
 create mode 100644 
Platform/Intel/MinPlatformPkg/Include/Library/VariableReadLib.h
 create mode 100644 
Platform/Intel/MinPlatformPkg/Include/Library/VariableWriteLib.h
 create mod

Re: [EXTERNAL] Re: [edk2-devel] [GSoC proposal] Secure Image Loader

2021-04-06 Thread Bret Barkelew via groups.io
You’ve got my vote! This sounds amazing!

- Bret

From: Marvin Häuser via groups.io
Sent: Tuesday, April 6, 2021 3:10 AM
To: devel@edk2.groups.io; Desimone, Nathaniel 
L; Laszlo 
Ersek; Andrew Fish; Kinney, 
Michael D
Subject: [EXTERNAL] Re: [edk2-devel] [GSoC proposal] Secure Image Loader

Good day Nate,

Comments are inline.

Best regards,
Marvin

On 06.04.21 11:41, Nate DeSimone wrote:
> Hi Marvin,
>
> Great to meet you and welcome back! Glad you hear you are interested! 
> Completing a formal verification of a PE/COFF loader is certainly impressive. 
> Was this done with some sort of automated theorem proving? It would seem a 
> rather arduous task doing an inductive proof for an algorithm like that by 
> hand!

I would call it "semi-automated", a great deal of intermediate goals
(preconditions, postconditions, invariants, assertions, ...) were
required to show all interesting properties. But yes, the actual proof
steps are automated by common SMT solvers. It was done using the
AstraVer Toolset and ACSL, latter basically a language to express logic
statements with C-like syntax.

> I completely agree with you that getting a formally verified PE/COFF loader 
> into mainline is undoubtably valuable and would pay security dividends for 
> years to come.

I'm glad to hear that. :)

> Admittedly, this is an area of computer science that I don't have a great 
> deal of experience with. The furthest I have gone on this topic is writing 
> out proofs for simple algorithms on exams in my Algorithms class in college. 
> Regardless you have a much better idea of what the current status is of the 
> work that you and Vitaly have done. I guess my only question is do you think 
> there is sufficient work remaining to fill the 10 week GSoC development 
> window?

Please don't get me wrong, but I would be surprised if the UEFI
specification changes I'd like to discuss alone would be completed
within 10 weeks, let alone implementation throughout the codebase. While
I think the plain amount of code may be a bit less than say a
MinPlatform port, the changes are much deeper and require much more
caution to avoid regressions (e.g. by invalidating undocumented
assertions). This sadly is not a matter of just replacing the underlying
library implementation or "plug-in and play" at all. It furthermore
affects many parts of the stack, the core dispatchers used for all
platforms, image emulation (EBC), UEFI userland emulation (EmuPkg), and
so on. I was rather worried the scope is too broad time-wise, but it can
be narrowed/widened as you see fit really. This is one of *the* core
components used on millions of device, and many package maintainers need
to review and validate the changes, this must really be done right the
first try. :)

> Certainly we can use some of that time to perform the code reviews you 
> mention and write up formal ECRs for the UEFI spec changes that you believe 
> are needed.

I believed that was part of the workload, yes, but even without it I
think there is plenty to do.

> Thank you for sending the application and alerting us to the great work you 
> and Vitaly have done! I'll read your paper more closely and come back with 
> any questions I still have.

Thank you, I will gladly explain anything unclear. Just try to not give
Laszlo too many flashbacks. :)

>
> With Best Regards,
> Nate
>
>> -Original Message-
>> From: devel@edk2.groups.io  On Behalf Of Marvin
>> Häuser
>> Sent: Sunday, April 4, 2021 4:02 PM
>> To: devel@edk2.groups.io; Laszlo Ersek ; Andrew Fish
>> ; Kinney, Michael D 
>> Subject: [edk2-devel] [GSoC proposal] Secure Image Loader
>>
>> Good day everyone,
>>
>> I'll keep the introduction brief because I've been around for a while now. 
>> :) I'm
>> Marvin Häuser, a third-year Computer Science student from TU Kaiserslautern,
>> Germany. Late last year, my colleague Vitaly from ISP RAS and me introduced a
>> formally verified Image Loader for UEFI usage at ISP RAS Open[1] due to 
>> various
>> defects we outlined in the corresponding paper. Thank you once again Laszlo
>> for your *incredible* review work on the publication part.
>>
>> I now want to make an effort to mainline it, preferably as part of the 
>> current
>> Google Summer of Code event. To be clear, my internship at ISP RAS has
>> concluded, and while Vitaly will be available for design discussion, he has 
>> other
>> priorities at the moment and the practical part will be on me. I have 
>> previously
>> submitted a proposal via the GSoC website for your review.
>>
>> There are many things to consider:
>> 1. The Image Loader is a core component, and there needs to be a significant
>> level of quality and security assurance.
>> 2. Being consumed by many packages, the proposed patch set will take a lot of
>> time to review and integrate

Re: [EXTERNAL] [edk2-devel] [PATCH 1/1] BaseTools/Ecc: Update structpcd parsing method.

2021-04-08 Thread Bret Barkelew via groups.io
Ah! Gotcha. I missed that this was specific to ECC. Thanks!

- Bret

From: Chen, Christine
Sent: Wednesday, April 7, 2021 6:42 PM
To: Bret Barkelew; 
devel@edk2.groups.io
Cc: Liang, MingyueX; Feng, Bob 
C; Liming Gao
Subject: RE: [EXTERNAL] [edk2-devel] [PATCH 1/1] BaseTools/Ecc: Update 
structpcd parsing method.


Hi Bret,



This patch adds the ECC check for structurePcd written in des/dsc file, as the 
origin check is only for non-structured Pcd.



Best Regards,

Yuwei (Christine)

From: Bret Barkelew 
Sent: Friday, April 2, 2021 12:43 AM
To: devel@edk2.groups.io; Chen, Christine 
Cc: Liang, MingyueX ; Feng, Bob C 
; Liming Gao 
Subject: RE: [EXTERNAL] [edk2-devel] [PATCH 1/1] BaseTools/Ecc: Update 
structpcd parsing method.

What does “update” mean in this context? What behavior is changing?

- Bret

From: Yuwei Chen via groups.io
Sent: Thursday, April 1, 2021 12:04 AM
To: devel@edk2.groups.io
Cc: mliang2x; Feng, Bob 
C; Liming Gao
Subject: [EXTERNAL] [edk2-devel] [PATCH 1/1] BaseTools/Ecc: Update structpcd 
parsing method.

From: mliang2x mailto:mingyuex.li...@intel.com>>

Update the pcdparser method in Dec and DSC files.

Signed-off-by: Mingyue Liang 
mailto:mingyuex.li...@intel.com>>
Cc: Bob Feng mailto:bob.c.f...@intel.com>>
Cc: Liming Gao mailto:gaolim...@byosoft.com.cn>>
Cc: Yuwei Chen mailto:yuwei.c...@intel.com>>
---
 .../Ecc/MetaFileWorkspace/MetaFileParser.py   | 464 ++
 1 file changed, 265 insertions(+), 199 deletions(-)

diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py 
b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
index 9c27c8e16a05..588d3dbe6ed5 100644
--- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
@@ -22,7 +22,7 @@ import Ecc.EccToolError as EccToolError
 from CommonDataClass.DataClass import *
 from Common.DataType import *
 from Common.StringUtils import *
-from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, 
PathClass, AnalyzePcdData
+from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, 
PathClass, AnalyzePcdData, AnalyzeDscPcd, AnalyzePcdExpression, 
ParseFieldValue, StructPattern
 from Common.Expression import *
 from CommonDataClass.Exceptions import *

@@ -31,6 +31,8 @@ from GenFds.FdfParser import FdfParser
 from Common.LongFilePathSupport import OpenLongFilePath as open
 from Common.LongFilePathSupport import CodecOpenLongFilePath

+CODEPattern = re.compile(r"{CODE\([a-fA-F0-9Xx\{\},\s]*\)}")
+
 ## A decorator used to parse macro definition
 def ParseMacro(Parser):
 def MacroParser(self):
@@ -174,6 +176,11 @@ class MetaFileParser(object):
 # UNI object and extra UNI object
 self._UniObj = None
 self._UniExtraObj = None
+# StructPcd var
+self._PcdCodeValue = ""
+self._PcdDataTypeCODE = False
+self._CurrentPcdName = ""
+self._GuidDict = {}  # for Parser PCD value {GUID(gTokeSpaceGuidName)}

 ## Store the parsed data in table
 def _Store(self, *Args):
@@ -395,6 +402,40 @@ class MetaFileParser(object):
 Macros.update(self._SectionsMacroDict[(self._SectionType, 
Scope1, Scope2)])
 return Macros

+def ProcessMultipleLineCODEValue(self, Content):
+CODEBegin = False
+CODELine = ""
+continuelinecount = 0
+newContent = []
+for Index in range(0, len(Content)):
+Line = Content[Index]
+if CODEBegin:
+CODELine = CODELine + Line
+continuelinecount +=1
+if ")}" in Line:
+newContent.append(CODELine)
+for _ in range(continuelinecount):
+newContent.append("")
+CODEBegin = False
+CODELine = ""
+continuelinecount = 0
+else:
+if not Line:
+newContent.append(Line)
+continue
+if "{CODE(" not in Line:
+newContent.append(Line)
+continue
+elif CODEPattern.findall(Line):
+newContent.append(Line)
+continue
+else:
+CODEBegin = True
+CODELine = Line
+
+return newContent
+
+
 _SectionParser  = {}
 Finished= property(_GetFinished, _SetFinished)
 _Macros = property(_GetMacros)
@@ -812,6 +853,8 @@ class DscParser(MetaFileParser):
 Content = open(str(self.MetaFile

Re: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] MdeModulePkg: Initialize temp variable in VarCheckPolicyLib

2021-04-09 Thread Bret Barkelew via groups.io
+ @Liming Gao<mailto:gaolim...@byosoft.com.cn>

- Bret

From: Bret Barkelew via groups.io<mailto:bret=corthon@groups.io>
Sent: Friday, April 9, 2021 11:25 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Jian J Wang<mailto:jian.j.w...@intel.com>; Hao A 
Wu<mailto:hao.a...@intel.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH v1 1/1] MdeModulePkg: Initialize temp 
variable in VarCheckPolicyLib

DumpVariablePolicy() will return EFI_INVALID_PARAMETER if the Buffer
pointer is NULL and the indirect Size is anything but 0. Since this
TempSize was not being initialized it is very likely that this sequence
would not return the total buffer size as expected.

Bugzilla: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3310&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C3d2f574a01a048aed60708d8fb84dcbb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637535895350828079%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=j6KmN6jcwoGJlunjspLawLJtYqCwGWw18pXNZVMNdC8%3D&reserved=0

Cc: Jian J Wang 
Cc: Hao A Wu 
Signed-off-by: Bret Barkelew 
---
 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c 
b/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
index 14e1904e96d3..e50edb4ffc5a 100644
--- a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
+++ b/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
@@ -216,6 +216,7 @@ VarCheckPolicyLibMmiHandler (
 DumpParamsOut->TotalSize = 0;
 DumpParamsOut->PageSize = 0;
 DumpParamsOut->HasMore = FALSE;
+TempSize = 0;
 SubCommandStatus = DumpVariablePolicy (NULL, &TempSize);
 if (SubCommandStatus == EFI_BUFFER_TOO_SMALL && TempSize > 0) {
   mCurrentPaginationCommand = VAR_CHECK_POLICY_COMMAND_DUMP;
--
2.28.0.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73908): https://edk2.groups.io/g/devel/message/73908
Mute This Topic: https://groups.io/mt/81976547/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] Build Failed for QEMU35Pkg

2021-04-09 Thread Bret Barkelew via groups.io
It looks like a Python 3.8.x vs 3.9.x issue.

It looks as if you’re using Mu Q35 as your platform. Can you tell me what 
branch you’re on?

- Bret

From: Pandya, Shivanshi via 
groups.io
Sent: Friday, April 9, 2021 1:52 PM
To: devel@edk2.groups.io
Subject: [EXTERNAL] [edk2-devel] Build Failed for QEMU35Pkg

Hello,

Build failed with following call trace

build.py...
INFO -  : error C0DE: Unknown fatal error when processing 
[c:\bea\dfci\mu_tiano_platforms\Common\PRM\PrmPkg\Library\DxePrmModuleDiscoveryLib\DxePrmModuleDiscoveryLib.inf
 [X64, VS2017, DEBUG]]
INFO -
INFO - (Please send email to devel@edk2.groups.io for help, attaching following 
call stack trace!)
INFO -
INFO - (Python 3.9.0 on win32) Traceback (most recent call last):
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\build\build.py",
 line 2635, in Main
INFO - MyBuild.Launch()
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\build\build.py",
 line 2430, in Launch
INFO - self._MultiThreadBuildPlatform()
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\build\build.py",
 line 2238, in _MultiThreadBuildPlatform
INFO - Wa, self.BuildModules = self.PerformAutoGen(BuildTarget,ToolChain)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\build\build.py",
 line 2112, in PerformAutoGen
INFO - CmdListDict = self._GenFfsCmd(Wa.ArchList)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\build\build.py",
 line 2009, in _GenFfsCmd
INFO - GenFfsDict = GenFds.GenFfsMakefile('', GlobalData.gFdfParser, self, 
ArchList, GlobalData)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\GenFds\GenFds.py",
 line 541, in GenFfsMakefile
INFO - FdObj.GenFd(Flag=True)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\GenFds\Fd.py",
 line 131, in GenFd
INFO - RegionObj.AddToBuffer (FdBuffer, self.BaseAddress, 
self.BlockSizeList, self.ErasePolarity, GenFdsGlobalVariable.ImageBinDict, 
self.DefineVarDict, Flag=Flag)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\GenFds\Region.py",
 line 134, in AddToBuffer
INFO - FvObj.AddToBuffer(FvBuffer, FvBaseAddress, BlockSize, BlockNum, 
ErasePolarity, Flag=Flag)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\GenFds\Fv.py",
 line 127, in AddToBuffer
INFO - FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress, 
IsMakefile=Flag, FvName=self.UiFvName)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\GenFds\FfsInfStatement.py",
 line 518, in GenFfs
INFO - InputSectList, InputSectAlignments = 
self.__GenComplexFileSection__(Rule, FvChildAddr, FvParentAddr, 
IsMakefile=IsMakefile)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\GenFds\FfsInfStatement.py",
 line 969, in __GenComplexFileSection__
INFO - SectList, Align = Sect.GenSection(self.OutputPath, self.ModuleGuid, 
SecIndex, self.KeyStringList, self, IsMakefile = IsMakefile)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\GenFds\EfiSection.py",
 line 218, in GenSection
INFO - GenFdsGlobalVariable.GenerateSection(OutputFile, [], 
'EFI_SECTION_USER_INTERFACE',
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\GenFds\GenFdsGlobalVariable.py",
 line 466, in GenerateSection
INFO - SectionData.fromstring(Ui.encode("utf_16_le"))
INFO - AttributeError: 'array.array' object has no attribute 'fromstring'

Kind Regards,
Shivanshi




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73911): https://edk2.groups.io/g/devel/message/73911
Mute This Topic: https://groups.io/mt/81979611/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] Re: [edk2-devel] Build Failed for QEMU35Pkg

2021-04-09 Thread Bret Barkelew via groups.io
Andrew,
Not a scheme that I would consider a “good” scheme. You can see what we’re 
running CI against (in Mu and EDK, both), by checking for the  
“UsePythonVersion” command in the .azurepipelines/pr-gate-steps.yml file.

Shivanshi,
I just ran a build on my system with that exact version of Python (3.9.0). Did 
your build produce a “BUILD_TOOLS_REPORT.json” file? If so, can you send it?
Can you also send the exact command that you’re running when you see this issue?

Thanks!

- Bret

From: Andrew Fish<mailto:af...@apple.com>
Sent: Friday, April 9, 2021 4:54 PM
To: edk2-devel-groups-io<mailto:devel@edk2.groups.io>; Bret 
Barkelew<mailto:bret.barke...@microsoft.com>
Cc: shivanshi.pan...@dell.com<mailto:shivanshi.pan...@dell.com>
Subject: [EXTERNAL] Re: [edk2-devel] Build Failed for QEMU35Pkg




On Apr 9, 2021, at 1:55 PM, Bret Barkelew via 
groups.io<https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgroups.io%2F&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Cc0c71205832e466e29c908d8fbb2bde2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637536092399309810%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1%2FvcJqEl7TnYAHMADVwLYInwu9Ns2q63TLgQrA4WZ44%3D&reserved=0>
 
mailto:bret.barkelew=microsoft@groups.io>>
 wrote:

It looks like a Python 3.8.x vs 3.9.x issue.


Do we have a scheme to require a min Python version?

Thanks,

Andrew Fish


It looks as if you’re using Mu Q35 as your platform. Can you tell me what 
branch you’re on?

- Bret

From: Pandya, Shivanshi via 
groups.io<mailto:Shivanshi.Pandya=dell@groups.io>
Sent: Friday, April 9, 2021 1:52 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Subject: [EXTERNAL] [edk2-devel] Build Failed for QEMU35Pkg

Hello,

Build failed with following call trace

build.py...
INFO -  : error C0DE: Unknown fatal error when processing 
[c:\bea\dfci\mu_tiano_platforms\Common\PRM\PrmPkg\Library\DxePrmModuleDiscoveryLib\DxePrmModuleDiscoveryLib.inf
 [X64, VS2017, DEBUG]]
INFO -
INFO - (Please send email to devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
for help, attaching following call stack trace!)
INFO -
INFO - (Python 3.9.0 on win32) Traceback (most recent call last):
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\build\build.py",
 line 2635, in Main
INFO - MyBuild.Launch()
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\build\build.py",
 line 2430, in Launch
INFO - self._MultiThreadBuildPlatform()
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\build\build.py",
 line 2238, in _MultiThreadBuildPlatform
INFO - Wa, self.BuildModules = self.PerformAutoGen(BuildTarget,ToolChain)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\build\build.py",
 line 2112, in PerformAutoGen
INFO - CmdListDict = self._GenFfsCmd(Wa.ArchList)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\build\build.py",
 line 2009, in _GenFfsCmd
INFO - GenFfsDict = GenFds.GenFfsMakefile('', GlobalData.gFdfParser, self, 
ArchList, GlobalData)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\GenFds\GenFds.py",
 line 541, in GenFfsMakefile
INFO - FdObj.GenFd(Flag=True)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\GenFds\Fd.py",
 line 131, in GenFd
INFO - RegionObj.AddToBuffer (FdBuffer, self.BaseAddress, 
self.BlockSizeList, self.ErasePolarity, GenFdsGlobalVariable.ImageBinDict, 
self.DefineVarDict, Flag=Flag)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\GenFds\Region.py",
 line 134, in AddToBuffer
INFO - FvObj.AddToBuffer(FvBuffer, FvBaseAddress, BlockSize, BlockNum, 
ErasePolarity, Flag=Flag)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\GenFds\Fv.py",
 line 127, in AddToBuffer
INFO - FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress, 
IsMakefile=Flag, FvName=self.UiFvName)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\GenFds\FfsInfStatement.py",
 line 518, in GenFfs
INFO - InputSectList, InputSectAlignments = 
self.__GenComplexFileSection__(Rule, FvChildAddr, FvParentAddr, 
IsMakefile=IsMakefile)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\GenFds\FfsInfStatement.py",
 line 969, in __GenComplexFileSection__
INFO - SectList, Align = Sect.GenSection(self.OutputPath, self.ModuleGuid, 
SecIndex, self.KeyStringList, self, IsMakefile = IsMakefile)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\GenFds\EfiSection.py",
 line 218, in GenSection
INFO - G

Re: [edk2-devel] [PATCH v1 1/1] MdeModulePkg: Initialize temp variable in VarCheckPolicyLib

2021-04-12 Thread Bret Barkelew via groups.io
Looks like we have the requisite approvals. Shall I create a PR?

- Bret

From: Wu, Hao A via groups.io
Sent: Sunday, April 11, 2021 7:23 PM
To: Bret Barkelew; 
devel@edk2.groups.io
Cc: Wang, Jian J
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v1 1/1] MdeModulePkg: Initialize 
temp variable in VarCheckPolicyLib

> -Original Message-
> From: Bret Barkelew 
> Sent: Saturday, April 10, 2021 2:25 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J ; Wu, Hao A 
> Subject: [PATCH v1 1/1] MdeModulePkg: Initialize temp variable in
> VarCheckPolicyLib
>
> DumpVariablePolicy() will return EFI_INVALID_PARAMETER if the Buffer
> pointer is NULL and the indirect Size is anything but 0. Since this TempSize
> was not being initialized it is very likely that this sequence would not 
> return
> the total buffer size as expected.
>
> Bugzilla: 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3310&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Cdd597013a0874fa676f708d8fd5a02e2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637537910324146700%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=qxCQ6vccJFzG8gH9qDBHD9xnl%2FCs3DdVUuMtHspanfY%3D&reserved=0
>
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Signed-off-by: Bret Barkelew 
> ---
>  MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
> b/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
> index 14e1904e96d3..e50edb4ffc5a 100644
> --- a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
> +++ b/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c
> @@ -216,6 +216,7 @@ VarCheckPolicyLibMmiHandler (
>  DumpParamsOut->TotalSize = 0;
>  DumpParamsOut->PageSize = 0;
>  DumpParamsOut->HasMore = FALSE;
> +TempSize = 0;
>  SubCommandStatus = DumpVariablePolicy (NULL, &TempSize);


Reviewed-by: Hao A Wu 

Best Regards,
Hao Wu


>  if (SubCommandStatus == EFI_BUFFER_TOO_SMALL && TempSize > 0) {
>mCurrentPaginationCommand =
> VAR_CHECK_POLICY_COMMAND_DUMP;
> --
> 2.28.0.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73967): https://edk2.groups.io/g/devel/message/73967
Mute This Topic: https://groups.io/mt/81976395/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] [edk2-devel] Build Failed for QEMU35Pkg

2021-04-12 Thread Bret Barkelew via groups.io
To my knowledge, we do not currently have a required version; the current state 
is it either works or it doesn’t, and if it doesn’t it’s on you to figure that 
out from the failures.

I’m not opposed to adding one – if there’s interest. I’d have to think about 
the best place to add it. The idea of making it its own test is interesting. It 
wouldn’t prevent you from getting other test data, but it would let you know 
you aren’t on the ideal version and there may be unpredictable results. Ponder 
ponder…

- Bret

From: Andrew Fish<mailto:af...@apple.com>
Sent: Monday, April 12, 2021 9:27 AM
To: edk2-devel-groups-io<mailto:devel@edk2.groups.io>; Bret 
Barkelew<mailto:bret.barke...@microsoft.com>
Cc: shivanshi.pan...@dell.com<mailto:shivanshi.pan...@dell.com>
Subject: Re: [EXTERNAL] [edk2-devel] Build Failed for QEMU35Pkg




On Apr 9, 2021, at 6:33 PM, Bret Barkelew via 
groups.io<https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgroups.io%2F&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C6d96996208ff4e09af9b08d8fdcfe4ff%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637538416634242026%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=2Q27KOA7lPRrGvoT9s%2FyZ2A3R4B897iBiDuCj3zH3IU%3D&reserved=0>
 
mailto:bret.barkelew=microsoft@groups.io>>
 wrote:

Andrew,
Not a scheme that I would consider a “good” scheme. You can see what we’re 
running CI against (in Mu and EDK, both), by checking for the  
“UsePythonVersion” command in the .azurepipelines/pr-gate-steps.yml file.


Bret,

If I understand correctly the CI list is the recommended versions, but not the 
required versions. Do we have any concept of the required versions? I guess we 
could put a python assert to enforce min Python version? I guess we could be 
more aggressive on the required Python version (forces people to install a 
custom Python version for the edk2 build), or build a CI test that tests the 
min Python version for the tools...

Sorry mostly thinking out loud….

Thanks,

Andrew Fish



Shivanshi,
I just ran a build on my system with that exact version of Python (3.9.0). Did 
your build produce a “BUILD_TOOLS_REPORT.json” file? If so, can you send it?
Can you also send the exact command that you’re running when you see this issue?

Thanks!

- Bret

From: Andrew Fish<mailto:af...@apple.com>
Sent: Friday, April 9, 2021 4:54 PM
To: edk2-devel-groups-io<mailto:devel@edk2.groups.io>; Bret 
Barkelew<mailto:bret.barke...@microsoft.com>
Cc: shivanshi.pan...@dell.com<mailto:shivanshi.pan...@dell.com>
Subject: [EXTERNAL] Re: [edk2-devel] Build Failed for QEMU35Pkg





On Apr 9, 2021, at 1:55 PM, Bret Barkelew via 
groups.io<https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgroups.io%2F&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C6d96996208ff4e09af9b08d8fdcfe4ff%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637538416634251982%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=TDUsg4PF7O202XD6JQKQbzSIUB5C9d%2BZWknajLWg2j0%3D&reserved=0>
 
mailto:bret.barkelew=microsoft@groups.io>>
 wrote:

It looks like a Python 3.8.x vs 3.9.x issue.


Do we have a scheme to require a min Python version?

Thanks,

Andrew Fish



It looks as if you’re using Mu Q35 as your platform. Can you tell me what 
branch you’re on?

- Bret

From: Pandya, Shivanshi via 
groups.io<mailto:Shivanshi.Pandya=dell@groups.io>
Sent: Friday, April 9, 2021 1:52 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Subject: [EXTERNAL] [edk2-devel] Build Failed for QEMU35Pkg

Hello,

Build failed with following call trace

build.py...
INFO -  : error C0DE: Unknown fatal error when processing 
[c:\bea\dfci\mu_tiano_platforms\Common\PRM\PrmPkg\Library\DxePrmModuleDiscoveryLib\DxePrmModuleDiscoveryLib.inf
 [X64, VS2017, DEBUG]]
INFO -
INFO - (Please send email to devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
for help, attaching following call stack trace!)
INFO -
INFO - (Python 3.9.0 on win32) Traceback (most recent call last):
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\build\build.py",
 line 2635, in Main
INFO - MyBuild.Launch()
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\build\build.py",
 line 2430, in Launch
INFO - self._MultiThreadBuildPlatform()
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\build\build.py",
 line 2238, in _MultiThreadBuildPlatform
INFO - Wa, self.BuildModules = self.PerformAutoGen(BuildTarget,ToolChain)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASECORE\BaseTools\Source\Python\build\build.py",
 line 2112, in PerformAutoGen
INFO - CmdListDict = self._GenFfsCmd(Wa.ArchList)
INFO -   File 
"C:\BEA\DFCI\mu_tiano_platforms\MU_BASEC

Re: [EXTERNAL] Re: [edk2-devel] [GSoC proposal] Secure Image Loader

2021-04-12 Thread Bret Barkelew via groups.io
As always, we volunteer the UEFI Talkbox Discord for conversations of this 
nature. 😉

https://discord.gg/cuqjER3Juw

- Bret

From: Marvin Häuser via groups.io
Sent: Monday, April 12, 2021 10:24 AM
To: devel@edk2.groups.io; Desimone, Nathaniel 
L; Laszlo 
Ersek; Andrew Fish; Kinney, 
Michael D
Subject: [EXTERNAL] Re: [edk2-devel] [GSoC proposal] Secure Image Loader

Good day Nate,

As you seem to be mostly in charge of the GSoC side of things, I direct
this at you, but of course everyone is welcome to comment.

I think I finished my first round of investigations just in time for the
deadline. You can find a list of BZs attached[1]. Please note that 1)
some are declared security issues and may not be publicly accessible,
and 2) that this list is far from complete. I only added items that are
a) not implicitly fixed by "simply" deploying the new Image Loader
(*some* important prerequisites are listed), and b) I am confident are
actual issues (or things to consider) I believe to know how to approach.

I have taken notes about more things, e.g. the existence of the security
architectural protocols, which I could not find a rationale for. I can
prepare something for this matter, but it really needs an active
discussion with some of the core people. I'm not sure delayed e-mail
discussion is going to be enough, but there is an official IRC I
suppose. :) I hope we can work something out for this.

I also hope this makes it clearer why I don't believe that we need to
"fill" 10 weeks, but rather the opposite. This is not a matter of
replacing a library instance, but the whole surrounding ecosystem needs
to follow for the changes to make sense. And as I tried to make clear in
my discussion with Michael Brown, I am not keen on preserving
backwards-compatibility with platform code (i.e. PEI, DXE, things we
consider "internal"), as most of it should be controlled by EDK II
already. This of course does *not* include user code (OROMs,
bootloaders, ...), for which I want to provide the *option* to lock some
of them out for security, but with sane defaults that will ensure good
compatibility.

I'd like to thank Michael Brown for his cooperation and support, because
we recently landed changes in iPXE to allow for the strictest image
format and permission constraints currently possible[2].

I will have to rework the submitted proposal to reflect the new
knowledge. To be honest, seeing how the BZs kept rolling in, I am not
convinced an amazing amount of mainlining can be accomplished during the
10 weeks. It may have to suffice to have a publicly accessible prototype
(e.g. OVMF) and a subset of the planned patches on the list. I hope you
can manage to provide some feedback before the deadline passes tomorrow.

Thank you in advance!

Best regards,
Marvin

[1]
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3315&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C045c38141f1e443d1e4b08d8fdd78e23%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637538450446516854%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=xkAIi7yRQfRtw3pKELUzpb1oo9EN4kyroCdadjEzPLQ%3D&reserved=0
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3316&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C045c38141f1e443d1e4b08d8fdd78e23%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637538450446516854%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=cFAacXfo69cDMpxSggXjnVpoRqYdIj21QYg%2Ffo5jp9Y%3D&reserved=0
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3317&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C045c38141f1e443d1e4b08d8fdd78e23%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637538450446516854%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Ssf4h8yn3zee1IaK5%2BwI5WwvOvUW4gAtjikil0pS3Fw%3D&reserved=0
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3318&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C045c38141f1e443d1e4b08d8fdd78e23%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637538450446516854%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=2KKVA6qqHIP2skLSLXo56av1%2FS9pL1MMJbt%2FPI9BBPM%3D&reserved=0
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3319&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C045c38141f1e443d1e4b08d8fdd78e23%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637538450446516854%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTi

Re: [edk2-devel] [EXTERNAL] [PATCH v1 08/12] .pytool: Enable CI for ArmPkg

2021-04-26 Thread Bret Barkelew via groups.io
Reviewed by: Bret Barkelew 

- Bret

From: pierre.gond...@arm.com
Sent: Wednesday, April 21, 2021 5:21 AM
To: devel@edk2.groups.io; 
sami.muja...@arm.com; 
l...@nuviainc.com; 
ardb+tianoc...@kernel.org; Sean 
Brogan; Bret 
Barkelew
Subject: [EXTERNAL] [PATCH v1 08/12] .pytool: Enable CI for ArmPkg

From: Pierre Gondois 

Enable the CI for the ArmPkg.

Signed-off-by: Pierre Gondois 
---
 .pytool/CISettings.py | 3 ++-
 .pytool/Readme.md | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pytool/CISettings.py b/.pytool/CISettings.py
index 5f71eca1992e..6f7daeca076b 100644
--- a/.pytool/CISettings.py
+++ b/.pytool/CISettings.py
@@ -49,7 +49,8 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, 
SetupSettingsManag
 ''' return iterable of edk2 packages supported by this build.
 These should be edk2 workspace relative paths '''

-return ("ArmVirtPkg",
+return ("ArmPkg",
+"ArmVirtPkg",
 "DynamicTablesPkg",
 "EmulatorPkg",
 "MdePkg",
diff --git a/.pytool/Readme.md b/.pytool/Readme.md
index e158b2b81a34..cbce1f6cd54a 100644
--- a/.pytool/Readme.md
+++ b/.pytool/Readme.md
@@ -4,7 +4,7 @@

 | Package  | Windows VS2019 (IA32/X64)| Ubuntu GCC 
(IA32/X64/ARM/AARCH64) | Known Issues |
 | :| :-   | :  
   | :--- |
-| ArmPkg   |
+| ArmPkg   || :heavy_check_mark: |
 | ArmPlatformPkg   |
 | ArmVirtPkg   | SEE PACKAGE README | SEE PACKAGE README |
 | CryptoPkg| :heavy_check_mark: | :heavy_check_mark: | Spell 
checking in audit mode
--
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74429): https://edk2.groups.io/g/devel/message/74429
Mute This Topic: https://groups.io/mt/82389011/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [EXTERNAL] [PATCH v1 09/12] .pytool: Enable CI for ArmPlatformPkg

2021-04-26 Thread Bret Barkelew via groups.io
Reviewed by: Bret Barkelew 

- Bret

From: pierre.gond...@arm.com
Sent: Wednesday, April 21, 2021 5:21 AM
To: devel@edk2.groups.io; 
sami.muja...@arm.com; 
l...@nuviainc.com; 
ardb+tianoc...@kernel.org; Sean 
Brogan; Bret 
Barkelew
Subject: [EXTERNAL] [PATCH v1 09/12] .pytool: Enable CI for ArmPlatformPkg

From: Pierre Gondois 

Enable the CI for the ArmPlatformPkg.

Signed-off-by: Pierre Gondois 
---
 .pytool/CISettings.py | 1 +
 .pytool/Readme.md | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.pytool/CISettings.py b/.pytool/CISettings.py
index 6f7daeca076b..96e6baa5190d 100644
--- a/.pytool/CISettings.py
+++ b/.pytool/CISettings.py
@@ -50,6 +50,7 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, 
SetupSettingsManag
 These should be edk2 workspace relative paths '''

 return ("ArmPkg",
+"ArmPlatformPkg",
 "ArmVirtPkg",
 "DynamicTablesPkg",
 "EmulatorPkg",
diff --git a/.pytool/Readme.md b/.pytool/Readme.md
index cbce1f6cd54a..eca86c6a822d 100644
--- a/.pytool/Readme.md
+++ b/.pytool/Readme.md
@@ -5,7 +5,7 @@
 | Package  | Windows VS2019 (IA32/X64)| Ubuntu GCC 
(IA32/X64/ARM/AARCH64) | Known Issues |
 | :| :-   | :  
   | :--- |
 | ArmPkg   || :heavy_check_mark: |
-| ArmPlatformPkg   |
+| ArmPlatformPkg   || :heavy_check_mark: |
 | ArmVirtPkg   | SEE PACKAGE README | SEE PACKAGE README |
 | CryptoPkg| :heavy_check_mark: | :heavy_check_mark: | Spell 
checking in audit mode
 | DynamicTablesPkg || :heavy_check_mark: |
--
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74430): https://edk2.groups.io/g/devel/message/74430
Mute This Topic: https://groups.io/mt/82389025/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [EXTERNAL] [PATCH v1 10/12] .pytool: Document LicenseCheck and EccCheck

2021-04-26 Thread Bret Barkelew via groups.io
Acked by: Bret Barkelew 

- Bret

From: pierre.gond...@arm.com
Sent: Wednesday, April 21, 2021 5:21 AM
To: devel@edk2.groups.io; 
sami.muja...@arm.com; 
l...@nuviainc.com; 
ardb+tianoc...@kernel.org; Sean 
Brogan; Bret 
Barkelew
Subject: [EXTERNAL] [PATCH v1 10/12] .pytool: Document LicenseCheck and EccCheck

From: Pierre Gondois 

Add an entry in the documentation for the LicenseCheck and
EccCheck plugins.

Signed-off-by: Pierre Gondois 
---
 .pytool/Readme.md | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/.pytool/Readme.md b/.pytool/Readme.md
index eca86c6a822d..f6505507966a 100644
--- a/.pytool/Readme.md
+++ b/.pytool/Readme.md
@@ -254,6 +254,16 @@ Install

   More cspell info: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fstreetsidesoftware%2Fcspell&data=04%7C01%7CBret.Barkelew%40microsoft.com%7Cd3baca9349a5434e411408d904bffb9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637546044883177478%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=r%2BsyJEm3F5LEoSXSJ8wvtklOlVbkHrkK7mQGh5qzxEs%3D&reserved=0

+### License Checking - LicenseCheck
+
+Scans all new added files in a package to make sure code is contributed under
+BSD-2-Clause-Patent.
+
+### Ecc tool - EccCheck
+
+Run the Ecc tool on the package. The Ecc tool is available in the BaseTools
+package. It checks that the code complies to the EDKII coding standard.
+
 ## PyTool Scopes

 Scopes are how the PyTool ext_dep, path_env, and plugins are activated.  
Meaning
--
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74431): https://edk2.groups.io/g/devel/message/74431
Mute This Topic: https://groups.io/mt/82389039/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [EXTERNAL] [PATCH v1 12/12] AzurePipelines: Add support for ArmPlatformPkg

2021-04-26 Thread Bret Barkelew via groups.io
I think the TARGET name should be updated to TARGET_ARM_ARMPLATFORM.
Otherwise,

Reviewed by: Bret Barkelew 

- Bret

From: pierre.gond...@arm.com
Sent: Wednesday, April 21, 2021 5:21 AM
To: devel@edk2.groups.io; 
sami.muja...@arm.com; 
l...@nuviainc.com; 
ardb+tianoc...@kernel.org; Sean 
Brogan; Bret 
Barkelew
Subject: [EXTERNAL] [PATCH v1 12/12] AzurePipelines: Add support for 
ArmPlatformPkg

From: Pierre Gondois 

Add an entry to build the ArmPlatformPkg in the CI.

Fixes: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3349&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C5d0e796c603443cba5cb08d904bffdf6%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637546044920304051%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=A8udDEiGEU4kXwVm88lNlnOCJq4c65uW7R4n%2FYYGUCs%3D&reserved=0
Signed-off-by: Pierre Gondois 
---
 .azurepipelines/templates/pr-gate-build-job.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.azurepipelines/templates/pr-gate-build-job.yml 
b/.azurepipelines/templates/pr-gate-build-job.yml
index 837079e7bd97..16d197cde913 100644
--- a/.azurepipelines/templates/pr-gate-build-job.yml
+++ b/.azurepipelines/templates/pr-gate-build-job.yml
@@ -22,7 +22,7 @@ jobs:
   strategy:
 matrix:
   TARGET_ARM:
-Build.Pkgs: 'ArmPkg'
+Build.Pkgs: 'ArmPkg,ArmPlatformPkg'
 Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
   TARGET_MDE_CPU:
 Build.Pkgs: 'MdePkg,UefiCpuPkg'
--
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74432): https://edk2.groups.io/g/devel/message/74432
Mute This Topic: https://groups.io/mt/82389071/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [EXTERNAL] [PATCH v1 11/12] AzurePipelines: Add support for ArmPkg

2021-04-26 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 

Just realized I left a hyphen out of my other reviews today. Apologies.

- Bret

From: pierre.gond...@arm.com
Sent: Wednesday, April 21, 2021 5:21 AM
To: devel@edk2.groups.io; 
sami.muja...@arm.com; 
l...@nuviainc.com; 
ardb+tianoc...@kernel.org; Sean 
Brogan; Bret 
Barkelew
Subject: [EXTERNAL] [PATCH v1 11/12] AzurePipelines: Add support for ArmPkg

From: Pierre Gondois 

Add an entry to build the ArmPkg in the CI.

Fixes: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3348&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C1480560cf7934a9ecb3508d904bffccc%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637546044922056341%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=hJmH1ZPKXHLKyHJozmsRM3By8%2BXewjBY235NhkflflI%3D&reserved=0
Signed-off-by: Pierre Gondois 
---
 .azurepipelines/templates/pr-gate-build-job.yml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.azurepipelines/templates/pr-gate-build-job.yml 
b/.azurepipelines/templates/pr-gate-build-job.yml
index 3e6d275b1b9a..837079e7bd97 100644
--- a/.azurepipelines/templates/pr-gate-build-job.yml
+++ b/.azurepipelines/templates/pr-gate-build-job.yml
@@ -21,6 +21,9 @@ jobs:
   #Use matrix to speed up the build process
   strategy:
 matrix:
+  TARGET_ARM:
+Build.Pkgs: 'ArmPkg'
+Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
   TARGET_MDE_CPU:
 Build.Pkgs: 'MdePkg,UefiCpuPkg'
 Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
--
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74433): https://edk2.groups.io/g/devel/message/74433
Mute This Topic: https://groups.io/mt/82389086/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] Re: [edk2-devel] [PATCH v1 03/12] ArmPkg: Add missing library headers to ArmPkg.dec

2021-04-26 Thread Bret Barkelew via groups.io
Those look good to me. Made one comment on 12/12. Also screwed up my hyphen on 
8, 9, 10, and 12.

- Bret

From: Pierre Gondois
Sent: Monday, April 26, 2021 9:40 AM
To: devel@edk2.groups.io; Bret 
Barkelew
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v1 03/12] ArmPkg: Add missing 
library headers to ArmPkg.dec

Hi Bret,
Ok I will do that in a V2.

Do these patches look ok to you ?

[PATCH v1 08/12] .pytool: Enable CI for ArmPkg
[PATCH v1 09/12] .pytool: Enable CI for ArmPlatformPkg
[PATCH v1 10/12] .pytool: Document LicenseCheck and EccCheck
[PATCH v1 11/12] AzurePipelines: Add support for ArmPkg
[PATCH v1 12/12] AzurePipelines: Add support for ArmPlatformPkg

Regards,
Pierre

On 4/21/21 8:13 PM, brbarkel via groups.io wrote:
>
> 1) To expedite the required reviews, you may want to add CC to the
> package maintainers for ArmPkg to this commit message and email. I
> know a lot of people filter based on direct mention vs mailing list.
>
> 2) Generally, other packages have a brief description of the lib in
> the DEC, as well. Example:
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fblob%2Fd3b0d007a135284981fa750612a47234b83976f9%2FMdeModulePkg%2FMdeModulePkg.dec%23L55&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C11a94a7986c94a1dc9dd08d908d20f74%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637550520568164761%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=MsbriQVK47dxlgZxsTWgpiKS0XM8FOVwFY5askVkvAA%3D&reserved=0
> 
> However, I see that this has not historically been maintained in this
> package, so I'm not going to make a big deal of it.
>
> Reviewed-by: Bret Barkelew 
>
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74434): https://edk2.groups.io/g/devel/message/74434
Mute This Topic: https://groups.io/mt/82389102/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] Re: [edk2-devel] RFC: Adding support for ARM (RNDR etc.) to RngDxe

2021-04-26 Thread Bret Barkelew via groups.io
I vote the latter.

- Bret

From: Rebecca Cran via groups.io
Sent: Monday, April 26, 2021 2:29 PM
To: Sami Mujawar; 
devel@edk2.groups.io; Samer 
El-Haj-Mahmoud; Ard 
Biesheuvel; 
l...@nuviainc.com
Cc: r...@edk2.groups.io; Yao, 
Jiewen; Rahul 
Kumar; nd; Jose 
Marinho
Subject: [EXTERNAL] Re: [edk2-devel] RFC: Adding support for ARM (RNDR etc.) to 
RngDxe

Hi Sami,

I've been looking through the design document again, and was wondering
if the work I previously did will just slot in?

Were you thinking the "RngLib|RNDR" would go into ArmPkg (since it's not
labeled as being in BaseRngLib)? Or would it still make sense to
refactor MdePkg/Library/BaseRngLib to support both x86 (using RDRAND)
and aarch64 (using RNDR)?

--
Rebecca Cran



On 4/22/21 3:30 AM, Sami Mujawar wrote:
> Hi Rebecca,
>
> I have been working on the following modules (See slide 11 in “EDKII -
> Proposed update to RNG implementation.pdf
> ):
>
>  1. TrngLib|FwTrnglib (Arm Firmware TRNG)
>  2. DrbgLib stack – with support for DrbgAlgorithmLib|CRT_DRBG &
> AesLib|ArmAesInstructionLib.
>
> I plan to post patches for (a) in the next fortnight. Following this I
> plan to update the proposal with the interface definitions for the
> various library interfaces in the DrbgLib Stack.
>
> I have not looked at RngLib|RNDR as I believe you were interested in
> implementing the part. Kindly let me know if you plan to implement this
> and the platform you would be using for testing. It looks like the
> FVP_Base_AEMv8A-AEMv8A and the FVP-RevC models support RNDR, so these
> could be used for testing as well. Please feel free to get in touch
> should you need any help with the model parameters or if you face any
> issues.
>
> Regards,
>
> Sami Mujawar
>
> *From: *Rebecca Cran 
> *Date: *Tuesday, 20 April 2021 at 21:04
> *To: *Sami Mujawar , devel@edk2.groups.io
> , Samer El-Haj-Mahmoud
> , Ard Biesheuvel ,
> l...@nuviainc.com 
> *Cc: *r...@edk2.groups.io , Jiewen Yao
> , Rahul Kumar , nd
> , Jose Marinho 
> *Subject: *Re: [edk2-devel] RFC: Adding support for ARM (RNDR etc.) to
> RngDxe
>
> Hi Sami,
>
> I was wondering if you're still collecting feedback on the design, or if
> you have a plan and schedule for the implementation?
>
> --
> Rebecca Cran
>
> On 1/15/21 7:51 PM, Sami Mujawar wrote:
>  > Hi All,
>  >
>  > I have shared some initial thoughts on the RNG implementation updates
> at
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Ffiles%2FDesigns%2F2021%2F0116%2FEDKII%2520-%2520Proposed%2520update%2520to%2520RNG%2520implementation.pdf&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C676a9101f67845dbdc8908d908fa4cd1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637550693569385394%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Q8ka83ReO2aG8yTVrgpTAVxczJVjl2JBH3ksHo2%2BSHk%3D&reserved=0
> 
>  >
>  > Kindly let me know your feedback or if you have any queries.
>  >
>  > Regards,
>  >
>  > Sami Mujawar
>  >
>  > -Original Message-
>  > From: devel@edk2.groups.io  On Behalf Of
> Rebecca Cran via groups.io
>  > Sent: 14

Re: [edk2-devel] [EXTERNAL] [PATCH v1 1/1] UnitTestFrameworkPkg: Sample unit test hangs when running in OVMF/QEMU

2021-04-29 Thread Bret Barkelew via groups.io
This change should also be made in:
UnitTestFrameworkPkg\Library\UnitTestResultReportLib\UnitTestResultReportLibDebugLib.c
UnitTestFrameworkPkg\Library\UnitTestResultReportLib\UnitTestResultReportLib.c 
(for the prototype)

- Bret

From: Getnat Ejigu
Sent: Thursday, April 29, 2021 10:43 AM
To: devel@edk2.groups.io
Cc: Kinney, Michael D; Sean 
Brogan; Bret 
Barkelew
Subject: [EXTERNAL] [PATCH v1 1/1] UnitTestFrameworkPkg: Sample unit test hangs 
when running in OVMF/QEMU

Sample unit tests in UnitTestFrameworkPkg hangs when running in OVMF/QEMU
environment. Build target is X64/GCC5. Fixing this issue by adding EFIAPI
to ReportPrint() function that use VA_ARGS.

Signed-off-by: Getnat Ejigu 
Cc: Michael D Kinney 
Cc: Sean Brogan 
Cc: Bret Barkelew 
---
 
UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
 | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
 
b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
index cfb0c5972bd1..db5402d6a210 100644
--- 
a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
+++ 
b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
@@ -12,6 +12,7 @@
 #include 



 VOID

+EFIAPI

 ReportPrint (

   IN CONST CHAR8  *Format,

   ...

--
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74621): https://edk2.groups.io/g/devel/message/74621
Mute This Topic: https://groups.io/mt/82473334/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [EXTERNAL] [PATCH v1 1/1] UnitTestFrameworkPkg: Sample unit test hangs when running in OVMF/QEMU

2021-04-30 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 

- Bret

From: Getnat Ejigu
Sent: Friday, April 30, 2021 2:07 PM
To: devel@edk2.groups.io
Cc: Kinney, Michael D; Sean 
Brogan; Bret 
Barkelew
Subject: [EXTERNAL] [PATCH v1 1/1] UnitTestFrameworkPkg: Sample unit test hangs 
when running in OVMF/QEMU

Sample unit tests in UnitTestFrameworkPkg hangs when running in OVMF/QEMU
environment. Build target is X64/GCC5. Fixing this issue by adding EFIAPI
to ReportPrint() function that use VA_ARGS.

Signed-off-by: Getnat Ejigu 
Cc: Michael D Kinney 
Cc: Sean Brogan 
Cc: Bret Barkelew 
---
 UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c 
| 1 +
 
UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
   | 1 +
 
UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c
 | 1 +
 3 files changed, 3 insertions(+)

diff --git 
a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c
 
b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c
index 66c9db457d80..7f7443a23391 100644
--- 
a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c
+++ 
b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c
@@ -11,6 +11,7 @@
 #include 



 VOID

+EFIAPI

 ReportPrint (

   IN CONST CHAR8  *Format,

   ...

diff --git 
a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
 
b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
index cfb0c5972bd1..db5402d6a210 100644
--- 
a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
+++ 
b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
@@ -12,6 +12,7 @@
 #include 



 VOID

+EFIAPI

 ReportPrint (

   IN CONST CHAR8  *Format,

   ...

diff --git 
a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c
 
b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c
index 1402d0ef83e2..1d62c6a37117 100644
--- 
a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c
+++ 
b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c
@@ -11,6 +11,7 @@
 #include 



 VOID

+EFIAPI

 ReportPrint (

   IN CONST CHAR8  *Format,

   ...

--
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74682): https://edk2.groups.io/g/devel/message/74682
Mute This Topic: https://groups.io/mt/82492217/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [EXTERNAL] [PATCH v1 1/1] UnitTestFrameworkPkg: Sample unit test hangs when running in OVMF/QEMU

2021-04-30 Thread Bret Barkelew via groups.io
Mike,

Can you stage the PR for this? Thanks!

- Bret

From: Bret Barkelew via groups.io<mailto:bret.barkelew=microsoft@groups.io>
Sent: Friday, April 30, 2021 2:16 PM
To: Getnat Ejigu<mailto:getnatej...@gmail.com>; 
devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Kinney, Michael D<mailto:michael.d.kin...@intel.com>; Sean 
Brogan<mailto:sean.bro...@microsoft.com>
Subject: Re: [edk2-devel] [EXTERNAL] [PATCH v1 1/1] UnitTestFrameworkPkg: 
Sample unit test hangs when running in OVMF/QEMU

Reviewed-by: Bret Barkelew 

- Bret

From: Getnat Ejigu<mailto:getnatej...@gmail.com>
Sent: Friday, April 30, 2021 2:07 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Kinney, Michael D<mailto:michael.d.kin...@intel.com>; Sean 
Brogan<mailto:sean.bro...@microsoft.com>; Bret 
Barkelew<mailto:bret.barke...@microsoft.com>
Subject: [EXTERNAL] [PATCH v1 1/1] UnitTestFrameworkPkg: Sample unit test hangs 
when running in OVMF/QEMU

Sample unit tests in UnitTestFrameworkPkg hangs when running in OVMF/QEMU
environment. Build target is X64/GCC5. Fixing this issue by adding EFIAPI
to ReportPrint() function that use VA_ARGS.

Signed-off-by: Getnat Ejigu 
Cc: Michael D Kinney 
Cc: Sean Brogan 
Cc: Bret Barkelew 
---
 UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c 
| 1 +
 
UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
   | 1 +
 
UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c
 | 1 +
 3 files changed, 3 insertions(+)

diff --git 
a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c
 
b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c
index 66c9db457d80..7f7443a23391 100644
--- 
a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c
+++ 
b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c
@@ -11,6 +11,7 @@
 #include 



 VOID

+EFIAPI

 ReportPrint (

   IN CONST CHAR8  *Format,

   ...

diff --git 
a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
 
b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
index cfb0c5972bd1..db5402d6a210 100644
--- 
a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
+++ 
b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.c
@@ -12,6 +12,7 @@
 #include 



 VOID

+EFIAPI

 ReportPrint (

   IN CONST CHAR8  *Format,

   ...

diff --git 
a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c
 
b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c
index 1402d0ef83e2..1d62c6a37117 100644
--- 
a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c
+++ 
b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c
@@ -11,6 +11,7 @@
 #include 



 VOID

+EFIAPI

 ReportPrint (

   IN CONST CHAR8  *Format,

   ...

--
2.25.1





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74683): https://edk2.groups.io/g/devel/message/74683
Mute This Topic: https://groups.io/mt/82492217/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] A plea for help

2021-05-19 Thread Bret Barkelew via groups.io
Have you tried the latest Python 3.x?

- Bret

From: Fowler, Eric (Mondo International, LLC) via 
groups.io
Sent: Wednesday, May 19, 2021 12:41 AM
To: devel@edk2.groups.io
Subject: [EXTERNAL] [edk2-devel] A plea for help

build.py...
: error C0DE: Unknown fatal error when processing 
[c:\edk2020\district-defend\edk2\MdeModulePkg\Universal\Console\GraphicsConsoleDxe\GraphicsConsoleDxe.inf]

(Please send email to devel@edk2.groups.io for help, attaching following call 
stack trace!)

(Python 3.9.5 on win32) Traceback (most recent call last):
  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\build\build.py", line 
2596, in Main
MyBuild.Launch()
  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\build\build.py", line 
2391, in Launch
self._MultiThreadBuildPlatform()
  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\build\build.py", line 
2271, in _MultiThreadBuildPlatform
self.CreateAsBuiltInf()
  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\build\build.py", line 
2401, in CreateAsBuiltInf
Module.CreateAsBuiltInf()
  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\AutoGen\ModuleAutoGen.py",
 line 1503, in CreateAsBuiltInf
PatchList = parsePcdInfoFromMapFile(
  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\GenPatchPcdTable\GenPatchPcdTable.py",
 line 59, in parsePcdInfoFromMapFile
return _parseGeneral(lines, efifilepath)
  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\GenPatchPcdTable\GenPatchPcdTable.py",
 line 174, in _parseGeneral
efisecs = PeImageClass(efifilepath).SectionHeaderList
  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\Common\Misc.py", line 
1638, in __init__
if ByteArray.tostring() != b'PE\0\0':
AttributeError: 'array.array' object has no attribute 'tostring'


- Failed -
Build end time: 21:15:31, May.18 2021
Build total time: 00:07:11




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#75361): https://edk2.groups.io/g/devel/message/75361
Mute This Topic: https://groups.io/mt/82931279/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] A plea for help

2021-05-19 Thread Bret Barkelew via groups.io
Yup, I was tired. Read the Python version all wrong.

- Bret

From: Hernandez Miramontes, Jose Miguel 

Sent: Wednesday, May 19, 2021 7:15:30 AM
To: devel@edk2.groups.io ; Bret Barkelew 
; fowler_e...@ne.bah.com 
Subject: [EXTERNAL] RE: [edk2-devel] A plea for help


So, the problem is here.

File "C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\Common\Misc.py", 
line 1638, in __init__

if ByteArray.tostring() != b'PE\0\0':



see:

https://docs.python.org/3/whatsnew/3.9.html<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.python.org%2F3%2Fwhatsnew%2F3.9.html&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Cf3fb8f5288bd4af41aa408d91ad09263%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637570305407840963%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=cciIITpbNA55d7ZKakdj3DS8YWEnilz37Dlz%2B1Vzb8Q%3D&reserved=0>



array.array: tostring() and fromstring() methods have been removed. They were 
aliases to tobytes() and frombytes(), deprecated since Python 3.2. (Contributed 
by Victor Stinner in bpo-38916.)



you could try python 3.8 or cherry pick this change.

https://github.com/tianocore/edk2/commit/43bec9ea3d56f3662ede78023baa2a791b66acac<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fcommit%2F43bec9ea3d56f3662ede78023baa2a791b66acac&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Cf3fb8f5288bd4af41aa408d91ad09263%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637570305407850918%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=3XL3RTbGl0QPbNYIDgs2R3fWhBwsld37zvPjeI7Acso%3D&reserved=0>







Jose Miguel Hernandez Miramontes

BIOS  Engineer

jose.miguel.hernandez.miramon...@intel.com

Intel Corporation



From: devel@edk2.groups.io  On Behalf Of Bret Barkelew 
via groups.io
Sent: Wednesday, May 19, 2021 3:12 AM
To: devel@edk2.groups.io; fowler_e...@ne.bah.com
Subject: Re: [edk2-devel] A plea for help



Have you tried the latest Python 3.x?



- Bret



From: Fowler, Eric (Mondo International, LLC) via 
groups.io<mailto:Fowler_Eric=ne.bah@groups.io>
Sent: Wednesday, May 19, 2021 12:41 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Subject: [EXTERNAL] [edk2-devel] A plea for help



build.py...

: error C0DE: Unknown fatal error when processing 
[c:\edk2020\district-defend\edk2\MdeModulePkg\Universal\Console\GraphicsConsoleDxe\GraphicsConsoleDxe.inf]



(Please send email to devel@edk2.groups.io<mailto:devel@edk2.groups.io> for 
help, attaching following call stack trace!)



(Python 3.9.5 on win32) Traceback (most recent call last):

  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\build\build.py", line 
2596, in Main

MyBuild.Launch()

  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\build\build.py", line 
2391, in Launch

self._MultiThreadBuildPlatform()

  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\build\build.py", line 
2271, in _MultiThreadBuildPlatform

self.CreateAsBuiltInf()

  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\build\build.py", line 
2401, in CreateAsBuiltInf

Module.CreateAsBuiltInf()

  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\AutoGen\ModuleAutoGen.py",
 line 1503, in CreateAsBuiltInf

PatchList = parsePcdInfoFromMapFile(

  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\GenPatchPcdTable\GenPatchPcdTable.py",
 line 59, in parsePcdInfoFromMapFile

return _parseGeneral(lines, efifilepath)

  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\GenPatchPcdTable\GenPatchPcdTable.py",
 line 174, in _parseGeneral

efisecs = PeImageClass(efifilepath).SectionHeaderList

  File 
"C:\EDK2020\district-defend\edk2\BaseTools\Source\Python\Common\Misc.py", line 
1638, in __init__

if ByteArray.tostring() != b'PE\0\0':

AttributeError: 'array.array' object has no attribute 'tostring'





- Failed -

Build end time: 21:15:31, May.18 2021

Build total time: 00:07:11






-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#75385): https://edk2.groups.io/g/devel/message/75385
Mute This Topic: https://groups.io/mt/82931279/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [EXTERNAL] [edk2-stable202105 PATCH] MdeModulePkg/VariableLock: downgrade compatibility warnings to DEBUG_WARN

2021-05-21 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 
bret.barke...@microsoft.com

I don’t regret making it ERROR at first because now no one can claim to have 
not been warned when the interface drops, but I agree that lowering to WARN now 
is prudent.

- Bret

From: Laszlo Ersek
Sent: Friday, May 21, 2021 1:40 PM
To: edk2-devel-groups-io
Cc: Bret Barkelew; Hao A 
Wu; Jian J Wang; 
Liming Gao; Kinney, Michael 
D; Philippe 
Mathieu-Daudé
Subject: [EXTERNAL] [edk2-stable202105 PATCH] MdeModulePkg/VariableLock: 
downgrade compatibility warnings to DEBUG_WARN

Commit a18a9bde36d2 ("MdeModulePkg/Variable/RuntimeDxe: Restore Variable
Lock Protocol behavior", 2020-12-15), for bug 3111, added two such sets of
debug messages that:

(a) are relevant for developers,

(b) yet should not necessarily poke end-users, because no functionality
suffers in practice.

Both message sets are in function VariableLockRequestToLock(): the first
is a generic interface deprecation warning; the second is the
double-locking situation, which we permit for compatibility (return status
EFI_SUCCESS).

Both message sets should be emitted with the DEBUG_WARN mask, not the most
serious DEBUG_ERROR mask. On some platforms, the serial console carries
both terminal traffic, and grave (DEBUG_ERROR-only) log messages. On such
platforms, both message sets may be perceived as a nuisance by end-users,
as there is nothing they can do, and there's nothing they *should* do --
in practice, nothing malfunctions.

(Such a platform is ArmVirtQemu, built with "-D
DEBUG_PRINT_ERROR_LEVEL=0x8000".)

Cc: Bret Barkelew 
Cc: Hao A Wu 
Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Philippe Mathieu-Daudé 
Ref: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3410&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ca7ff677adbc34cf62f0608d91c98b5b9%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637572264482965812%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=2WuJ06k2ViIR6JnQVRmsGdsnYjmOrPUtGD82thYLe%2FU%3D&reserved=0
Fixes: a18a9bde36d2ffc12df29cdced1efa1f8f9f2021
Signed-off-by: Laszlo Ersek 
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequestToLock.c | 10 
+-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequestToLock.c 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequestToLock.c
index 7d87e50efdcd..4e1efef9a7e4 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequestToLock.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequestToLock.c
@@ -48,9 +48,9 @@ VariableLockRequestToLock (
   EFI_STATUS Status;
   VARIABLE_POLICY_ENTRY  *NewPolicy;

-  DEBUG ((DEBUG_ERROR, "!!! DEPRECATED INTERFACE !!! %a() will go away 
soon!\n", __FUNCTION__));
-  DEBUG ((DEBUG_ERROR, "!!! DEPRECATED INTERFACE !!! Please move to use 
Variable Policy!\n"));
-  DEBUG ((DEBUG_ERROR, "!!! DEPRECATED INTERFACE !!! Variable: %g %s\n", 
VendorGuid, VariableName));
+  DEBUG ((DEBUG_WARN, "!!! DEPRECATED INTERFACE !!! %a() will go away 
soon!\n", __FUNCTION__));
+  DEBUG ((DEBUG_WARN, "!!! DEPRECATED INTERFACE !!! Please move to use 
Variable Policy!\n"));
+  DEBUG ((DEBUG_WARN, "!!! DEPRECATED INTERFACE !!! Variable: %g %s\n", 
VendorGuid, VariableName));

   NewPolicy = NULL;
   Status = CreateBasicVariablePolicy(
@@ -69,13 +69,13 @@ VariableLockRequestToLock (
 //
 // If the error returned is EFI_ALREADY_STARTED, we need to check the
 // current database for the variable and see whether it's locked. If it's
-// locked, we're still fine, but also generate a DEBUG_ERROR message so the
+// locked, we're still fine, but also generate a DEBUG_WARN message so the
 // duplicate lock can be removed.
 //
 if (Status == EFI_ALREADY_STARTED) {
   Status = ValidateSetVariable (VariableName, VendorGuid, 0, 0, NULL);
   if (Status == EFI_WRITE_PROTECTED) {
-DEBUG ((DEBUG_ERROR, "  Variable: %g %s is already locked!\n", 
VendorGuid, VariableName));
+DEBUG ((DEBUG_WARN, "  Variable: %g %s is already locked!\n", 
VendorGuid, VariableName));
 Status = EFI_SUCCESS;
   } else {
 DEBUG ((DEBUG_ERROR, "  Variable: %g %s can not be locked!\n", 
VendorGuid, VariableName));
--
2.19.1.3.g30247aa5d201



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#75450): https://edk2.groups.io/g/devel/message/75450
Mute This Topic: https://groups.io/mt/82995928/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-a

[edk2-devel] ArmPkg: TranslationTable exceeding TempRam on virtual systems

2021-05-27 Thread Bret Barkelew via groups.io
I’m fielding a series of questions coming out of our compatriot team that deals 
with virtual FW (for HyperV). They’re seeing ARM64 systems that have lots of 
RAM vastly exceeding the TempRam that’s passed into the system due to HOB 
allocations to create all the 4k entries for the early page tables.

Is this a known limitation or are we doing something dumb?
Is there a way to sparsely populate the page tables and fill them in more in 
DXE?
I’ve seen some questions about 64k pages on the list before. Is that an option?

Thanks in advance!

- Bret



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#75818): https://edk2.groups.io/g/devel/message/75818
Mute This Topic: https://groups.io/mt/83137787/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] Re: [edk2-devel] [PATCH v2 4/6] SecurityPkg: Add EnrollFromDefaultKeys application.

2021-06-02 Thread Bret Barkelew via groups.io
> +#define FAIL(fmt...) AsciiPrint("EnrollFromDefaultKeysApp: " fmt)

I don’t think this sort of implied concatenation works on all compilers.

- Bret

From: Pete Batard via groups.io
Sent: Wednesday, June 2, 2021 10:40 AM
To: devel@edk2.groups.io; 
g...@semihalf.com
Cc: Lindholm, Leif; 
ardb+tianoc...@kernel.org; Samer 
El-Haj-Mahmoud; 
sunny.w...@arm.com; 
m...@semihalf.com; 
upstr...@semihalf.com; Yao, 
Jiewen; 
jian.j.w...@intel.com; 
min.m...@intel.com; 
ler...@redhat.com
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v2 4/6] SecurityPkg: Add 
EnrollFromDefaultKeys application.

On 2021.06.01 14:12, Grzegorz Bernacki wrote:
> This application allows user to force key enrollment from
> Secure Boot default variables.
>
> Signed-off-by: Grzegorz Bernacki 
> ---
>   SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.inf |  47 
> +
>   SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.c   | 107 
> 
>   2 files changed, 154 insertions(+)
>   create mode 100644 
> SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.inf
>   create mode 100644 
> SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.c
>
> diff --git 
> a/SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.inf 
> b/SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.inf
> new file mode 100644
> index 00..4d79ca3844
> --- /dev/null
> +++ b/SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.inf
> @@ -0,0 +1,47 @@
> +## @file
> +#  Enroll PK, KEK, db, dbx from Default variables
> +#
> +#  Copyright (c) 2021, ARM Ltd. All rights reserved.
> +#  Copyright (c) 2021, Semihalf All rights reserved.
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +##
> +
> +[Defines]
> +  INF_VERSION= 1.28
> +  BASE_NAME  = EnrollFromDefaultKeysApp
> +  FILE_GUID  = 6F18CB2F-1293-4BC1-ABB8-35F84C71812E
> +  MODULE_TYPE= UEFI_APPLICATION
> +  VERSION_STRING = 0.1
> +  ENTRY_POINT= UefiMain
> +
> +[Sources]
> +  EnrollFromDefaultKeysApp.c
> +
> +[Packages]
> +  MdeModulePkg/MdeModulePkg.dec
> +  MdePkg/MdePkg.dec
> +  SecurityPkg/SecurityPkg.dec
> +
> +[Guids]
> +  gEfiCertPkcs7Guid
> +  gEfiCertSha256Guid
> +  gEfiCertX509Guid
> +  gEfiCustomModeEnableGuid
> +  gEfiGlobalVariableGuid
> +  gEfiImageSecurityDatabaseGuid
> +  gEfiSecureBootEnableDisableGuid
> +
> +[Protocols]
> +  gEfiSmbiosProtocolGuid ## CONSUMES
> +
> +[LibraryClasses]
> +  BaseLib
> +  BaseMemoryLib
> +  DebugLib
> +  MemoryAllocationLib
> +  PrintLib
> +  UefiApplicationEntryPoint
> +  UefiBootServicesTableLib
> +  UefiLib
> +  UefiRuntimeServicesTableLib
> +  SecureBootVariableLib
> diff --git a/SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.c 
> b/SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.c
> new file mode 100644
> index 00..1907ce1d4e
> --- /dev/null
> +++ b/SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.c
> @@ -0,0 +1,107 @@
> +/** @file
> +  Enroll default PK, KEK, db, dbx.
> +
> +Copyright (c) 2021, ARM Ltd. All rights reserved.
> +Copyright (c) 2021, Semihalf All rights reserved.
> +
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +**/
> +
> +#include // gEfiCustomModeEnableGuid
> +#include  // EFI_SETUP_MODE_NAME
> +#include // 
> EFI_IMAGE_SECURITY_DATABASE
> +#include  // GUID_STRING_LENGTH
> +#include// CopyGuid()
> +#include // ASSERT()
> +#include  // FreePool()
> +#include // AsciiSPrint()
> +#include // gBS
> +#include  // AsciiPrint()
> +#include  // gRT
> +#include 
> +#include 
> +
> +#define FAIL(fmt...) AsciiPrint("EnrollFromDefaultKeysApp: " fmt)
> +
> +/**
> +  Entry point function of this shell application.
> +**/
> +EFI_STATUS
> +EFIAPI
> +UefiMain (
> +  IN EFI_HANDLEImageHandle,
> +  IN EFI_SYSTEM_TABLE  *SystemTable
> +  )
> +{
> +  EFI_STATUS Status;
> +  UINT8  SetupMode;
> +
> +  Status = GetSetupMode (&SetupMode);
> +  if (EFI_ERROR (Status)) {
> +FAIL ("Cannot get SetupMode variable: %r\n", Status);
> +return 1;
> +  }
> +
> +  if (SetupMode == USER_MODE) {
> +FAIL ("Skipped - USER_MODE\n");
> +return 1;
> +  }
> +
> +  Status = SetSecureBootMode (CUSTOM_SECURE_BOOT_MODE);
> +  if (EFI_ERROR (Status)) {
> +FAIL ("Cannot set CUSTOM_SECURE_BOOT_MODE: %r\n", Status);
> +return 1;
> +  }
> +
> +  Status = EnrollDbFromDefault ();
> +  if (EFI_ERROR (Sta

Re: [EXTERNAL] Re: [edk2-devel] [PATCH v1 1/1] Pytool: SpellCheck: Defer path expansion in cspell parameters

2021-06-15 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 

- Bret

From: Sean Brogan
Sent: Tuesday, June 15, 2021 9:00 AM
To: devel@edk2.groups.io; 
kuqi...@gmail.com
Cc: Sean Brogan; Bret 
Barkelew; Kinney, Michael 
D; Liming 
Gao
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v1 1/1] Pytool: SpellCheck: Defer 
path expansion in cspell parameters

Please update the signed-off-by to include yours.

Reviewed-by: Sean Brogan 

Thanks
Sean


On 6/11/2021 10:04 PM, Kun Qin wrote:
> From: Sean Brogan 
>
> REF: 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3454&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C436f445e3f774d2549b608d930169d05%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637593696216659744%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=pJiLG4bZ8gYR0MjDuNTmuT3NgRjq%2FZRMnTi1sT67VqM%3D&reserved=0
>
> On Linux the shell expands the wildcard paths and causes multiple files
> to be missed. This change adds additional quotes to defer expansion in
> order to bring parity in cspell result.
>
> Cc: Sean Brogan 
> Cc: Bret Barkelew 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
>
> Signed-off-by: Sean Brogan 
> ---
>   .pytool/Plugin/SpellCheck/SpellCheck.py | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/.pytool/Plugin/SpellCheck/SpellCheck.py 
> b/.pytool/Plugin/SpellCheck/SpellCheck.py
> index 43365441b91c..97b240ef747c 100644
> --- a/.pytool/Plugin/SpellCheck/SpellCheck.py
> +++ b/.pytool/Plugin/SpellCheck/SpellCheck.py
> @@ -133,7 +133,8 @@ class SpellCheck(ICiBuildPlugin):
>   #
>   relpath = os.path.relpath(abs_pkg_path)
>   cpsell_paths = " ".join(
> -[f"{relpath}/**/{x}" for x in 
> package_relative_paths_to_spell_check])
> +# Double quote each path to defer expansion to cspell parameters
> +[f'"{relpath}/**/{x}"' for x in 
> package_relative_paths_to_spell_check])
>
>   # Make the config file
>   config_file_path = os.path.join(
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76530): https://edk2.groups.io/g/devel/message/76530
Mute This Topic: https://groups.io/mt/83559790/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] NetworkPkg: Unexpected DHCP RELEASE after PXE server reply on IPv6

2021-06-23 Thread Bret Barkelew via groups.io
Hi all!

Trying to track down an unexpected behavior for one of our teams here:
“We tried to PXEBoot a VM using IPv6 and even though the server replied with 
all requested boot options, the firmware for some reason did a DHCPv6 release 
instead of going for a network boot.”

The team dug in with some debugging and tracked things down to this process and 
the associated code:

  1.  DHCP server is sending REPLY with valid boot params and tftp server 
address.
  2.  UEFI upon receiving this REPLY, it is trying to send UDP request with 
port 4011 and uses TFTP global address as destination address.
  3.  Ip6Output() in /NetworkPkg/Ip6Dxe/Ip6Output.c drops the UDP request 
generated in Step-2. This is due to route miss.
 *   Function: 
https://github.com/tianocore/edk2/blob/20ca52882877ba9025da2ee58c8dab7808eca457/NetworkPkg/Ip6Dxe/Ip6Output.c#L476
 *   Error return: 
https://github.com/tianocore/edk2/blob/20ca52882877ba9025da2ee58c8dab7808eca457/NetworkPkg/Ip6Dxe/Ip6Output.c#L701
  4.  As the UDP request with port 4011 failed, UEFI does a RELEASE message and 
errors out.
  5.  Below the code snippet inside UEFI where packet is getting dropped.

Here’s some questions from the team:

  1.  Why is UEFI doing UDP request with port 4011 to TFTP server address. We 
expect it to start TFTP with data provided in REPLY by server.
  2.  In data center, the blades are not directly connected to server. So how 
can UEFI learn the routes to send a unicast request using global address.
  3.  In case of IPv4, we don’t see any UDP request using port 4011. Why alone 
for IPv6?


Thoughts? Thanks in advance!

- Bret



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77009): https://edk2.groups.io/g/devel/message/77009
Mute This Topic: https://groups.io/mt/83747676/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] Re: [edk2-devel] [PATCH v1 1/5] EDK2 Code First: PI Specification: EFI_MM_COMMUNICATE_HEADER Update

2021-06-23 Thread Bret Barkelew via groups.io
Yeah, the only other thought I had for moving forwards quickly (i.e. hackily) 
is to define a new GUID that just means “I use an updated header configuration” 
since the EFI_GUID field comes first and is a well-understood size.

I would prefer the “deprecate, break builds, fix code, move forward” approach.

- Bret

From: Kun Qin via groups.io
Sent: Wednesday, June 23, 2021 5:53 PM
To: Wu, Hao A; 
devel@edk2.groups.io
Cc: Kinney, Michael D; Liming 
Gao; Liu, 
Zhiguang; Andrew Fish; 
Laszlo Ersek; Lindholm, 
Leif; Bret 
Barkelew; Michael 
Kubacki
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v1 1/5] EDK2 Code First: PI 
Specification: EFI_MM_COMMUNICATE_HEADER Update

Hi Hao,

We have been circulating different ideas internally about how to enforce
a warning around this change.

There is an idea of deprecating the old structure and replacing it with
a newly defined EFI_MM_COMMUNICATE_HEADER_V2. That way all consumers
will be enforced to update their implementation and (hopefully) inspect
the compatibility accordingly. In addition, we could add other fields
such as signature and/or header version number for further extensibility.

If there are code instances that uses "sizeof(EFI_GUID) + sizeof(UINTN)"
in lieu of OFFSET_OF, this implementation is essentially decoupled from
the structure definition. So compiler might not be able to help. In that
case, runtime protections such as pool guard or stack guard might be useful.

Please let me know if you think header structure V2 is an idea worth to try.

Thanks,
Kun

On 06/15/2021 18:15, Wu, Hao A wrote:
> Thanks Kun,
>
> I am a little concerned on whether there will be other missing cases that are 
> not covered by this patch series.
>
> I am also wondering is there any detection can be made to warn the cases that 
> code modification should be made after this structure update.
> Otherwise, it will be the burden for the platform owners to review the 
> platform codes following your guide mentioned in this patch.
>
> Hoping others can provide some inputs on this.
>
> Best Regards,
> Hao Wu
>
>> -Original Message-
>> From: Kun Qin 
>> Sent: Wednesday, June 16, 2021 4:51 AM
>> To: Wu, Hao A ; devel@edk2.groups.io
>> Cc: Kinney, Michael D ; Liming Gao
>> ; Liu, Zhiguang ;
>> Andrew Fish ; Laszlo Ersek ; Leif
>> Lindholm 
>> Subject: Re: [edk2-devel] [PATCH v1 1/5] EDK2 Code First: PI Specification:
>> EFI_MM_COMMUNICATE_HEADER Update
>>
>> Hi Hao,
>>
>> Sorry that I missed comments for this patch earlier. You are correct. I only
>> inspected SmmLockBoxPeiLib. The PEI instance handled mode switch with
>> ```OFFSET_OF ``` function. But DXE instance still have a few use cases that 
>> will
>> be impacted.
>>
>> I will update this read me file and add a code change patch for this library 
>> in
>> v2. Thanks for pointing this out.
>>
>> Regards,
>> Kun
>>
>> On 06/11/2021 00:46, Wu, Hao A wrote:
 -Original Message-
 From: devel@edk2.groups.io  On Behalf Of Kun
 Qin
 Sent: Thursday, June 10, 2021 9:43 AM
 To: devel@edk2.groups.io
 Cc: Kinney, Michael D ; Liming Gao
 ; Liu, Zhiguang ;
 Andrew Fish ; Laszlo Ersek ; Leif
 Lindholm 
 Subject: [edk2-devel] [PATCH v1 1/5] EDK2 Code First: PI Specification:
 EFI_MM_COMMUNICATE_HEADER Update

 REF: 
 https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3430&data=04%7C01%7CBret.Barkelew%40microsoft.com%7Ca480819ff5e84e12239f08d936aa7bc5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637600928127681913%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=483mG24s%2Bp0xSF90Wf%2Fmh2TN1atrIQa5mOrLyEPCTuE%3D&reserved=0

 This change includes specification update markdown file that
 describes the proposed PI Specification v1.7 Errata A in detail and
 potential impact to the existing codebase.

 Cc: Michael D Kinney 
 Cc: Liming Gao 
 Cc: Zhiguang Liu 
 Cc: Andrew Fish 
 Cc: Laszlo Ersek 
 Cc: Leif Lindholm 

 Signed-off-by: Kun Qin 
 ---
BZ3430-SpecChange.md | 88 
1 file changed, 88 insertions(+)

 diff --git a/BZ3430-SpecChange.md b/BZ3430-SpecChange.md new file
 mode
 100644 index ..33a1ffda447b
 --- /dev/null
 +++ b/BZ3430-SpecChange.md
 @@ -0,0 +1,88 @@
 +# Title: Change MessageLength Field of
>> EFI_MM_COMMUNICATE_HEADER
 to
 +UINT64
 +
 +## Status: Draft
 +
 +## Document: UEFI Platform Initialization Specification Version 1.7
 +Errata A
 +
 +## License
>>>

Re: [edk2-devel] Proposing a new area of the edk2-test repository

2021-06-23 Thread Bret Barkelew via groups.io
Fun fact! Mu also has a number of apps and things that we could work on moving 
to EDK2 if there were a suitable location. Right now, many of them are here:
mu_plus/UefiTestingPkg at release/202102 · microsoft/mu_plus 
(github.com)

- Bret

From: Nelson, Eric via groups.io
Sent: Wednesday, June 23, 2021 3:38 PM
To: Samer El-Haj-Mahmoud; G Edhaya 
Chandran; 
gao...@byosoft.com.cn; 
devel@edk2.groups.io; Kinney, Michael 
D
Subject: [EXTERNAL] Re: [edk2-devel] Proposing a new area of the edk2-test 
repository


I have created a few other internal apps that build under WinTestPkg, although 
ResumeOK.efi is the only one I have received permissions to release sources for 
at this time.
And yes, they are primarily intended for validating Windows requirements.
I had some issues with my apps, needing to use different libraries than 
MdeModulePkg, and found it easier to create my own package, and use the libs I 
want.

__e


From: Samer El-Haj-Mahmoud 
Sent: Wednesday, June 23, 2021 1:56 PM
To: Nelson, Eric ; G Edhaya Chandran 
; gao...@byosoft.com.cn; devel@edk2.groups.io
Cc: Samer El-Haj-Mahmoud 
Subject: RE: Proposing a new area of the edk2-test repository

+edk2 list

I am not against adding additional test tools to edk2-test. Just feel like 
there is a need to organize and have a strategy, rather than just use edk2-test 
as a dumping group of miscellaneous tools.

There is already a place for apps under 
https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Application

We also have a number of EDK2 misc applications that use edk2-libc in 
https://github.com/tianocore/edk2-libc/tree/master/AppPkg/Applications

A couple of questions:

  *   Do you expect more apps from WinTestPkg to be contributed to TianoCore? 
And are they all around testing specific Windows requirements? If so, then 
having an edk2-test/WinTestPkg makes sense to me, as you will have a collection 
of useful testing app targeting specific area.
 *   But what about other OSes?
  *   If this is a one-off test app and other WinTestPkg apps are not going to 
be contributed, then does it make sense to put this under 
MdeModulePkg/Application ?



From: Nelson, Eric mailto:eric.nel...@intel.com>>
Sent: Wednesday, June 23, 2021 3:10 PM
To: G Edhaya Chandran 
mailto:edhaya.chand...@arm.com>>; 
gao...@byosoft.com.cn
Cc: Samer El-Haj-Mahmoud 
mailto:samer.el-haj-mahm...@arm.com>>
Subject: RE: Proposing a new area of the edk2-test repository


Hi Edhay,

Do you have any more questions?
What do you think of creating another directory in edk2-test, for other test 
apps, in addition to uefi-sct, such as ResumeOK.efi?

Thanks,
__e


From: Nelson, Eric
Sent: Tuesday, June 15, 2021 12:00 PM
To: G Edhaya Chandran 
mailto:edhaya.chand...@arm.com>>; 
gao...@byosoft.com.cn
Cc: Samer El-Haj-Mahmoud 
mailto:samer.el-haj-mahm...@arm.com>>
Subject: RE: Proposing a new area of the edk2-test repository


Hi Edhay,

ResumeOK.efi is a tool I wrote from the HelloWorld example, that validates 
Windows resume from S4 requirements, specifically that the memory-map run-time 
memory regions don’t change, and secondly that PCI devices don’t disappear from 
the system, both conditions would cause Windows to fail to resume from S4.

You install the tool to the root of the ESP, and set it as the default/top 
entry in the boot manager, and launch it.  (Disable Secure Boot.)

It runs warm, cold, and 60s ACPI RTC wake cycles, infinitely looking for errors.

ResumeOK.efi writes a file to the root of the ESP, ResumeOK.map, which contains 
the ACPI Facs->HardwareSignature, a list of the PCI devices in the system, and 
a copy of its memory map, from the first time it runs.

During each test pass, it runs a barrage of tests:


  1.  Free memory test – does the available

Re: [EXTERNAL] Re: [edk2-devel] NetworkPkg: Unexpected DHCP RELEASE after PXE server reply on IPv6

2021-06-25 Thread Bret Barkelew via groups.io
+ @LathaKannan Arumugam

- Bret

From: Rabeda, Maciej 
Sent: Friday, June 25, 2021 7:40:16 AM
To: devel@edk2.groups.io ; Bret Barkelew 
; Bret Barkelew 
Subject: [EXTERNAL] Re: [edk2-devel] NetworkPkg: Unexpected DHCP RELEASE after 
PXE server reply on IPv6

Looking at it. Any chance to get Wireshark trace for this scenario?

On 25-Jun-21 09:25, brbarkel via groups.io wrote:
Just poking this to see if anyone has any ideas. Thanks!




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77090): https://edk2.groups.io/g/devel/message/77090
Mute This Topic: https://groups.io/mt/83787800/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] Re: [edk2-devel] [PATCH v1 0/5] EDK2 Code First: PI Specification: Update EFI_MM_COMMUNICATE_HEADER

2021-06-28 Thread Bret Barkelew via groups.io
The fact that it may vary per ABI seems like a pretty big gotcha if the SMM/MM 
Core was compiled at a different time or on a different system than the module 
that’s invoking the communication.

- Bret

From: Marvin Häuser
Sent: Monday, June 28, 2021 8:43 AM
To: Laszlo Ersek; Kun Qin; 
Kinney, Michael D; 
devel@edk2.groups.io
Cc: Wang, Jian J; Wu, Hao 
A; Dong, Eric; Ni, 
Ray; Liming Gao; Liu, 
Zhiguang; Andrew Fish; 
Lindholm, Leif; Bret 
Barkelew; Michael 
Kubacki
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v1 0/5] EDK2 Code First: PI 
Specification: Update EFI_MM_COMMUNICATE_HEADER

On 28.06.21 16:57, Laszlo Ersek wrote:
> On 06/25/21 20:47, Kun Qin wrote:
>> Hi Mike,
>>
>> Thanks for the information. I can update the patch and proposed spec
>> change to use flexible array in v-next if there is no other concerns.
>>
>> After switching to flexible array, OFFSET_OF (Data) should lead to the
>> same result as sizeof.
> This may be true on specific compilers, but it is *not* guaranteed by
> the C language standard.

Sorry, for completeness sake... :)

I don't think it really depends on the compiler (but can vary per ABI),
but it's a conceptual issue with alignment requirements. Assuming
natural alignment and the usual stuff, for "struct s { uint64_t a;
uint32_t b; uint8_t c[]; }" the alignment requirement is 8 Bytes, where
there are 4 Bytes of padding after "b" (as "c" may as well be empty).
"c" however is guaranteed to start after b in the same fashion as if it
was declared with the maximum amount of elements that fit the memory. So
if we take 4 elements for "c", and note that "c" has an alignment
requirement of 1 Byte, c[0 .. 3] will alias the padding after "b". For
"sizeof" this means that the padding is included, whereas for "offsetof"
it is not, yielding "sizeof(struct s) == offsetof(struct s, c) + 4".
That is what I meant by "wasted space" earlier, but this could possibly
be made nicer with macros as necessary.

As for this specific struct, the values should be identical as it is padded.

Best regards,
Marvin

>
> Quoting C99 6.7.2.1 "Structure and union specifiers", paragraph 16:
>
> "In most situations, the flexible array member is ignored. In
> particular, the size of the structure is as if the flexible array member
> were omitted except that it may have more trailing padding than the
> omission would imply."
>
> Quoting footnotes 17 and 19,
>
> (17)  [...]
>struct s { int n; double d[]; };
>[...]
>
> (19)  [...]
>the expressions:
>[...]
>sizeof (struct s) >= offsetof(struct s, d)
>
>are always equal to 1.
>
> Thanks
> Laszlo
>
>
>
>> While sizeof would be a preferred way to move
>> forward.
>>
>> Regards,
>> Kun
>>
>> On 06/24/2021 08:25, Kinney, Michael D wrote:
>>> Hello,
>>>
>>> Flexible array members are supported and should be used.  The old style
>>> of adding an array of size [1] at the end of a structure was used at a
>>> time
>>> flexible array members were not supported by all compilers (late 1990's).
>>> The workarounds used to handle the array of size [1] are very
>>> confusing when
>>> reading the C  code and the fact that sizeof() does not produce the
>>> expected
>>> result make it even worse.
>>>
>>> If we use flexible array members in this proposed change then there is
>>> no need to use OFFSET_OF().  Correct?
>>>
>>> Mike
>>>
>>>
 -Original Message-
 From: Marvin Häuser 
 Sent: Thursday, June 24, 2021 1:00 AM
 To: Kun Qin ; Laszlo Ersek ;
 devel@edk2.groups.io
 Cc: Wang, Jian J ; Wu, Hao A
 ; Dong, Eric ; Ni, Ray
 ; Kinney, Michael D ;
 Liming Gao ; Liu, Zhiguang
 ; Andrew Fish ; Leif
 Lindholm ; Bret Barkelew
 ; michael.kuba...@microsoft.com
 Subject: Re: [edk2-devel] [PATCH v1 0/5] EDK2 Code First: PI
 Specification: Update EFI_MM_COMMUNICATE_HEADER

 Hey Kun,

 Why would you rely on undefined behaviours? The OFFSET_OF macro is
 well-defined for GCC and Clang as it's implemented by an intrinsic, and
 while the expression for the MSVC compiler is undefined behaviour as per
 the C standard, it is well-defined for MSVC due to their own
 implementation being identical. From my standpoint, all supported
 compilers will yield well-defined behaviour even this way. OFFSET_OF on
 flexible arrays is not UB in any case to my knowledge.

 However, the same way as your new suggestion, you can replace OFFSET_OF
 with sizeof. While this *can* lead to wasted space with certain
 structure layouts

Re: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in Linux?

2021-06-29 Thread Bret Barkelew via groups.io
Here’s some of the documentation, but I believe the standard apt mono-devel 
package is now up-to-date enough that the extra apt source is not necessary.

edk2-pytool-extensions/using_extdep.md at master · 
tianocore/edk2-pytool-extensions 
(github.com)

- Bret

From: Rebecca Cran via groups.io
Sent: Tuesday, June 29, 2021 5:12 AM
To: devel@edk2.groups.io; 
steven@intel.com
Subject: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in Linux?


NuGet.exe is a .NET assembly/executable, so on Linux you'll need to install 
Mono 
(https://www.mono-project.com/).



--

Rebecca Cran




On 6/28/21 7:45 PM, Steven Shi wrote:
Hello,
I’m interested in the edk2 CI unit 
tests(https://github.com/tianocore/edk2/tree/master/.pytool).
 I tested it in my local. It works well in Windows but does not work in Linux. 
It looks the NuGet in pytool only has windows version 
(C:\steven\unit_test_env\Lib\site-packages\edk2toolext\bin\NuGet.exe) but not 
support the Linux. Below is my detail test steps. Do the edk2 CI unit tests 
work in Linux?


  1.  Windows :

c:\steven>py -m venv unit_test_env

c:\steven>cd  c:\steven\edk2

c:\steven\edk2>c:\steven\unit_test_env\Scripts\activate.bat

(unit_test_env) c:\steven\edk2>pip install --upgrade -r pip-requirements.txt

(unit_test_env) c:\steven\edk2>stuart_setup -c .pytool/CISettings.py 
TOOL_CHAIN_TAG=VS2019

(unit_test_env) c:\steven\edk2>stuart_update -c .pytool/CISettings.py 
TOOL_CHAIN_TAG=VS2019

(unit_test_env) c:\steven\edk2>edksetup.bat

(unit_test_env) c:\steven\edk2>edksetup.bat Rebuild

(unit_test_env) c:\steven\edk2>stuart_ci_build -c .pytool/CISettings.py 
TOOL_CHAIN_TAG=VS2019 -a X64,IA32 -t DEBUG --verbose

…

PROGRESS - Overall Build Status: Success

SECTION - Summary

PROGRESS - Success


  1.  Linux:
jshi19@ub2-uefi-b01:~/wksp_efi$ python3 -m venv unit_test_env
jshi19@ub2-uefi-b01:~/wksp_efi$ source unit_test_env/bin/activate
(unit_test_env) jshi19@ub2-uefi-b01:~/wksp_efi/edk2-2$ pip install --upgrade -r 
pip-requirements.txt
(unit_test_env) jshi19@ub2-uefi-b01:~/wksp_efi/edk2-2$ make -C BaseTools/
(unit_test_env) jshi19@ub2-uefi-b01:~/wksp_efi/edk2-2$ stuart_setup -c 
.pytool/CISettings.py TOOL_CHAIN_TAG=GCC5
(unit_test_env) jshi19@ub2-uefi-b01:~/wksp_efi/edk2-2$ stuart_update -c 
.pytool/CISettings.py TOOL_CHAIN_TAG=GCC5
SECTION - Init SDE
WARNING - Using Pip Tools based BaseTools
SECTION - Loading Plugins
SECTION - Start Invocable Tool
SECTION - Initial update of environment
UpdatingWARNING - [SDE] Failed to fetch NugetDependecy: 
edk2-acpica-iasl@20200717.0.0: [Nuget] We 
failed to install this version 20200717.0.0 of edk2-acpica-iasl
WARNING - [SDE] Failed to fetch NugetDependecy: 
mu_nasm@2.15.05: [Nuget] We failed to install this 
version 2.15.05 of mu_nasm
. Done
SECTION -   Updated/Verified 3 dependencies
SECTION - Second pass update of environment
UpdatingWARNING - [SDE] Failed to fetch NugetDependecy: 
edk2-acpica-iasl@20200717.0.0: [Nuget] We 
failed to install this version 20200717.0.0 of edk2-acpica-iasl
WARNING - [SDE] Failed to fetch NugetDependecy: 
mu_nasm@2.15.05: [Nuget] We failed to install this 
version 2.15.05 of mu_nasm
. Done
SECTION -   Updated/Verified 3 dependencies
ERROR - We were unable to successfully update 2 dependencies in environment
SECTION - Summary
ERROR - Error




Thanks

Steven Shi







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77279): https://edk2.groups.io/g/devel/message/77279
Mute This Topic: https://groups.io/mt/83871657/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] Do the edk2 CI unit tests work in Linux?

2021-06-29 Thread Bret Barkelew via groups.io
Which executable are you referring to?

Also, yes, it is entirely possible that Linux has more dependencies since the 
dependency list has conditionals based on your OS.

- Bret

From: Steven Shi via groups.io
Sent: Tuesday, June 29, 2021 8:44 AM
To: devel@edk2.groups.io; 
rebe...@nuviainc.com
Subject: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in Linux?

Cran, Thanks. I’m curious whether the .pytool has native Linux executable 
binary to run? It looks the edk2 CI framework has more dependency in Linux than 
Windows.


Thanks

Steven Shi
Intel\IAGS\SFP\FIA (Firmware Infrastructure Automation)


From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
Sent: Tuesday, June 29, 2021 8:13 PM
To: devel@edk2.groups.io; Shi, Steven 
Subject: Re: [edk2-devel] Do the edk2 CI unit tests work in Linux?


NuGet.exe is a .NET assembly/executable, so on Linux you'll need to install 
Mono 
(https://www.mono-project.com/).



--

Rebecca Cran




On 6/28/21 7:45 PM, Steven Shi wrote:
Hello,
I’m interested in the edk2 CI unit 
tests(https://github.com/tianocore/edk2/tree/master/.pytool).
 I tested it in my local. It works well in Windows but does not work in Linux. 
It looks the NuGet in pytool only has windows version 
(C:\steven\unit_test_env\Lib\site-packages\edk2toolext\bin\NuGet.exe) but not 
support the Linux. Below is my detail test steps. Do the edk2 CI unit tests 
work in Linux?


  1.  Windows :

c:\steven>py -m venv unit_test_env

c:\steven>cd  c:\steven\edk2

c:\steven\edk2>c:\steven\unit_test_env\Scripts\activate.bat

(unit_test_env) c:\steven\edk2>pip install --upgrade -r pip-requirements.txt

(unit_test_env) c:\steven\edk2>stuart_setup -c .pytool/CISettings.py 
TOOL_CHAIN_TAG=VS2019

(unit_test_env) c:\steven\edk2>stuart_update -c .pytool/CISettings.py 
TOOL_CHAIN_TAG=VS2019

(unit_test_env) c:\steven\edk2>edksetup.bat

(unit_test_env) c:\steven\edk2>edksetup.bat Rebuild

(unit_test_env) c:\steven\edk2>stuart_ci_build -c .pytool/CISettings.py 
TOOL_CHAIN_TAG=VS2019 -a X64,IA32 -t DEBUG --verbose

…

PROGRESS - Overall Build Status: Success

SECTION - Summary

PROGRESS - Success


  1.  Linux:
jshi19@ub2-uefi-b01:~/wksp_efi$ python3 -m venv unit_test_env
jshi19@ub2-uefi-b01:~/wksp_efi$ source unit_test_env/bin/activate
(unit_test_env) jshi19@ub2-uefi-b01:~/wksp_efi/edk2-2$ pip install --upgrade -r 
pip-requirements.txt
(unit_test_env) jshi19@ub2-uefi-b01:~/wksp_efi/edk2-2$ make -C BaseTools/
(unit_test_env) jshi19@ub2-uefi-b01:~/wksp_efi/edk2-2$ stuart_setup -c 
.pytool/CISettings.py TOOL_CHAIN_TAG=GCC5
(unit_test_env) jshi19@ub2-uefi-b01:~/wksp_efi/edk2-2$ stuart_update -c 
.pytool/CISettings.py TOOL_CHAIN_TAG=GCC5
SECTION - Init SDE
WARNING - Using Pip Tools based BaseTools
SECTION - Loading Plugins
SECTION - Start Invocable Tool
SECTION - Initial update of environment
UpdatingWARNING - [SDE] Failed to fetch NugetDependecy: 
edk2-acpica-iasl@20200717.0.0: [Nuget] We 
failed to install this version 20200717.0.0 of edk2-acpica-iasl
WARNING - [SDE] Failed to fetch NugetDependecy: 
mu_nasm@2.15.05: [Nuget] We failed to install this 
version 2.15.05 of mu_nasm
. Done
SECTION -   Updated/Verified 3 dependencies
SECTION - Second pass update of environment
UpdatingWARNING - [SDE] Failed to fetch NugetDependecy: 
edk2-acpica-iasl@20200717.0.0: [Nuget] We 
failed to install this version 20200717.0.0 of edk2-acpica-iasl
WARNING - [SDE] Failed to fetch NugetDependecy: 
mu_nasm@2.15.05: [Nuget] We failed to install this 
version 2.15.05 of mu_nasm
. Done
SECTION -   Updated/Verified 3 dependencies
ERROR - We were unable to successfully update 2 dependencies in environment
SECTION - Summary
ERROR - Error




Thanks

Steven Shi







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77280): https://edk2.groups.io/g/devel/message/77280
Mute This Topic: https://groups.io/mt/83860276/21656
Group Owner: devel+ow...@ed

Re: [EXTERNAL] Re: [edk2-devel] [PATCH v1 0/5] EDK2 Code First: PI Specification: Update EFI_MM_COMMUNICATE_HEADER

2021-06-29 Thread Bret Barkelew via groups.io
Good note. Thanks!

- Bret

From: Marvin Häuser
Sent: Tuesday, June 29, 2021 1:58 AM
To: Bret Barkelew; Laszlo 
Ersek; Kun Qin; Kinney, 
Michael D; 
devel@edk2.groups.io
Cc: Wang, Jian J; Wu, Hao 
A; Dong, Eric; Ni, 
Ray; Liming Gao; Liu, 
Zhiguang; Andrew Fish; 
Lindholm, Leif; Michael 
Kubacki
Subject: Re: [EXTERNAL] Re: [edk2-devel] [PATCH v1 0/5] EDK2 Code First: PI 
Specification: Update EFI_MM_COMMUNICATE_HEADER

Generally yes, but gladly not for EDK II. Default GNU ABI uses 32-bit
alignment for 64-bit integers on IA32 (which led to a (non-critical)
mistake in our PE paper :( ) for example, but UEFI / EDK II (seem to)
successfully dictate natural alignment consistently. Possibly we could
introduce some STATIC_ASSERTs around important cases (e.g. UINT64 on
32-bit platforms) to ensure compilers keep it that way, once the ALIGNOF
macro is introduced.

Best regards,
Marvin

On 29.06.21 08:49, Bret Barkelew wrote:
>
> The fact that it may vary per ABI seems like a pretty big gotcha if
> the SMM/MM Core was compiled at a different time or on a different
> system than the module that’s invoking the communication.
>
> - Bret
>
> *From: *Marvin Häuser 
> *Sent: *Monday, June 28, 2021 8:43 AM
> *To: *Laszlo Ersek ; Kun Qin
> ; Kinney, Michael D
> ; devel@edk2.groups.io
> 
> *Cc: *Wang, Jian J ; Wu, Hao A
> ; Dong, Eric ;
> Ni, Ray ; Liming Gao
> ; Liu, Zhiguang
> ; Andrew Fish ;
> Lindholm, Leif ; Bret Barkelew
> ; Michael Kubacki
> 
> *Subject: *[EXTERNAL] Re: [edk2-devel] [PATCH v1 0/5] EDK2 Code First:
> PI Specification: Update EFI_MM_COMMUNICATE_HEADER
>
> On 28.06.21 16:57, Laszlo Ersek wrote:
> > On 06/25/21 20:47, Kun Qin wrote:
> >> Hi Mike,
> >>
> >> Thanks for the information. I can update the patch and proposed spec
> >> change to use flexible array in v-next if there is no other concerns.
> >>
> >> After switching to flexible array, OFFSET_OF (Data) should lead to the
> >> same result as sizeof.
> > This may be true on specific compilers, but it is *not* guaranteed by
> > the C language standard.
>
> Sorry, for completeness sake... :)
>
> I don't think it really depends on the compiler (but can vary per ABI),
> but it's a conceptual issue with alignment requirements. Assuming
> natural alignment and the usual stuff, for "struct s { uint64_t a;
> uint32_t b; uint8_t c[]; }" the alignment requirement is 8 Bytes, where
> there are 4 Bytes of padding after "b" (as "c" may as well be empty).
> "c" however is guaranteed to start after b in the same fashion as if it
> was declared with the maximum amount of elements that fit the memory. So
> if we take 4 elements for "c", and note that "c" has an alignment
> requirement of 1 Byte, c[0 .. 3] will alias the padding after "b". For
> "sizeof" this means that the padding is included, whereas for "offsetof"
> it is not, yielding "sizeof(struct s) == offsetof(struct s, c) + 4".
> That is what I meant by "wasted space" earlier, but this could possibly
> be made nicer with macros as necessary.
>
> As for this specific struct, the values should be identical as it is
> padded.
>
> Best regards,
> Marvin
>
> >
> > Quoting C99 6.7.2.1 "Structure and union specifiers", paragraph 16:
> >
> > "In most situations, the flexible array member is ignored. In
> > particular, the size of the structure is as if the flexible array member
> > were omitted except that it may have more trailing padding than the
> > omission would imply."
> >
> > Quoting footnotes 17 and 19,
> >
> > (17)  [...]
> >struct s { int n; double d[]; };
> >[...]
> >
> > (19)  [...]
> >the expressions:
> >[...]
> >sizeof (struct s) >= offsetof(struct s, d)
> >
> >are always equal to 1.
> >
> > Thanks
> > Laszlo
> >
> >
> >
> >> While sizeof would be a preferred way to move
> >> forward.
> >>
> >> Regards,
> >> Kun
> >>
> >> On 06/24/2021 08:25, Kinney, Michael D wrote:
> >>> Hello,
> >>>
> >>> Flexible array members are supported and should be used.  The old
> style
> >>> of adding an array of size [1] at the end of a structure was used at a
> >>> time
> >>> flexible array members were not suppo

Re: [EXTERNAL] Re: [edk2-devel] NetworkPkg: Unexpected DHCP RELEASE after PXE server reply on IPv6

2021-06-29 Thread Bret Barkelew via groups.io
Thanks, Maciej! We’ll investigate!

- Bret

From: Rabeda, Maciej 
Sent: Tuesday, June 29, 2021 9:39:59 AM
To: devel@edk2.groups.io ; LathaKannan Arumugam 
; Bret Barkelew 
Subject: Re: [EXTERNAL] Re: [edk2-devel] NetworkPkg: Unexpected DHCP RELEASE 
after PXE server reply on IPv6

Additionally, for claim that IPv4 does not do that, please provide Wireshark 
trace, if available.

On 29-Jun-21 18:36, Maciej Rabeda wrote:
Hi guys,

Finally got some time to look into it.

Long story short, this smells like infrastructure problem.
SARR passes over 546/547 port pair. That is between UEFI PXE client and DHCP 
server (even if it is the same machine).
The next packet is essentially a Boot Server choice step. UEFI PXE client sends 
a unicast discovery packet towards Boot server (same machine, same address) 
coded as DHCP Request.
The release packet is a direct reaction to 3 second timeout (see time diff 
between packet 9 and 11).

See section 2.2.1 in PXE spec: 
http://www.pix.net/software/pxeboot/archive/pxespec.pdf

Please verify that your WDS service is running correctly, since clearly there 
is no reaction to that packet from Boot server.

[cid:part2.DA8CACBA.5A309C91@linux.intel.com]

On 28-Jun-21 22:05, LathaKannan Arumugam via groups.io wrote:
Can you please help us on this issues?
Get Outlook for 
Android

From: devel@edk2.groups.io 
 on behalf of LathaKannan 
Arumugam via groups.io 

Sent: Friday, June 25, 2021 1:11:42 PM
To: Bret Barkelew 
; Rabeda, 
Maciej ; 
devel@edk2.groups.io 

Subject: Re: [EXTERNAL] Re: [edk2-devel] NetworkPkg: Unexpected DHCP RELEASE 
after PXE server reply on IPv6


Any inputs?

We kind of blocked on this for a week.  Kindly look into packet capture and 
suggest a path forward.





From: LathaKannan Arumugam
Sent: Friday, June 25, 2021 9:23 AM
To: Bret Barkelew 
; Rabeda, 
Maciej ; 
devel@edk2.groups.io
Subject: RE: [EXTERNAL] Re: [edk2-devel] NetworkPkg: Unexpected DHCP RELEASE 
after PXE server reply on IPv6



Attached packet captured from server.



From: Bret Barkelew 
mailto:bret.barke...@microsoft.com>>
Sent: Friday, June 25, 2021 9:19 AM
To: Rabeda, Maciej 
mailto:maciej.rab...@linux.intel.com>>; 
devel@edk2.groups.io; LathaKannan Arumugam 
mailto:larumu...@microsoft.com>>
Subject: Re: [EXTERNAL] Re: [edk2-devel] NetworkPkg: Unexpected DHCP RELEASE 
after PXE server reply on IPv6



+ @LathaKannan Arumugam



- Bret



From: Rabeda, Maciej 
mailto:maciej.rab...@linux.intel.com>>
Sent: Friday, June 25, 2021 7:40:16 AM
To: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>>; Bret Barkelew 
mailto:bret.barke...@microsoft.com>>; Bret 
Barkelew mailto:bret.barke...@microsoft.com>>
Subject: [EXTERNAL] Re: [edk2-devel] NetworkPkg: Unexpected DHCP RELEASE after 
PXE server reply on IPv6



Looking at it. Any chance to get Wireshark trace for this scenario?

On 25-Jun-21 09:25, brbarkel via groups.io wrote:

Just poking this to see if anyone has any ideas. Thanks!







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77294): https://edk2.groups.io/g/devel/message/77294
Mute This Topic: https://groups.io/mt/83787800/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in Linux?

2021-06-29 Thread Bret Barkelew via groups.io
Hmmm. If that works well, we might be able to investigate carrying both and 
picking based on the host OS.

- Bret

From: devel@edk2.groups.io  on behalf of Rebecca Cran via 
groups.io 
Sent: Tuesday, June 29, 2021 9:42:41 AM
To: devel@edk2.groups.io ; steven@intel.com 

Subject: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in Linux?


Your Linux distribution should have a nuget package available (e.g. 
https://packages.ubuntu.com/hirsute/nuget)
 but the EDK2 CI is designed to use the copy of nuget installed with the 
edk2toolext package.


--
Rebecca Cran


On 6/29/21 9:44 AM, Steven Shi wrote:

Cran, Thanks. I’m curious whether the .pytool has native Linux executable 
binary to run? It looks the edk2 CI framework has more dependency in Linux than 
Windows.





Thanks



Steven Shi

Intel\IAGS\SFP\FIA (Firmware Infrastructure Automation)





From: devel@edk2.groups.io 
 On Behalf Of Rebecca Cran
Sent: Tuesday, June 29, 2021 8:13 PM
To: devel@edk2.groups.io; Shi, Steven 

Subject: Re: [edk2-devel] Do the edk2 CI unit tests work in Linux?



NuGet.exe is a .NET assembly/executable, so on Linux you'll need to install 
Mono 
(https://www.mono-project.com/).



--

Rebecca Cran





On 6/28/21 7:45 PM, Steven Shi wrote:

Hello,

I’m interested in the edk2 CI unit 
tests(https://github.com/tianocore/edk2/tree/master/.pytool).
 I tested it in my local. It works well in Windows but does not work in Linux. 
It looks the NuGet in pytool only has windows version 
(C:\steven\unit_test_env\Lib\site-packages\edk2toolext\bin\NuGet.exe) but not 
support the Linux. Below is my detail test steps. Do the edk2 CI unit tests 
work in Linux?



  1.  Windows :

c:\steven>py -m venv unit_test_env

c:\steven>cd  c:\steven\edk2

c:\steven\edk2>c:\steven\unit_test_env\Scripts\activate.bat

(unit_test_env) c:\steven\edk2>pip install --upgrade -r pip-requirements.txt

(unit_test_env) c:\steven\edk2>stuart_setup -c .pytool/CISettings.py 
TOOL_CHAIN_TAG=VS2019

(unit_test_env) c:\steven\edk2>stuart_update -c .pytool/CISettings.py 
TOOL_CHAIN_TAG=VS2019

(unit_test_env) c:\steven\edk2>edksetup.bat

(unit_test_env) c:\steven\edk2>edksetup.bat Rebuild

(unit_test_env) c:\steven\edk2>stuart_ci_build -c .pytool/CISettings.py 
TOOL_CHAIN_TAG=VS2019 -a X64,IA32 -t DEBUG --verbose

…

PROGRESS - Overall Build Status: Success

SECTION - Summary

PROGRESS - Success



  1.  Linux:

jshi19@ub2-uefi-b01:~/wksp_efi$ python3 -m venv unit_test_env

jshi19@ub2-uefi-b01:~/wksp_efi$ source unit_test_env/bin/activate

(unit_test_env) jshi19@ub2-uefi-b01:~/wksp_efi/edk2-2$ pip install --upgrade -r 
pip-requirements.txt

(unit_test_env) jshi19@ub2-uefi-b01:~/wksp_efi/edk2-2$ make -C BaseTools/

(unit_test_env) jshi19@ub2-uefi-b01:~/wksp_efi/edk2-2$ stuart_setup -c 
.pytool/CISettings.py TOOL_CHAIN_TAG=GCC5

(unit_test_env) jshi19@ub2-uefi-b01:~/wksp_efi/edk2-2$ stuart_update -c 
.pytool/CISettings.py TOOL_CHAIN_TAG=GCC5

SECTION - Init SDE

WARNING - Using Pip Tools based BaseTools

SECTION - Loading Plugins

SECTION - Start Invocable Tool

SECTION - Initial update of environment

UpdatingWARNING - [SDE] Failed to fetch NugetDependecy: 
edk2-acpica-iasl@20200717.0.0: [Nuget] We 
failed to install this version 20200717.0.0 of edk2-acpica-iasl

WARNING - [SDE] Failed to fetch NugetDependecy: 
mu_nasm@2.15.05: [Nuget] We failed to install this 
version 2.15.05 of mu_nasm

. Done

SECTION -   Updated/Verified 3 dependencies

SECTION - Second pass update of environment

UpdatingWARNING - [SDE] Failed to fe

Re: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in Linux?

2021-07-01 Thread Bret Barkelew via groups.io
I believe the Azure DevOps build agents that are used by the EDK2 CI pipeline 
already have mono installed.

- Bret

From: Shi, Steven<mailto:steven@intel.com>
Sent: Thursday, July 1, 2021 5:54 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Bret 
Barkelew<mailto:bret.barke...@microsoft.com>; 
rebe...@nuviainc.com<mailto:rebe...@nuviainc.com>
Subject: RE: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in 
Linux?

Hi Bret, Rebecca,
Thanks for the info. Does edk2 CI run the .pytool unit tests in Linux? If yes, 
how does edk2 CI solve the nuget dependency problem in Linux right now?


Thanks

Steven Shi


From: devel@edk2.groups.io  On Behalf Of Bret Barkelew 
via groups.io
Sent: Wednesday, June 30, 2021 1:02 AM
To: devel@edk2.groups.io; rebe...@nuviainc.com; Shi, Steven 

Subject: Re: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in 
Linux?

Hmmm. If that works well, we might be able to investigate carrying both and 
picking based on the host OS.

- Bret

From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>> on behalf of Rebecca Cran 
via groups.io 
mailto:rebecca=nuviainc@groups.io>>
Sent: Tuesday, June 29, 2021 9:42:41 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>>; 
steven@intel.com<mailto:steven@intel.com> 
mailto:steven@intel.com>>
Subject: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in Linux?


Your Linux distribution should have a nuget package available (e.g. 
https://packages.ubuntu.com/hirsute/nuget<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpackages.ubuntu.com%2Fhirsute%2Fnuget&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C28bf7b813a9a4d6e365508d93cf3fd8a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637607840913328150%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Z7vCN9JUmx1kQks%2FuWKjcnMRo7koWoyxOET0bnSbN6U%3D&reserved=0>)
 but the EDK2 CI is designed to use the copy of nuget installed with the 
edk2toolext package.



--
Rebecca Cran


On 6/29/21 9:44 AM, Steven Shi wrote:

Cran, Thanks. I’m curious whether the .pytool has native Linux executable 
binary to run? It looks the edk2 CI framework has more dependency in Linux than 
Windows.





Thanks



Steven Shi

Intel\IAGS\SFP\FIA (Firmware Infrastructure Automation)





From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
<mailto:devel@edk2.groups.io> On Behalf Of Rebecca Cran
Sent: Tuesday, June 29, 2021 8:13 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Shi, Steven 
<mailto:steven@intel.com>
Subject: Re: [edk2-devel] Do the edk2 CI unit tests work in Linux?



NuGet.exe is a .NET assembly/executable, so on Linux you'll need to install 
Mono 
(https://www.mono-project.com/<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.mono-project.com%2F&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C28bf7b813a9a4d6e365508d93cf3fd8a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637607840913338106%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=uPkpInnWMx%2FP35GUXlbffQwxbLya9DDDegyLJvtuScU%3D&reserved=0>).



--

Rebecca Cran





On 6/28/21 7:45 PM, Steven Shi wrote:

Hello,

I’m interested in the edk2 CI unit 
tests(https://github.com/tianocore/edk2/tree/master/.pytool<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Ftree%2Fmaster%2F.pytool&data=04%7C01%7Cbret.barkelew%40microsoft.com%7C28bf7b813a9a4d6e365508d93cf3fd8a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637607840913338106%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=v%2FqnYohY9bDCIAC8ZmqPkV3RvhaIuyQEXfkY9JNyIqs%3D&reserved=0>).
 I tested it in my local. It works well in Windows but does not work in Linux. 
It looks the NuGet in pytool only has windows version 
(C:\steven\unit_test_env\Lib\site-packages\edk2toolext\bin\NuGet.exe) but not 
support the Linux. Below is my detail test steps. Do the edk2 CI unit tests 
work in Linux?



  1.  Windows :

c:\steven>py -m venv unit_test_env

c:\steven>cd  c:\steven\edk2

c:\steven\edk2>c:\steven\unit_test_env\Scripts\activate.bat

(unit_test_env) c:\steven\edk2>pip install --upgrade -r pip-requirements.txt

(unit_test_env) c:\steven\edk2>stuart_setup -c .pytool/CISettings.py 
TOOL_CHAIN_TAG=VS2019

(unit_test_env) c:\steven\edk2>stuart_update -c .pytool/CISettings.py 
TOOL_CHAIN_TAG=VS2019

(unit_test_env) c:\steven\edk2>edksetup.bat

(unit_test_env) c:\steven\edk2>edksetup.bat Rebuild

(unit_test_env) c:\steven\edk2>stuart_ci_build -c .pytool/CISettings.py 
TOOL_CHAIN_TAG=VS2019 -a X64,IA32 -t DEBUG --verbose

…

PROGRESS - Overall Build Status: Success

Re: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in Linux?

2021-07-01 Thread Bret Barkelew via groups.io
7;System.Net.Http, Version=4.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

System.AggregateException: One or more errors occurred. (Could not load file or 
assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.) (Could not load 
file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.) (Could not load 
file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.) (Could not load 
file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.) (Could not load 
file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.) ---> 
System.IO.FileNotFoundException: Could not load file or assembly 
'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

   --- End of inner exception stack trace ---

  at NuGet.CommandLine.Program.Initialize (NuGet.IFileSystem fileSystem, 
NuGet.CommandLine.IConsole console) [0x000ce] in 
:0

  at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, 
System.String[] args) [0x000d8] in :0

---> (Inner Exception #0) System.IO.FileNotFoundException: Could not load file 
or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

File name: 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a'<---



---> (Inner Exception #1) System.IO.FileNotFoundException: Could not load file 
or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

File name: 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a'<---



---> (Inner Exception #2) System.IO.FileNotFoundException: Could not load file 
or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

File name: 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a'<---



---> (Inner Exception #3) System.IO.FileNotFoundException: Could not load file 
or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

File name: 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a'<---



---> (Inner Exception #4) System.IO.FileNotFoundException: Could not load file 
or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

File name: 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a'<---





Thanks



Steven Shi





From: Bret Barkelew 
Sent: Friday, July 2, 2021 9:04 AM
To: Shi, Steven ; devel@edk2.groups.io; 
rebe...@nuviainc.com
Subject: RE: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in 
Linux?



I believe the Azure DevOps build agents that are used by the EDK2 CI pipeline 
already have mono installed.



- Bret



From: Shi, Steven<mailto:steven@intel.com>
Sent: Thursday, July 1, 2021 5:54 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Bret 
Barkelew<mailto:bret.barke...@microsoft.com>; 
rebe...@nuviainc.com<mailto:rebe...@nuviainc.com>
Subject: RE: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in 
Linux?



Hi Bret, Rebecca,

Thanks for the info. Does edk2 CI run the .pytool unit tests in Linux? If yes, 
how does edk2 CI solve the nuget dependency problem in Linux right now?





Thanks



Steven Shi





From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>> On Behalf Of Bret Barkelew 
via groups.io
Sent: Wednesday, June 30, 2021 1:02 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
rebe...@nuviainc.com<mailto:rebe...@nuviainc.com>; Shi, Steven 
mailto:steven@intel.com>>
Subject: Re: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in 
Linux?



Hmmm. If that works well, we might be able to investigate carrying both and 
picking based on the host OS.



- Bret



From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>> on behalf of Rebecca Cran 
via groups.io 
mailto:rebecca=nuviainc@groups.io>>
Sent: Tuesday, June 29, 2021 9:42:41 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>>; 
steven@intel.com<mailto:steven@intel.com> 
mailto:stev

Re: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in Linux?

2021-07-01 Thread Bret Barkelew via groups.io
sion=4.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
  Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
  Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
  Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
System.AggregateException: One or more errors occurred. (Could not load file or 
assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.) (Could not load 
file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.) (Could not load 
file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.) (Could not load 
file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.) (Could not load 
file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.) ---> 
System.IO.FileNotFoundException: Could not load file or assembly 
'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
   --- End of inner exception stack trace ---
  at NuGet.CommandLine.Program.Initialize (NuGet.IFileSystem fileSystem, 
NuGet.CommandLine.IConsole console) [0x000ce] in 
:0
  at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, 
System.String[] args) [0x000d8] in :0
---> (Inner Exception #0) System.IO.FileNotFoundException: Could not load file 
or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
File name: 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a'<---

---> (Inner Exception #1) System.IO.FileNotFoundException: Could not load file 
or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
File name: 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a'<---

---> (Inner Exception #2) System.IO.FileNotFoundException: Could not load file 
or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
File name: 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a'<---

---> (Inner Exception #3) System.IO.FileNotFoundException: Could not load file 
or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
File name: 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a'<---

---> (Inner Exception #4) System.IO.FileNotFoundException: Could not load file 
or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
File name: 'System.Net.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a'<---


Thanks

Steven Shi


From: Bret Barkelew 
<mailto:bret.barke...@microsoft.com>
Sent: Friday, July 2, 2021 9:04 AM
To: Shi, Steven <mailto:steven@intel.com>; 
devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
rebe...@nuviainc.com<mailto:rebe...@nuviainc.com>
Subject: RE: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in 
Linux?

I believe the Azure DevOps build agents that are used by the EDK2 CI pipeline 
already have mono installed.

- Bret

From: Shi, Steven<mailto:steven@intel.com>
Sent: Thursday, July 1, 2021 5:54 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Bret 
Barkelew<mailto:bret.barke...@microsoft.com>; 
rebe...@nuviainc.com<mailto:rebe...@nuviainc.com>
Subject: RE: [EXTERNAL] Re: [edk2-devel] Do the edk2 CI unit tests work in 
Linux?

Hi Bret, Rebecca,
Thanks for the info. Does edk2 CI run the .pytool unit tests in Linux? If yes, 
how does edk2 CI solve the nuget dependency problem in Linux right now?


Thanks

Steven Shi


From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>> On Behalf Of Bret Barkelew 
via groups.io
Sent: Wednesday, June 30, 2021 1:02 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
rebe...@nuviainc.com<mailto:rebe...@nuviainc.com>; Shi, Steven 
mailto:steven@intel.com>>
Subject: Re: [EXTERNAL] Re: [edk2-dev

Re: [EXTERNAL] [edk2-devel] [Patch 1/1] MdePkg/Include: Add STATIC_ASSERT for L'' and L"" strings

2021-07-07 Thread Bret Barkelew via groups.io
I like it.
Do you have an extra space after the (L’A’) and (L”A”)?

Reviewed-by: Bret Barkelew 

- Bret

From: Michael D Kinney via 
groups.io
Sent: Wednesday, July 7, 2021 3:43 PM
To: devel@edk2.groups.io
Cc: Liming Gao; Zhiguang 
Liu
Subject: [EXTERNAL] [edk2-devel] [Patch 1/1] MdePkg/Include: Add STATIC_ASSERT 
for L'' and L"" strings

Add STATIC_ASSERT() macros to verify that the compiler is
configured correctly for the use of L'' and L"" strings.

Cc: Liming Gao 
Cc: Zhiguang Liu 
Signed-off-by: Michael D Kinney 
---
 MdePkg/Include/Base.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 8e4271f6eaf5..2da08b0c787f 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -6,7 +6,7 @@
   environment. There are a set of base libraries in the Mde Package that can
   be used to implement base modules.

-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
 Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -821,6 +821,8 @@ STATIC_ASSERT (sizeof (INT64)   == 8, "sizeof (INT64) does 
not meet UEFI Specifi
 STATIC_ASSERT (sizeof (UINT64)  == 8, "sizeof (UINT64) does not meet UEFI 
Specification Data Type requirements");
 STATIC_ASSERT (sizeof (CHAR8)   == 1, "sizeof (CHAR8) does not meet UEFI 
Specification Data Type requirements");
 STATIC_ASSERT (sizeof (CHAR16)  == 2, "sizeof (CHAR16) does not meet UEFI 
Specification Data Type requirements");
+STATIC_ASSERT (sizeof (L'A')== 2, "sizeof (L'A') does not meet UEFI 
Specification Data Type requirements");
+STATIC_ASSERT (sizeof (L"A")== 4, "sizeof (L\"A\") does not meet UEFI 
Specification Data Type requirements");

 //
 // The following three enum types are used to verify that the compiler
--
2.32.0.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77565): https://edk2.groups.io/g/devel/message/77565
Mute This Topic: https://groups.io/mt/84056904/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [EXTERNAL] [Patch 3/3] .azurepipelines: Remove FINISHED and FAILED states

2021-07-07 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 

- Bret

From: Michael D Kinney
Sent: Wednesday, July 7, 2021 8:49 PM
To: devel@edk2.groups.io
Cc: Sean Brogan; Bret 
Barkelew; Liming 
Gao
Subject: [EXTERNAL] [Patch 3/3] .azurepipelines: Remove FINISHED and FAILED 
states

Remove 10 second delay workarounds for issues observed
when Mergify was originally enabled.  These issues are
no longer present when GitHub branch protections are
used for status checks.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Liming Gao 
Signed-off-by: Michael D Kinney 
---
 .../templates/pr-gate-build-job.yml   | 20 ---
 1 file changed, 20 deletions(-)

diff --git a/.azurepipelines/templates/pr-gate-build-job.yml 
b/.azurepipelines/templates/pr-gate-build-job.yml
index 3f9a28024567..207acc76316f 100644
--- a/.azurepipelines/templates/pr-gate-build-job.yml
+++ b/.azurepipelines/templates/pr-gate-build-job.yml
@@ -67,23 +67,3 @@ jobs:
   build_pkgs: $(Build.Pkgs)
   build_targets: $(Build.Targets)
   build_archs: ${{ parameters.arch_list }}
-
-- job: FINISHED
-  dependsOn: Build_${{ parameters.tool_chain_tag }}
-  condition: succeeded()
-  steps:
-  - checkout: none
-  - script: |
-  echo FINISHED
-  sleep 10
-displayName: FINISHED
-
-- job: FAILED
-  dependsOn: Build_${{ parameters.tool_chain_tag }}
-  condition: failed()
-  steps:
-  - checkout: none
-  - script: |
-  echo FAILED
-  sleep 10
-displayName: FAILED
--
2.32.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77579): https://edk2.groups.io/g/devel/message/77579
Mute This Topic: https://groups.io/mt/84061155/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] [edk2-devel] [Patch 1/3] BaseTools/Scripts: Ignore Mergify merge commits in PatchCheck.py

2021-07-07 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 

- Bret


From: devel@edk2.groups.io  on behalf of Michael D Kinney 
via groups.io 
Sent: Wednesday, July 7, 2021 8:49:00 PM
To: devel@edk2.groups.io 
Cc: Feng, Bob C ; Liming Gao ; 
Chen, Yuwei 
Subject: [EXTERNAL] [edk2-devel] [Patch 1/3] BaseTools/Scripts: Ignore Mergify 
merge commits in PatchCheck.py

Mergify adds merge commits to a PR when processing PRs using
the queue feature with auto rebase.  Update PatchCheck.py
to ignore commit message issues with these merge commits.
These merge commits are not added to the base branch when
the PR is merged by Mergify.

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Signed-off-by: Michael D Kinney 
---
 BaseTools/Scripts/PatchCheck.py | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index 80754e763c5a..63e6223f8ebc 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -1,7 +1,7 @@
 ## @file
 #  Check a patch for various format issues
 #
-#  Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
+#  Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
 #  Copyright (C) 2020, Red Hat, Inc.
 #  Copyright (c) 2020, ARM Ltd. All rights reserved.
 #
@@ -89,22 +89,28 @@ class EmailAddressCheck:
 class CommitMessageCheck:
 """Checks the contents of a git commit message."""

-def __init__(self, subject, message):
+def __init__(self, subject, message, author_email):
 self.ok = True

 if subject is None and  message is None:
 self.error('Commit message is missing!')
 return

+MergifyMerge = False
+if "mergify[bot]@users.noreply.github.com" in author_email:
+if "Merge branch" in subject:
+MergifyMerge = True
+
 self.subject = subject
 self.msg = message

 print (subject)

 self.check_contributed_under()
-self.check_signed_off_by()
-self.check_misc_signatures()
-self.check_overall_format()
+if not MergifyMerge:
+self.check_signed_off_by()
+self.check_misc_signatures()
+self.check_overall_format()
 self.report_message_result()

 url = 
'https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FCommit-Message-Format&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C44bf20b900a8463872f608d941c36036%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637613129659549071%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ScoSoLs0hgaj7DOtCjE1uevYTX2oAHOqJOHKJYZQ%2BGw%3D&reserved=0'
@@ -522,7 +528,7 @@ class CheckOnePatch:
 email_check = EmailAddressCheck(self.author_email, 'Author')
 email_ok = email_check.ok

-msg_check = CommitMessageCheck(self.commit_subject, self.commit_msg)
+msg_check = CommitMessageCheck(self.commit_subject, self.commit_msg, 
self.author_email)
 msg_ok = msg_check.ok

 diff_ok = True
--
2.32.0.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77580): https://edk2.groups.io/g/devel/message/77580
Mute This Topic: https://groups.io/mt/84061192/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [EXTERNAL] [Patch 2/3] .mergify: Simplify Mergify rules using GitHub status checks

2021-07-07 Thread Bret Barkelew via groups.io
Acked-by: Bret Barkelew 

- Bret

From: Michael D Kinney
Sent: Wednesday, July 7, 2021 8:49 PM
To: devel@edk2.groups.io
Cc: Liming Gao; Sean 
Brogan; Bret 
Barkelew
Subject: [EXTERNAL] [Patch 2/3] .mergify: Simplify Mergify rules using GitHub 
status checks

* Enable Mergify queue feature to support auto rebase when
  'push' label is set and gauarntee that all EDK II CI checks
  are run before merging in changes with linear history.
* Use status checks configured in GitHub branch protections
* Allow non EDK II Maintainers to create a PR
  Requires an EDK II Maintainer to accept the change and
  request merge by adding 'push' label.  Only EDK II Maintainers
  have ability to set/clear labels.
* Do not automatically close PRs for personal builds.

Cc: Liming Gao 
Cc: Sean Brogan 
Cc: Bret Barkelew 
Signed-off-by: Michael D Kinney 
---
 .mergify/config.yml | 71 -
 1 file changed, 12 insertions(+), 59 deletions(-)

diff --git a/.mergify/config.yml b/.mergify/config.yml
index 9774aaf49774..bd6da4c77937 100644
--- a/.mergify/config.yml
+++ b/.mergify/config.yml
@@ -16,7 +16,7 @@
 # * This file must be checked into the 'default' branch of a repo.  Copies
 #   of this file on other branches of a repo are ignored by Mergify.
 #
-# Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 # 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapps%2Fmergify&data=04%7C01%7CBret.Barkelew%40microsoft.com%7Cb73475b4d67744f2e3ce08d941c35a00%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637613129552748468%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=bWUUW1qS2GsSqRMBiZELIj4qlLBe06nkALTz0hkLrLo%3D&reserved=0
@@ -24,74 +24,27 @@
 #
 ##

+queue_rules:
+  - name: default
+conditions:
+  - base~=(^main|^master|^stable/)
+  - label=push
+
 pull_request_rules:
-
   - name: Automatically merge a PR when all required checks pass and 'push' 
label is present
 conditions:
-  - base~=(^master|^stable/)
+  - base~=(^main|^master|^stable/)
   - label=push
-  - author=@tianocore/edk-ii-maintainers
-  - status-success=tianocore.PatchCheck
-  - status-success=Ubuntu GCC5 PR
-  - status-success=Windows VS2019 PR
 actions:
-  merge:
-strict: true
+  queue:
 method: rebase
-
-  - name: Automatically close a PR when all required checks pass and 'push' 
label is not present
-conditions:
-  - base~=(^master|^stable/)
-  - -label=push
-  - -closed
-  - status-success=tianocore.PatchCheck
-  - status-success=Ubuntu GCC5 PR
-  - status-success=Windows VS2019 PR
-  - status-success=Ubuntu GCC5 PR (FINISHED)
-  - status-success=Windows VS2019 PR (FINISHED)
-actions:
-  close:
-message: All checks passed. Auto close personal build.
+rebase_fallback: none
+name: default

   - name: Post a comment on a PR that can not be merged due to a merge conflict
 conditions:
-  - base~=(^master|^stable/)
+  - base~=(^main|^master|^stable/)
   - conflict
 actions:
   comment:
 message: PR can not be merged due to conflict.  Please rebase and 
resubmit
-
-  - name: Automatically close a PR that fails the EDK II Maintainers 
membership check and 'push' label is present
-conditions:
-  - base~=(^master|^stable/)
-  - label=push
-  - -author=@tianocore/edk-ii-maintainers
-actions:
-  close:
-message: PR submitter is not a member of the Tianocore EDK II 
Maintainers team
-
-  - name: Post a comment on a PR if PatchCheck fails
-conditions:
-  - base~=(^master|^stable/)
-  - status-failure=tianocore.PatchCheck
-actions:
-  comment:
-message: PR can not be merged due to a PatchCheck failure.  Please 
resolve and resubmit
-
-  - name: Post a comment on a PR if Ubuntu GCC5 fails
-conditions:
-  - base~=(^master|^stable/)
-  - status-failure=Ubuntu GCC5 PR
-  - status-success=Ubuntu GCC5 PR (FAILED)
-actions:
-  comment:
-message: PR can not be merged due to an Ubuntu GCC5 failure.  Please 
resolve and resubmit
-
-  - name: Post a comment on a PR if Windows VS2019 fails
-conditions:
-  - base~=(^master|^stable/)
-  - status-failure=Windows VS2019 PR
-  - status-success=Windows VS2019 PR (FAILED)
-actions:
-  comment:
-message: PR can not be merged due to a Windows VS2019 failure.  Please 
resolve and resubmit
--
2.32.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77581): https://edk2.groups.io/

Re: [edk2-devel] [PATCH] Maintainers.txt: remove Laszlo Ersek's entries

2021-07-08 Thread Bret Barkelew via groups.io
I shall pour out a cup of bits in your honor! Your diligence will be missed.

- Bret

From: Michael D Kinney via 
groups.io
Sent: Thursday, July 8, 2021 9:42 AM
To: Laszlo Ersek; 
edk2-devel-groups-io; Kinney, Michael 
D
Cc: Andrew Fish; Ard 
Biesheuvel; Dong, 
Eric; Justen, Jordan 
L; Lindholm, Leif; 
Philippe Mathieu-Daudé; Kumar, 
Rahul1; Ni, Ray; Sami 
Mujawar
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] Maintainers.txt: remove Laszlo 
Ersek's entries

Reviewed-by: Michael D Kinney 


> -Original Message-
> From: Laszlo Ersek 
> Sent: Thursday, July 8, 2021 12:09 AM
> To: edk2-devel-groups-io 
> Cc: Andrew Fish ; Ard Biesheuvel 
> ; Dong, Eric ; Justen,
> Jordan L ; Leif Lindholm ; 
> Kinney, Michael D ;
> Philippe Mathieu-Daudé ; Kumar, Rahul1 
> ; Ni, Ray ; Sami
> Mujawar 
> Subject: [PATCH] Maintainers.txt: remove Laszlo Ersek's entries
>
> I'm relinquishing all my roles listed in "Maintainers.txt", for personal
> reasons.
>
> My email address  remains functional.
>
> To my understanding, my employer is working to assign others engineers to
> the edk2 project (at their discretion).
>
> Cc: Andrew Fish 
> Cc: Ard Biesheuvel 
> Cc: Eric Dong 
> Cc: Jordan Justen 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Cc: Philippe Mathieu-Daudé 
> Cc: Rahul Kumar 
> Cc: Ray Ni 
> Cc: Sami Mujawar 
> Signed-off-by: Laszlo Ersek 
> ---
>  Maintainers.txt | 4 
>  1 file changed, 4 deletions(-)
>
> diff --git a/Maintainers.txt b/Maintainers.txt
> index f4e4c72d0628..e9dda5c5ca0c 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -69,7 +69,6 @@ Tianocore Stewards
>  --
>  F: *
>  M: Andrew Fish 
> -M: Laszlo Ersek 
>  M: Leif Lindholm 
>  M: Michael D Kinney 
>
> @@ -143,7 +142,6 @@ M: Ard Biesheuvel 
>  ArmVirtPkg
>  F: ArmVirtPkg/
>  W: 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FArmVirtPkg&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ca360d7dc108143d2eaa308d9422f3c7e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637613593658506841%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=5HBNn3xOBYoAI%2Fc7jAr%2BfyC2nf5JcRox1Xa8Ks7iw7o%3D&reserved=0
> -M: Laszlo Ersek 
>  M: Ard Biesheuvel 
>  R: Leif Lindholm 
>  R: Sami Mujawar 
> @@ -421,7 +419,6 @@ R: Siyuan Fu 
>  OvmfPkg
>  F: OvmfPkg/
>  W: 
> https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.tianocore.org%2Fovmf%2F&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ca360d7dc108143d2eaa308d9422f3c7e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637613593658506841%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=5LIFlvPs7GpLWJ0%2F1MF3pe0s4JtKA7Imi9tX1OMJJJc%3D&reserved=0
> -M: Laszlo Ersek 
>  M: Ard Biesheuvel 
>  R: Jordan Justen 
>  S: Maintained
> @@ -567,7 +564,6 @@ F: UefiCpuPkg/
>  W: 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FUefiCpuPkg&data=04%7C01%7Cbret.barkelew%40microsoft.com%7Ca360d7dc108143d2eaa308d9422f3c7e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637613593658506841%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=oBQwlzOLwQ%2FBXNb6C68jcsInFWeDZQKrS4L1LUe1zWU%3D&reserved=0
>  M: Eric Dong 
>  M: Ray Ni 
> -R: Laszlo Ersek 
>  R: Rahul Kumar 
>
>  UefiCpuPkg: Sec related modules
> --
> 2.19.1.3.g30247aa5d201








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77607): https://edk2.groups.io/g/devel/message/77607
Mute This Topic: https://groups.io/mt/84063009/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [EXTERNAL] Re: [edk2-devel] [PATCH v6 00/14] Add the VariablePolicy feature

2020-07-02 Thread Bret Barkelew via groups.io
That’s also fine.
Note that this is not the only place where I receive feedback, however. Some 
people bring up things over happy hour, too. 😉

Laszlo… whiskey Wednesday?

- Bret

From: Laszlo Ersek
Sent: Thursday, July 2, 2020 4:06 AM
To: Bret Barkelew; 
devel@edk2.groups.io; 
dandan...@intel.com; 
b...@corthon.com
Cc: Yao, Jiewen; Zhang, Chao 
B; Wang, Jian J; 
Wu, Hao A; liming.gao; 
Justen, Jordan L; Ard 
Biesheuvel; Andrew Fish; 
Ni, Ray
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v6 00/14] Add the VariablePolicy 
feature

On 07/02/20 08:47, Bret Barkelew wrote:
> Actually, if you want to leave feedback in the CI test PR that I made for 
> this version, I’m happy to discuss there as well.
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fpull%2F718%2Ffiles&data=02%7C01%7Cbret.barkelew%40microsoft.com%7Cf6e2bb7fb829461fd5dc08d81e77fbd5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637292847963929407&sdata=0%2BFsslPtFLb0QlI8eL2i7m8FP3vV5wdDjGq6JWLnbL4%3D&reserved=0

Please let's not do that just yet. Once we have a flag day, we should
have review discussions exclusively in github. Before that day, the
mailing list should carry the review comments however.

Thanks
Laszlo


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

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



Re: [edk2-devel] [EXTERNAL] [Patch v3 09/16] UnitTestFrameworkPkg: Change target mode DebugLib mapping

2020-07-14 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 


- Bret


From: Michael D Kinney 
Sent: Friday, July 10, 2020 7:08:57 PM
To: devel@edk2.groups.io 
Cc: Sean Brogan ; Bret Barkelew 
; Yao, Jiewen 
Subject: [EXTERNAL] [Patch v3 09/16] UnitTestFrameworkPkg: Change target mode 
DebugLib mapping

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2801&data=02%7C01%7CBret.Barkelew%40microsoft.com%7C51f924d3b7144be85fc608d8253f6879%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301550295393&sdata=mOv%2FyMpj14WmxCmpAdtexIJRxcyL9nkWJMrAxmqTV70%3D&reserved=0

The default DebugLib for target mode was DebugLibNull.  This
library instance disables all ASSERT() and DEBUG() macros
which removes the ability to write unit tests that check for
ASSERT() behaviors.

The DebugLib is changed to PeiDxeDebugLibReportStatusCode.inf
that guarantees that DEBUG() and ASSERT() macros are active.  The
default ReportStatusCodeLib is set to BaseReportStatusCodeLibNull.inf
so no messages are sent to any devices preserving the DebugLibNull
behavior.

A platform specific unit test can always override these mappings
with a platform specific DebugLib.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Jiewen Yao 
Signed-off-by: Michael D Kinney 
---
 UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc 
b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
index c29b056fca..0881278ab0 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
@@ -16,7 +16,9 @@ [LibraryClasses]

   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  
DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
+  
ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
+  
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
--
2.21.0.windows.1


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

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



Re: [edk2-devel] [Patch v3 00/16] UnitTestFrameworkPkg: Enhancements and bug fixes

2020-07-14 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 


- Bret


From: devel@edk2.groups.io  on behalf of Liming Gao via 
groups.io 
Sent: Monday, July 13, 2020 11:54:53 PM
To: devel@edk2.groups.io ; Kinney, Michael D 

Subject: [EXTERNAL] Re: [edk2-devel] [Patch v3 00/16] UnitTestFrameworkPkg: 
Enhancements and bug fixes

Mike:
 Thanks for your update. This patch set is good to me. Reviewed-by: Liming Gao 


Thanks
Liming
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Michael D Kinney
Sent: 2020年7月11日 10:09
To: devel@edk2.groups.io
Subject: [edk2-devel] [Patch v3 00/16] UnitTestFrameworkPkg: Enhancements and 
bug fixes

Changes in V3
==
* Add UnitTestHostBaseLib class for the global variable that allows
  host based unit tests to hook and emulate some BaseLib services

Changes in V2
==
* Add UnitTestExpectAssertFailure() to UnitTestLib to simplify the macro
  UT_EXPECT_ASSERT_FAILURE() and provide better log messages.
* Expand UnitTestFrameworkPkg sample unit tests to cover test cases for the new
  UT_EXPECT_ASSERT_FAILURE() macro and all other UnitTestLib macros.
* Add failure type FAILURETYPE_EXPECTASSERT when the macro
  UT_EXPECT_ASSERT_FAILURE() does not detect an ASSERT().
* Move print of log messages to end of cleanup function to support log
  messages generated in a cleanup function.
* Update running of target-based tests to use SetJump()/LongJump()
  around prereq, cleanup, and unit test functions to match the behavior
  of host based tests using cmocka. This also requires all UnitTestLib
  Assert functions to generate error log message first and then call
  UnitTestFailure() where the LongJump() is made to make sure all log
  messages are added before the LongJump().

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2797&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cdb2bad178b6044d37e1208d827c2d38e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303065010616592&sdata=Cvs4rSfp%2FUl15lR331i0WOqsz0X0XGYc9nPu%2FFu5Ce0%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2798&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cdb2bad178b6044d37e1208d827c2d38e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303065010616592&sdata=gKBdHVSP%2F3QmwmX%2FAhCjQcIC6BMU%2F8yx6BM03VYaugo%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2799&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cdb2bad178b6044d37e1208d827c2d38e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303065010616592&sdata=eBVwmQgDnQLCOKhIybCJ8nn9CU43aO3shuTlUSxzC%2BM%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2800&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cdb2bad178b6044d37e1208d827c2d38e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303065010616592&sdata=7sFBxWZvhxXfiLAyCgaExGqAW%2F8yfIU0p2hlMLK4XUg%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2801&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cdb2bad178b6044d37e1208d827c2d38e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303065010616592&sdata=jYoltIH%2BvS43A1b5koMYdK0bnmPt8Pa4tz6QkbezYc4%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2803&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cdb2bad178b6044d37e1208d827c2d38e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303065010616592&sdata=Neyrn2INlcMtlJ%2BbS456GPRWVxb5ALL%2B9BcLMGqX69Q%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2804&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cdb2bad178b6044d37e1208d827c2d38e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303065010616592&sdata=hkyOv8qhQ3iC%2FwvqnayiBeot6AYwfRho%2FUmhfcVd0qo%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2805&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cdb2bad178b6044d37e1208d827c2d38e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303065010616592&sdata=TLvx%2FUylNXEyMOBlikWOfnQHnbqyR1JiCm9uIod859Q%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2806&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cdb2bad178b6044d37e1208d827c2d38e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303065010616592&sdata=Wh7uoily48Be5EFItwd7o6whBtQZy82jh0cIDE%2FDrCY%3D&reserved=0

* Add Null base libraries for host based unit tests
* Add host based test version of BaseLib with hooks for services that use
  privileged instructions.
* Add new UT_EXPECT_ASSERT_FAILURE() macro to UnitTestLib class
* Enable source level de

Re: [edk2-devel] [EXTERNAL] [Patch v3 12/16] UnitTestFrameworkPkg/UnitTestLib: Add checks for ASSERT()

2020-07-14 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 


- Bret

From: Michael D Kinney
Sent: Friday, July 10, 2020 7:09 PM
To: devel@edk2.groups.io
Cc: Sean Brogan; Bret 
Barkelew; Yao, 
Jiewen
Subject: [EXTERNAL] [Patch v3 12/16] UnitTestFrameworkPkg/UnitTestLib: Add 
checks for ASSERT()

REF: REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2801&data=02%7C01%7CBret.Barkelew%40microsoft.com%7C5764407d5dc9445fec9808d8253f699c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301574194018&sdata=4UQXMIDPbI9xRP%2BKcPorH1PpbFb1%2BjZR%2BlpsnCP5lAM%3D&reserved=0

Add UnitTestDebugAssertLib that provides the UnitTestDebugAssert()
service and the gUnitTestExpectAssertFailureJumpBuffer global
variable.  This NULL library is linked against all host and target
unit test builds.  This guarantees that the UnitTestDebugAssert()
service is available to link against all libraries and modules that
use the DebugLib class.

EDKII_UNIT_TEST_FRAMEWORK_ENABLED must always be defined when
building unit tests so the behavior of the DebugLib ASSERT()
macros can be adjusted to allow the unit test framework to
catch an ASSERT() if it is triggered by a function under test.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Jiewen Yao 
Signed-off-by: Michael D Kinney 
---
 .../UnitTestDebugAssertLib.c  |  49 +
 .../UnitTestDebugAssertLib.inf|  31 +++
 .../UnitTestDebugAssertLib.uni|  11 +
 .../Library/UnitTestLib/Assert.c  | 203 --
 .../Library/UnitTestLib/AssertCmocka.c|  68 ++
 .../Library/UnitTestLib/RunTests.c|  23 +-
 .../UnitTestResultReportLib.c |   3 +-
 .../PrivateInclude/UnitTestFrameworkTypes.h   |   1 +
 .../Test/UnitTestFrameworkPkgHostTest.dsc |   2 +-
 UnitTestFrameworkPkg/UnitTestFrameworkPkg.dsc |   1 +
 .../UnitTestFrameworkPkgTarget.dsc.inc|   6 +-
 11 files changed, 328 insertions(+), 70 deletions(-)
 create mode 100644 
UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLib.c
 create mode 100644 
UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLib.inf
 create mode 100644 
UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLib.uni

diff --git 
a/UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLib.c 
b/UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLib.c
new file mode 100644
index 00..0a4001e182
--- /dev/null
+++ 
b/UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLib.c
@@ -0,0 +1,49 @@
+/** @file
+  Unit Test Debug Assert Library
+
+  Copyright (c) 2020, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+
+///
+/// Point to jump buffer used with SetJump()/LongJump() to test if a function
+/// under test generates an expected ASSERT() condition.
+///
+BASE_LIBRARY_JUMP_BUFFER  *gUnitTestExpectAssertFailureJumpBuffer = NULL;
+
+/**
+  Unit test library replacement for DebugAssert() in DebugLib.
+
+  If FileName is NULL, then a  string of "(NULL) Filename" is 
printed.
+  If Description is NULL, then a  string of "(NULL) Description" 
is printed.
+
+  @param  FileName The pointer to the name of the source file that 
generated the assert condition.
+  @param  LineNumber   The line number in the source file that generated the 
assert condition
+  @param  Description  The pointer to the description of the assert condition.
+
+**/
+VOID
+EFIAPI
+UnitTestDebugAssert (
+  IN CONST CHAR8  *FileName,
+  IN UINTNLineNumber,
+  IN CONST CHAR8  *Description
+  )
+{
+  CHAR8  Message[256];
+
+  if (gUnitTestExpectAssertFailureJumpBuffer != NULL) {
+UT_LOG_INFO ("Detected expected ASSERT: %a(%d): %a\n", FileName, 
LineNumber, Description);
+LongJump (gUnitTestExpectAssertFailureJumpBuffer, 1);
+  } else {
+AsciiStrCpyS (Message, sizeof(Message), "Detected unexpected ASSERT(");
+AsciiStrCatS (Message, sizeof(Message), Description);
+AsciiStrCatS (Message, sizeof(Message), ")");
+UnitTestAssertTrue (FALSE, "", LineNumber, FileName, Message);
+  }
+}
diff --git 
a/UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLib.inf
 
b/UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLib.inf
new file mode 100644
index 00..e6ccab0dd9
--- /dev/null
+++ 
b/UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLib.inf
@@ -0,0 +1,31 @@
+## @file
+#  Unit Test Debug Assert Library
+#
+#  Copyright (c) 2020, Intel Corporation. All rights reserved.
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = UnitTestDebugAs

Re: [edk2-devel] [EXTERNAL] [Patch v3 11/16] UnitTestFrameworkPkg/UnitTestLib: Fix target mode log messages

2020-07-14 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 


- Bret


From: Michael D Kinney 
Sent: Friday, July 10, 2020 7:08:59 PM
To: devel@edk2.groups.io 
Cc: Sean Brogan ; Bret Barkelew 
; Yao, Jiewen 
Subject: [EXTERNAL] [Patch v3 11/16] UnitTestFrameworkPkg/UnitTestLib: Fix 
target mode log messages

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2806&data=02%7C01%7CBret.Barkelew%40microsoft.com%7C37f4c773c1684ce41aea08d8253f692e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301580380663&sdata=xRivgP78PSA7wfjoPw8LZL9U9Fnh5x7LClkYmnVGL4M%3D&reserved=0

Update the log messages generated in target mode to use
FileName instead of FunctionName.  FunctionName is an empty
string so the log messages generated do not provide enough
information to know the source of a unit test failure.

Using FileName combined with LineNumber provides the
right information to identify the location of a unit test
failure.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Jiewen Yao 
Signed-off-by: Michael D Kinney 
---
 .../Library/UnitTestLib/Assert.c  | 64 +--
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c 
b/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c
index c327ba88f1..8a131fab2b 100644
--- a/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c
+++ b/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c
@@ -105,14 +105,14 @@ UnitTestAssertTrue (
   if (!Expression) {
 UnitTestLogFailure (
   FAILURETYPE_ASSERTTRUE,
-  "%a::%d Expression (%a) is not TRUE!\n",
-  FunctionName,
+  "%a:%d: Expression (%a) is not TRUE!\n",
+  FileName,
   LineNumber,
   Description
   );
 UT_LOG_ERROR (
-  "[ASSERT FAIL] %a::%d Expression (%a) is not TRUE!\n",
-  FunctionName,
+  "[ASSERT FAIL] %a:%d: Expression (%a) is not TRUE!\n",
+  FileName,
   LineNumber,
   Description
   );
@@ -151,14 +151,14 @@ UnitTestAssertFalse (
   if (Expression) {
 UnitTestLogFailure (
   FAILURETYPE_ASSERTFALSE,
-  "%a::%d Expression(%a) is not FALSE!\n",
-  FunctionName,
+  "%a:%d: Expression(%a) is not FALSE!\n",
+  FileName,
   LineNumber,
   Description
   );
 UT_LOG_ERROR (
-  "[ASSERT FAIL] %a::%d Expression (%a) is not FALSE!\n",
-  FunctionName,
+  "[ASSERT FAIL] %a:%d: Expression (%a) is not FALSE!\n",
+  FileName,
   LineNumber,
   Description
   );
@@ -197,15 +197,15 @@ UnitTestAssertNotEfiError (
   if (EFI_ERROR (Status)) {
 UnitTestLogFailure (
   FAILURETYPE_ASSERTNOTEFIERROR,
-  "%a::%d Status '%a' is EFI_ERROR (%r)!\n",
-  FunctionName,
+  "%a:%d: Status '%a' is EFI_ERROR (%r)!\n",
+  FileName,
   LineNumber,
   Description,
   Status
   );
 UT_LOG_ERROR (
-  "[ASSERT FAIL] %a::%d Status '%a' is EFI_ERROR (%r)!\n",
-  FunctionName,
+  "[ASSERT FAIL] %a:%d: Status '%a' is EFI_ERROR (%r)!\n",
+  FileName,
   LineNumber,
   Description,
   Status
@@ -250,8 +250,8 @@ UnitTestAssertEqual (
   if (ValueA != ValueB) {
 UnitTestLogFailure (
   FAILURETYPE_ASSERTEQUAL,
-  "%a::%d Value %a != %a (%d != %d)!\n",
-  FunctionName,
+  "%a:%d: Value %a != %a (%d != %d)!\n",
+  FileName,
   LineNumber,
   DescriptionA,
   DescriptionB,
@@ -259,8 +259,8 @@ UnitTestAssertEqual (
   ValueB
   );
 UT_LOG_ERROR (
-  "[ASSERT FAIL] %a::%d Value %a != %a (%d != %d)!\n",
-  FunctionName,
+  "[ASSERT FAIL] %a:%d: Value %a != %a (%d != %d)!\n",
+  FileName,
   LineNumber,
   DescriptionA,
   DescriptionB,
@@ -312,16 +312,16 @@ UnitTestAssertMemEqual (
   if (CompareMem(BufferA, BufferB, Length) != 0) {
 UnitTestLogFailure (
   FAILURETYPE_ASSERTEQUAL,
-  "%a::%d Memory at %a != %a for length %d bytes!\n",
-  FunctionName,
+  "%a:%d: Memory at %a != %a for length %d bytes!\n",
+  FileName,
   LineNumber,
   DescriptionA,
   DescriptionB,
   Length
   );
 UT_LOG_ERROR (
-  "[ASSERT FAIL] %a::%d Value %a != %a for length %d bytes!\n",
-  FunctionName,
+  "[ASSERT FAIL] %a:%d: Value %a != %a for length %d bytes!\n",
+  FileName,
   LineNumber,
   DescriptionA,
   DescriptionB,
@@ -368,8 +368,8 @@ UnitTestAssertNotEqual (
   if (ValueA == ValueB) {
 UnitTestLogFailure (
   FAILURETYPE_ASSERTNOTEQUAL,
-  "%a::%d Value %a == %a (%d == %d)!\n",
-  FunctionName,
+  "%a:%d: Value %a == %a (%d == %d)!\n",
+  FileName,
   LineNumber,
   DescriptionA,
   DescriptionB,
@@ -377,8 +377,8 @@ UnitTestAssertNotEqual (
   ValueB
   );
 UT_LOG_ERROR (
-  "[ASSERT FAIL] %a::%d Value %a == %a (%d == %d)!\n",
-  FunctionName,
+  "[ASSERT FAIL] %a:%d: Value %a == %a (%d == %d)!\n",
+  FileName,
   LineNumber,
   

Re: [edk2-devel] [EXTERNAL] [Patch v3 08/16] UnitTestFrameworkPkg: Set host application stack size to 256KB

2020-07-14 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 

- Bret

From: Michael D Kinney
Sent: Friday, July 10, 2020 7:09 PM
To: devel@edk2.groups.io
Cc: Sean Brogan; Bret 
Barkelew; Yao, 
Jiewen
Subject: [EXTERNAL] [Patch v3 08/16] UnitTestFrameworkPkg: Set host application 
stack size to 256KB

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2803&data=02%7C01%7CBret.Barkelew%40microsoft.com%7C6d34207455e9401311c408d8253f6805%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301542442718&sdata=IhFDMIx%2FIz4DQAMJjDmGZo%2FBBZfUFzeYvCbAxbnNTzo%3D&reserved=0

The UEFI Specification defines the minimum stack size before
ExitBootServices() to be 128KB.  When running a host based unit
test, there may be additional stack overhead from the host
application environment and cmocka.

Update the build flags to set the size of the stack to 256KB
which is double the UEFI Specification requirement.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Jiewen Yao 
Signed-off-by: Michael D Kinney 
---
 UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc 
b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
index c4e6e0e0a6..4dd8d4ac67 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
@@ -30,7 +30,7 @@ [BuildOptions.common.EDKII.HOST_APPLICATION]
   #
   # MSFT
   #
-  MSFT:*_*_*_DLINK_FLAGS== /out:"$(BIN_DIR)\$(BASE_NAME).exe" 
/pdb:"$(BIN_DIR)\$(BASE_NAME).pdb" /IGNORE:4001 /NOLOGO /SUBSYSTEM:CONSOLE 
/DEBUG /NODEFAULTLIB:libcmt.lib libcmtd.lib
+  MSFT:*_*_*_DLINK_FLAGS== /out:"$(BIN_DIR)\$(BASE_NAME).exe" 
/pdb:"$(BIN_DIR)\$(BASE_NAME).pdb" /IGNORE:4001 /NOLOGO /SUBSYSTEM:CONSOLE 
/DEBUG /STACK:0x4,0x4 /NODEFAULTLIB:libcmt.lib libcmtd.lib
   MSFT:*_*_IA32_DLINK_FLAGS = /MACHINE:I386
   MSFT:*_*_X64_DLINK_FLAGS  = /MACHINE:AMD64

--
2.21.0.windows.1


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

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



Re: [edk2-devel] [EXTERNAL] [Patch v3 07/16] UnitTestFrameworkPkg: Enable source level debug for host tests

2020-07-14 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 


- Bret


From: Michael D Kinney 
Sent: Friday, July 10, 2020 7:08:55 PM
To: devel@edk2.groups.io 
Cc: Sean Brogan ; Bret Barkelew 
; Yao, Jiewen 
Subject: [EXTERNAL] [Patch v3 07/16] UnitTestFrameworkPkg: Enable source level 
debug for host tests

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2804&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cd31f0dcf6e6d4f80bd3008d8253f689e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301550028840&sdata=oNgc2S2JjPYyf0Hh%2FjS7EqunqyH4%2BB7nfWWZBDDGWIE%3D&reserved=0

Optionally enable a feature to support source level debug of a
host based unit test.  By default, this feature is disabled.
Exceptions are caught by the unit test framework and are
interpreted as a test failure.

When a unit test is under development, bugs may generate
exceptions or a unit test developer may want to trace the
execution of unit tests to debug some unexpected behavior.
Defining UNIT_TESTING_DEBUG in the DSC file or from the build
command line allows exceptions to be caught by the host OS
and allows the developer to debug their unit test under
development or debug the Unit Test Framework itself.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Jiewen Yao 
Signed-off-by: Michael D Kinney 
---
 UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc | 5 +
 1 file changed, 5 insertions(+)

diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc 
b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
index c22085fae1..c4e6e0e0a6 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
@@ -20,6 +20,11 @@ [LibraryClasses.common.HOST_APPLICATION]

 [BuildOptions]
   GCC:*_*_*_CC_FLAGS = -fno-pie
+!ifdef $(UNIT_TESTING_DEBUG)
+  MSFT:*_*_*_CC_FLAGS  = -D UNIT_TESTING_DEBUG=1
+  GCC:*_*_*_CC_FLAGS   = -D UNIT_TESTING_DEBUG=1
+  XCODE:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1
+!endif

 [BuildOptions.common.EDKII.HOST_APPLICATION]
   #
--
2.21.0.windows.1


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

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



Re: [edk2-devel] [EXTERNAL] [Patch v3 06/16] UnitTestFrameworkPkg: Use host libraries from MdePkg

2020-07-14 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 


- Bret


From: Michael D Kinney 
Sent: Friday, July 10, 2020 7:08:54 PM
To: devel@edk2.groups.io 
Cc: Sean Brogan ; Bret Barkelew 
; Yao, Jiewen 
Subject: [EXTERNAL] [Patch v3 06/16] UnitTestFrameworkPkg: Use host libraries 
from MdePkg

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2800&data=02%7C01%7CBret.Barkelew%40microsoft.com%7C12c2ebe65a74457d0b0508d8253f675b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301533729524&sdata=Ru4QTYif83gqk%2BWkzmCxTXm0N4Uyh3T%2BPrTh3vr0cCE%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2799&data=02%7C01%7CBret.Barkelew%40microsoft.com%7C12c2ebe65a74457d0b0508d8253f675b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301533729524&sdata=eZtAdXCBsixYVZ6CrZ66vDEmDgZ2Dpuh4NwN1jGjgQI%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2798&data=02%7C01%7CBret.Barkelew%40microsoft.com%7C12c2ebe65a74457d0b0508d8253f675b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301533729524&sdata=48f8BlgozfDlnYBiR1G2ng610xRQhsMjHdH4VZs3njs%3D&reserved=0

Update the default unit test library mappings to use the
library instances from the MdePkg that are safe for host
based unit tests.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Jiewen Yao 
Signed-off-by: Michael D Kinney 
---
 UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc | 4 
 1 file changed, 4 insertions(+)

diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc 
b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
index e954968efc..c22085fae1 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
@@ -9,6 +9,10 @@
 !include UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc

 [LibraryClasses.common.HOST_APPLICATION]
+  BaseLib|MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
+  UnitTestHostBaseLib|MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
+  CpuLib|MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.inf
+  
CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLibNull/BaseCacheMaintenanceLibNull.inf
   CmockaLib|UnitTestFrameworkPkg/Library/CmockaLib/CmockaLib.inf
   UnitTestLib|UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLibCmocka.inf
   DebugLib|UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.inf
--
2.21.0.windows.1


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

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



Re: [edk2-devel] [EXTERNAL] [Patch v3 10/16] UnitTestFrameworkPkg/UnitTestLib: Move print log into cleanup

2020-07-14 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 


- Bret

From: Michael D Kinney
Sent: Friday, July 10, 2020 7:09 PM
To: devel@edk2.groups.io
Cc: Sean Brogan; Bret 
Barkelew; Yao, 
Jiewen
Subject: [EXTERNAL] [Patch v3 10/16] UnitTestFrameworkPkg/UnitTestLib: Move 
print log into cleanup

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2805&data=02%7C01%7CBret.Barkelew%40microsoft.com%7C0e54105ccc5b453f790508d8253f690e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301563150384&sdata=OY4xwl9Ecv%2F0SJyzzqBUGNxTi1E%2F8Ax70I6jF2dA6cA%3D&reserved=0

If a unit test fails with an exception or an assert, then the
CmockaUnitTestFunctionRunner() is terminated and the logic
that follows the invocation of the unit test is skipped.  This
currently skips the logic that prints log messages.

Move the print of log messages to the end of the function
CmockaUnitTestTeardownFunctionRunner() that is guaranteed to
be executed when a unit test completes normally or is
terminated with an exception or an assert.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Jiewen Yao 
Signed-off-by: Michael D Kinney 
---
 .../Library/UnitTestLib/RunTestsCmocka.c  | 33 +--
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/RunTestsCmocka.c 
b/UnitTestFrameworkPkg/Library/UnitTestLib/RunTestsCmocka.c
index fb81cc9658..96aa4d9b13 100644
--- a/UnitTestFrameworkPkg/Library/UnitTestLib/RunTestsCmocka.c
+++ b/UnitTestFrameworkPkg/Library/UnitTestLib/RunTestsCmocka.c
@@ -53,21 +53,9 @@ CmockaUnitTestFunctionRunner (
 UnitTest->Result = UNIT_TEST_SKIPPED;
   } else {
 UnitTest->Result = UNIT_TEST_RUNNING;
-
 Framework->CurrentTest = UnitTest;
 UnitTest->Result = UnitTest->RunTest (UnitTest->Context);
 Framework->CurrentTest = NULL;
-
-// Print out the log messages - This is a partial solution as it
-// does not get the log into the XML.  Need cmocka changes to support
-// stdout and stderr in their xml format
-//
-if (UnitTest->Log != NULL) {
-  print_message("UnitTest: %s - %s\n", UnitTest->Name, 
UnitTest->Description);
-  print_message("Log Output Start\n");
-  print_message("%s", UnitTest->Log);
-  print_message("Log Output End\n");
-}
   }
 }

@@ -112,13 +100,24 @@ CmockaUnitTestTeardownFunctionRunner (
   Suite = (UNIT_TEST_SUITE *)(UnitTest->ParentSuite);
   Framework = (UNIT_TEST_FRAMEWORK *)(Suite->ParentFramework);

-  if (UnitTest->CleanUp == NULL) {
-return 0;
+  if (UnitTest->CleanUp != NULL) {
+Framework->CurrentTest = UnitTest;
+UnitTest->CleanUp (UnitTest->Context);
+Framework->CurrentTest = NULL;
+  }
+
+  //
+  // Print out the log messages - This is a partial solution as it
+  // does not get the log into the XML.  Need cmocka changes to support
+  // stdout and stderr in their xml format
+  //
+  if (UnitTest->Log != NULL) {
+print_message("UnitTest: %s - %s\n", UnitTest->Name, 
UnitTest->Description);
+print_message("Log Output Start\n");
+print_message("%s", UnitTest->Log);
+print_message("Log Output End\n");
   }

-  Framework->CurrentTest = UnitTest;
-  UnitTest->CleanUp (UnitTest->Context);
-  Framework->CurrentTest = NULL;
   //
   // Return 0 for success.  Non-zero for error.
   //
--
2.21.0.windows.1


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

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



Re: [EXTERNAL] [edk2-devel] [Patch v3 00/16] UnitTestFrameworkPkg: Enhancements and bug fixes

2020-07-14 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 


- Bret

From: Michael D Kinney via 
groups.io
Sent: Friday, July 10, 2020 7:09 PM
To: devel@edk2.groups.io
Subject: [EXTERNAL] [edk2-devel] [Patch v3 00/16] UnitTestFrameworkPkg: 
Enhancements and bug fixes

Changes in V3
==
* Add UnitTestHostBaseLib class for the global variable that allows
  host based unit tests to hook and emulate some BaseLib services

Changes in V2
==
* Add UnitTestExpectAssertFailure() to UnitTestLib to simplify the macro
  UT_EXPECT_ASSERT_FAILURE() and provide better log messages.
* Expand UnitTestFrameworkPkg sample unit tests to cover test cases for the new
  UT_EXPECT_ASSERT_FAILURE() macro and all other UnitTestLib macros.
* Add failure type FAILURETYPE_EXPECTASSERT when the macro
  UT_EXPECT_ASSERT_FAILURE() does not detect an ASSERT().
* Move print of log messages to end of cleanup function to support log
  messages generated in a cleanup function.
* Update running of target-based tests to use SetJump()/LongJump()
  around prereq, cleanup, and unit test functions to match the behavior
  of host based tests using cmocka. This also requires all UnitTestLib
  Assert functions to generate error log message first and then call
  UnitTestFailure() where the LongJump() is made to make sure all log
  messages are added before the LongJump().

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2797&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=uuTtY%2BtdCZvv4r6cCeBlydCmqftVVBuTwkg8TXtVqco%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2798&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=OZqCcWPq6GJ3QO3YQcAPV7r04u2xzJCwjDzg2QbW7Uc%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2799&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=%2BkvS3Ar5kX65TKkNy46hsNcGihYBHebpYguFJEXjVEg%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2800&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=Vxdm4iRHixD9FzJjGpIPAwZKgo6OKct1nxGfiU6ycv4%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2801&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=PkSMoe6u7y1yLFY%2BsvXVI0DRLvfWnCWRmPRN1L0G8wY%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2803&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=rRq%2ByS4%2FnUaA4hV8Rwfks16P3IGgePwDS1MuMYbaPXg%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2804&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=AQBJfetimL0OhXoNmLGOrlDmkz01RC0onv5OUR4Jl8k%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2805&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=%2B07i4x%2BTRHGq3SlQsDndfVJvuhqcno9EOWHD%2Ba36WVE%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2806&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=rrb2NdSxAxUHvUjS0D2Gh%2B0dbgQdU2JlPqtIfMvgTDE%3D&reserved=0

* Add Null base libraries for host based unit tests
* Add host based test version of BaseLib with hooks for services that use
  privileged instructions.
* Add new UT_EXPECT_ASSERT_FAILURE() macro to UnitTestLib class
* Enable source level debug of unit tests
* Increase stack size to 256KB for host based tests on Windows
* Update BaseTools to support NULL libs for HOST_APPLICATION modules
* Guarantee print log works even if unit test generates an exception
* Use filename instead of function name in target mode logs

Cc: Liming Gao liming@intel.com
Cc: Bob Feng bob.c.f...@intel.com
Cc: 

Re: [edk2-devel] [Patch v3 12/16] UnitTestFrameworkPkg/UnitTestLib: Add checks for ASSERT()

2020-07-14 Thread Bret Barkelew via groups.io
Reviewed-by: Bret Barkelew 


- Bret

From: Michael D Kinney via 
groups.io
Sent: Tuesday, July 14, 2020 9:26 AM
To: liming.gao; 
devel@edk2.groups.io; Kinney, Michael 
D
Cc: Sean Brogan; Bret 
Barkelew; Yao, 
Jiewen
Subject: [EXTERNAL] Re: [edk2-devel] [Patch v3 12/16] 
UnitTestFrameworkPkg/UnitTestLib: Add checks for ASSERT()

Liming,

I will fix that one issue in the INF comment block
when I push the commits.

Thanks,

Mike

> -Original Message-
> From: Gao, Liming 
> Sent: Monday, July 13, 2020 11:57 PM
> To: devel@edk2.groups.io; Kinney, Michael D
> 
> Cc: Sean Brogan ; Bret
> Barkelew ; Yao, Jiewen
> 
> Subject: RE: [edk2-devel] [Patch v3 12/16]
> UnitTestFrameworkPkg/UnitTestLib: Add checks for
> ASSERT()
>
> Mike:
>
> -Original Message-
> From: devel@edk2.groups.io  On
> Behalf Of Michael D Kinney
> Sent: 2020年7月11日 10:09
> To: devel@edk2.groups.io
> Cc: Sean Brogan ; Bret
> Barkelew ; Yao, Jiewen
> 
> Subject: [edk2-devel] [Patch v3 12/16]
> UnitTestFrameworkPkg/UnitTestLib: Add checks for
> ASSERT()
>
> REF: REF:
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2801&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C3b85c7dd72af42d6295508d82812a84a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303407889843281&sdata=5fA35uRcosAAp0%2B1RVFoCLsGzAaqvc92dmxSVrwDJsY%3D&reserved=0
>
> Add UnitTestDebugAssertLib that provides the
> UnitTestDebugAssert() service and the
> gUnitTestExpectAssertFailureJumpBuffer global variable.
> This NULL library is linked against all host and target
> unit test builds.  This guarantees that the
> UnitTestDebugAssert() service is available to link
> against all libraries and modules that use the DebugLib
> class.
>
> EDKII_UNIT_TEST_FRAMEWORK_ENABLED must always be defined
> when building unit tests so the behavior of the DebugLib
> ASSERT() macros can be adjusted to allow the unit test
> framework to catch an ASSERT() if it is triggered by a
> function under test.
>
> Cc: Sean Brogan 
> Cc: Bret Barkelew 
> Cc: Jiewen Yao 
> Signed-off-by: Michael D Kinney
> 
> ---
>  .../UnitTestDebugAssertLib.c  |  49
> +
>  .../UnitTestDebugAssertLib.inf|  31 +++
>  .../UnitTestDebugAssertLib.uni|  11 +
>  .../Library/UnitTestLib/Assert.c  | 203
> --
>  .../Library/UnitTestLib/AssertCmocka.c|  68
> ++
>  .../Library/UnitTestLib/RunTests.c|  23 +-
>  .../UnitTestResultReportLib.c |   3 +-
>  .../PrivateInclude/UnitTestFrameworkTypes.h   |   1 +
>  .../Test/UnitTestFrameworkPkgHostTest.dsc |   2 +-
>  UnitTestFrameworkPkg/UnitTestFrameworkPkg.dsc |   1 +
>  .../UnitTestFrameworkPkgTarget.dsc.inc|   6 +-
>  11 files changed, 328 insertions(+), 70 deletions(-)
> create mode 100644
> UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/Unit
> TestDebugAssertLib.c
>  create mode 100644
> UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/Unit
> TestDebugAssertLib.inf
>  create mode 100644
> UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/Unit
> TestDebugAssertLib.uni
>
> diff --git
> a/UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/Un
> itTestDebugAssertLib.c
> b/UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/Un
> itTestDebugAssertLib.c
> new file mode 100644
> index 00..0a4001e182
> --- /dev/null
> +++
> b/UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/Un
> itTestDebugA
> +++ ssertLib.c
> @@ -0,0 +1,49 @@
> +/** @file
> +  Unit Test Debug Assert Library
> +
> +  Copyright (c) 2020, Intel Corporation. All rights
> reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +#include 
> +#include 
> +
> +///
> +/// Point to jump buffer used with SetJump()/LongJump()
> to test if a
> +function /// under test generates an expected ASSERT()
> condition.
> +///
> +BASE_LIBRARY_JUMP_BUFFER
> *gUnitTestExpectAssertFailureJumpBuffer =
> +NULL;
> +
> +/**
> +  Unit test library replacement for DebugAssert() in
> DebugLib.
> +
> +  If FileName is NULL, then a  string of
> "(NULL) Filename" is printed.
> +  If Description is NULL, then a  string
> of "(NULL) Description" is printed.
> +
> +  @param  FileName The pointer to the name of the
> source file that generated the assert condition.
> +  @param  LineNumber   The line number in the source
> file that generated the assert condition
> +  @param  Description  The pointer to the description
> of the assert condition.
> +
> +**/
> +VOID
> +EFIAPI
> +UnitTestDebugAssert (
> +  IN CONST CHAR8  *FileName,
> +  IN UINTNLineNumber,
> +  IN CONST CHAR8  *Description
> +  )
> +{
> +  CHAR8  Message[256];
> +
> +  if (gUnitTestExpectAssertFailureJumpBuf

Re: [EXTERNAL] [edk2-devel] [Patch v3 00/16] UnitTestFrameworkPkg: Enhancements and bug fixes

2020-07-14 Thread Bret Barkelew via groups.io
Can’t tell if I got them all. Just let me know if you’re missing any. Thanks!

- Bret

From: Michael D Kinney via 
groups.io
Sent: Friday, July 10, 2020 7:09 PM
To: devel@edk2.groups.io
Subject: [EXTERNAL] [edk2-devel] [Patch v3 00/16] UnitTestFrameworkPkg: 
Enhancements and bug fixes

Changes in V3
==
* Add UnitTestHostBaseLib class for the global variable that allows
  host based unit tests to hook and emulate some BaseLib services

Changes in V2
==
* Add UnitTestExpectAssertFailure() to UnitTestLib to simplify the macro
  UT_EXPECT_ASSERT_FAILURE() and provide better log messages.
* Expand UnitTestFrameworkPkg sample unit tests to cover test cases for the new
  UT_EXPECT_ASSERT_FAILURE() macro and all other UnitTestLib macros.
* Add failure type FAILURETYPE_EXPECTASSERT when the macro
  UT_EXPECT_ASSERT_FAILURE() does not detect an ASSERT().
* Move print of log messages to end of cleanup function to support log
  messages generated in a cleanup function.
* Update running of target-based tests to use SetJump()/LongJump()
  around prereq, cleanup, and unit test functions to match the behavior
  of host based tests using cmocka. This also requires all UnitTestLib
  Assert functions to generate error log message first and then call
  UnitTestFailure() where the LongJump() is made to make sure all log
  messages are added before the LongJump().

REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2797&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=uuTtY%2BtdCZvv4r6cCeBlydCmqftVVBuTwkg8TXtVqco%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2798&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=OZqCcWPq6GJ3QO3YQcAPV7r04u2xzJCwjDzg2QbW7Uc%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2799&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=%2BkvS3Ar5kX65TKkNy46hsNcGihYBHebpYguFJEXjVEg%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2800&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=Vxdm4iRHixD9FzJjGpIPAwZKgo6OKct1nxGfiU6ycv4%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2801&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=PkSMoe6u7y1yLFY%2BsvXVI0DRLvfWnCWRmPRN1L0G8wY%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2803&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=rRq%2ByS4%2FnUaA4hV8Rwfks16P3IGgePwDS1MuMYbaPXg%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2804&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=AQBJfetimL0OhXoNmLGOrlDmkz01RC0onv5OUR4Jl8k%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2805&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=%2B07i4x%2BTRHGq3SlQsDndfVJvuhqcno9EOWHD%2Ba36WVE%3D&reserved=0
REF: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2806&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C85c2633c67ce49ad912208d8253f684a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301547515364&sdata=rrb2NdSxAxUHvUjS0D2Gh%2B0dbgQdU2JlPqtIfMvgTDE%3D&reserved=0

* Add Null base libraries for host based unit tests
* Add host based test version of BaseLib with hooks for services that use
  privileged instructions.
* Add new UT_EXPECT_ASSERT_FAILURE() macro to UnitTestLib class
* Enable source level debug of unit tests
* Increase stack size to 256KB for host based tests on Windows
* Update BaseTools to support NULL libs for HOST_APPLICATION modules
* Guarantee print log works even if unit test generates an exception
* Use filename instead of function name in target mode logs

Cc: Liming Gao liming

Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

2020-07-14 Thread Bret Barkelew via groups.io
Since we’re working on early boot TCG interfaces, is this a good time to 
discuss a standard way to init the log with measurements made by the HW root of 
trust prior to Tcg2Pei? We were using a NULL lib and a registration pattern on 
the PEIM, but I’m open to other ideas, too. Thoughts?

- Bret

From: devel@edk2.groups.io  on behalf of Yao, Jiewen via 
groups.io 
Sent: Tuesday, July 14, 2020 10:08:30 PM
To: Zhang, Qi1 ; devel@edk2.groups.io 

Cc: Wang, Jian J 
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi 
header file.

Thanks Qi.

I just thought one use case that a PEIM may already have a calculated hash  
(https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FSecurityPkg%2FTcg%2FTcg2Pei%2FTcg2Pei.c%23L652&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cbe2bb9ca3e0c4dd95a0a08d8287d21ec%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303865193113145&sdata=V3ofX%2Fvs6Pp%2Bc79cQx4iSB6K324Lyptqrj7FtvmDwsc%3D&reserved=0)
We may need add a flag to support this pre-hash use case. Such as:

> +(EFIAPI *EDKII_TCG_HASH_LOG_EXTEND_EVENT)(
>
> +  IN  EDKII_TCG_PPI *This,
>
> +  IN  UINT64   Flags,  // new field. BIT0 = 0 means 
> HashData is the data to be hashed; BIT0 = 1 means HashData is the pre-hash 
> digest.
>
> +  IN  UINT8 *HashData,
>
> +  IN  UINTN HashDataLen,
>
> +  IN  TCG_PCR_EVENT_HDR *NewEventHdr,
>
> +  IN  UINT8 *NewEventData
>
> +  );

> -Original Message-
> From: Zhang, Qi1 
> Sent: Tuesday, July 14, 2020 2:49 PM
> To: devel@edk2.groups.io
> Cc: Yao, Jiewen ; Wang, Jian J ;
> Zhang, Chao B 
> Subject: [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.
>
> From: Jiewen Yao 
>
> REF: 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2841&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cbe2bb9ca3e0c4dd95a0a08d8287d21ec%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303865193113145&sdata=VgWc2LNPqJRlBisa%2Bvuqq2THVK62f66uzzqh4cle4Rs%3D&reserved=0
>
> Cc: Jiewen Yao 
> Cc: Jian J Wang 
> Cc: Chao Zhang 
> Signed-off-by: Jiewen Yao 
> ---
>  SecurityPkg/Include/Ppi/Tcg.h | 50 +++
>  1 file changed, 50 insertions(+)
>  create mode 100644 SecurityPkg/Include/Ppi/Tcg.h
>
> diff --git a/SecurityPkg/Include/Ppi/Tcg.h b/SecurityPkg/Include/Ppi/Tcg.h
> new file mode 100644
> index 00..4eacd57166
> --- /dev/null
> +++ b/SecurityPkg/Include/Ppi/Tcg.h
> @@ -0,0 +1,50 @@
> +/** @file
>
> +  TCG PPI services.
>
> +
>
> +Copyright (c) 2020, Intel Corporation. All rights reserved.
>
> +SPDX-License-Identifier: BSD-2-Clause-Patent
>
> +
>
> +**/
>
> +
>
> +#ifndef _TCG_PPI_H_
>
> +#define _TCG_PPI_H_
>
> +
>
> +#include 
>
> +
>
> +typedef struct _EDKII_TCG_PPI EDKII_TCG_PPI;
>
> +
>
> +/**
>
> +  Tpm measure and log data, and extend the measurement result into a specific
> PCR.
>
> +
>
> +  @param[in]  This  Indicates the calling context
>
> +  @param[in]  HashData  Physical address of the start of the data 
> buffer
>
> +to be hashed, extended, and logged.
>
> +  @param[in]  HashDataLen   The length, in bytes, of the buffer 
> referenced by
> HashData.
>
> +  @param[in]  NewEventHdr   Pointer to a TCG_PCR_EVENT_HDR data
> structure.
>
> +  @param[in]  NewEventData  Pointer to the new event data.
>
> +
>
> +  @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.
>
> +**/
>
> +typedef
>
> +EFI_STATUS
>
> +(EFIAPI *EDKII_TCG_HASH_LOG_EXTEND_EVENT)(
>
> +  IN  EDKII_TCG_PPI *This,
>
> +  IN  UINT8 *HashData,
>
> +  IN  UINTN HashDataLen,
>
> +  IN  TCG_PCR_EVENT_HDR *NewEventHdr,
>
> +  IN  UINT8 *NewEventData
>
> +  );
>
> +
>
> +///
>
> +/// The EFI_TCG Protocol abstracts TCG activity.
>
> +///
>
> +struct _EDKII_TCG_PPI {
>
> +  EDKII_TCG_HASH_LOG_EXTEND_EVENT HashLogExtendEvent;
>
> +};
>
> +
>
> +extern EFI_GUID gEdkiiTcgPpiGuid;
>
> +
>
> +#endif
>
> --
> 2.26.2.windows.1





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

View/Reply Online (#62592): https://edk2.groups.io/g/devel/message/62592
Mute This Topic: https://groups.io/mt/75496422/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/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

2020-07-15 Thread Bret Barkelew via groups.io
Yeah, that’s kinda what I was thinking. It seemed like there was a little of 
overlap that might eliminate the need for the extra libs (in our current 
solution).

I’ll try to get a more detailed problem statement today, but I think you’ve got 
the right idea there.

- Bret

From: Yao, Jiewen
Sent: Wednesday, July 15, 2020 8:20 AM
To: devel@edk2.groups.io; Yao, 
Jiewen; Bret 
Barkelew; Zhang, 
Qi1
Cc: Wang, Jian J
Subject: [EXTERNAL] RE: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi 
header file.

Maybe we can let TCG PEIM install the TCG_PPI *before* any measurement record, 
then the other PEIM can register a callback to record the HW ROT measurement ?

Thank you
Yao Jiewen

From: devel@edk2.groups.io  On Behalf Of Yao, Jiewen
Sent: Wednesday, July 15, 2020 10:45 PM
To: Bret Barkelew ; devel@edk2.groups.io; Zhang, 
Qi1 
Cc: Wang, Jian J 
Subject: Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header 
file.

Hi Bret
Do you have a full problem statement or Bugzilla?

If we are resolving same problem, we can resolve altogether.
If we are talking different problem, we can resolve one by one.

Thank you
Yao Jiewen

From: Bret Barkelew 
mailto:bret.barke...@microsoft.com>>
Sent: Wednesday, July 15, 2020 1:53 PM
To: devel@edk2.groups.io; Yao, Jiewen 
mailto:jiewen@intel.com>>; Zhang, Qi1 
mailto:qi1.zh...@intel.com>>
Cc: Wang, Jian J mailto:jian.j.w...@intel.com>>
Subject: Re: [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

Since we’re working on early boot TCG interfaces, is this a good time to 
discuss a standard way to init the log with measurements made by the HW root of 
trust prior to Tcg2Pei? We were using a NULL lib and a registration pattern on 
the PEIM, but I’m open to other ideas, too. Thoughts?

- Bret

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> on behalf of Yao, Jiewen 
via groups.io 
mailto:jiewen.yao=intel@groups.io>>
Sent: Tuesday, July 14, 2020 10:08:30 PM
To: Zhang, Qi1 mailto:qi1.zh...@intel.com>>; 
devel@edk2.groups.io 
mailto:devel@edk2.groups.io>>
Cc: Wang, Jian J mailto:jian.j.w...@intel.com>>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi 
header file.

Thanks Qi.

I just thought one use case that a PEIM may already have a calculated hash  
(https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FSecurityPkg%2FTcg%2FTcg2Pei%2FTcg2Pei.c%23L652&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cbe2bb9ca3e0c4dd95a0a08d8287d21ec%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303865193113145&sdata=V3ofX%2Fvs6Pp%2Bc79cQx4iSB6K324Lyptqrj7FtvmDwsc%3D&reserved=0)
We may need add a flag to support this pre-hash use case. Such as:

> +(EFIAPI *EDKII_TCG_HASH_LOG_EXTEND_EVENT)(
>
> +  IN  EDKII_TCG_PPI *This,
>
> +  IN  UINT64   Flags,  // new field. BIT0 = 0 means 
> HashData is the data to be hashed; BIT0 = 1 means HashData is the pre-hash 
> digest.
>
> +  IN  UINT8 *HashData,
>
> +  IN  UINTN HashDataLen,
>
> +  IN  TCG_PCR_EVENT_HDR *NewEventHdr,
>
> +  IN  UINT8 *NewEventData
>
> +  );

> -Original Message-
> From: Zhang, Qi1 mailto:qi1.zh...@intel.com>>
> Sent: Tuesday, July 14, 2020 2:49 PM
> To: devel@edk2.groups.io
> Cc: Yao, Jiewen mailto:jiewen@intel.com>>; Wang, 
> Jian J mailto:jian.j.w...@intel.com>>;
> Zhang, Chao B mailto:chao.b.zh...@intel.com>>
> Subject: [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.
>
> From: Jiewen Yao mailto:jiewen@intel.com>>
>
> REF: 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2841&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cbe2bb9ca3e0c4dd95a0a08d8287d21ec%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303865193113145&sdata=VgWc2LNPqJRlBisa%2Bvuqq2THVK62f66uzzqh4cle4Rs%3D&reserved=0
>
> Cc: Jiewen Yao mailto:jiewen@inte

Re: [EXTERNAL] [edk2-devel] [PATCH v6 00/14] Add the VariablePolicy feature

2020-07-29 Thread Bret Barkelew via groups.io
Still waiting on some R-bs.

Have a new doc that will make it into a v7, if it helps anyone with their 
review…
https://github.com/microsoft/mu_basecore/blob/release/202005/MdeModulePkg/Universal/Variable/UefiVariablePolicy/ReadMe.md

Thanks!

- Bret

From: Bret Barkelew via groups.io<mailto:bret=corthon@groups.io>
Sent: Tuesday, June 23, 2020 4:19 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Yao, Jiewen<mailto:jiewen@intel.com>; Chao 
Zhang<mailto:chao.b.zh...@intel.com>; Jian J 
Wang<mailto:jian.j.w...@intel.com>; Hao A Wu<mailto:hao.a...@intel.com>; 
liming.gao<mailto:liming@intel.com>; Jordan 
Justen<mailto:jordan.l.jus...@intel.com>; Laszlo 
Ersek<mailto:ler...@redhat.com>; Ard Biesheuvel<mailto:ard.biesheu...@arm.com>; 
Andrew Fish<mailto:af...@apple.com>; Ni, Ray<mailto:ray...@intel.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH v6 00/14] Add the VariablePolicy feature

REF:https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2522&data=02%7C01%7Cbret.barkelew%40microsoft.com%7Cdf2ee1dbc25a4810f5ce08d817674112%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637285079522114249&sdata=1%2F3MkPm5HuXeG%2FEaQgl%2F%2F8Tqu3UvgDs6Ich2ezXgjuY%3D&reserved=0

The 14 patches in this series add the VariablePolicy feature to the core,
deprecate Edk2VarLock (while adding a compatibility layer to reduce code
churn), and integrate the VariablePolicy libraries and protocols into
Variable Services.

Since the integration requires multiple changes, including adding libraries,
a protocol, an SMI communication handler, and VariableServices integration,
the patches are broken up by individual library additions and then a final
integration. Security-sensitive changes like bypassing Authenticated
Variable enforcement are also broken out into individual patches so that
attention can be called directly to them.

Platform porting instructions are described in this wiki entry:
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FVariablePolicy-Protocol---Enhanced-Method-for-Managing-Variables%23platform-porting&data=02%7C01%7Cbret.barkelew%40microsoft.com%7Cdf2ee1dbc25a4810f5ce08d817674112%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637285079522114249&sdata=b%2FFdg6Sy2pdxbk3C%2FgVzXvoOWOxW6Z60QXRQ%2BVxGfFs%3D&reserved=0

Discussion of the feature can be found in multiple places throughout
the last year on the RFC channel, staging branches, and in devel.

Most recently, this subject was discussed in this thread:
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F53712&data=02%7C01%7Cbret.barkelew%40microsoft.com%7Cdf2ee1dbc25a4810f5ce08d817674112%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637285079522114249&sdata=epDJobMGos0As5T2JSwhs2PTy1IDt52oLqXkxEPJWLg%3D&reserved=0
(the code branches shared in that discussion are now out of date, but the
whitepapers and discussion are relevant).

Cc: Jiewen Yao 
Cc: Chao Zhang 
Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Liming Gao 
Cc: Jordan Justen 
Cc: Laszlo Ersek 
Cc: Ard Biesheuvel 
Cc: Andrew Fish 
Cc: Ray Ni 
Cc: Bret Barkelew 
Signed-off-by: Bret Barkelew 

v6 changes:
* Fix an issue with uninitialized Status in InitVariablePolicyLib() and 
DeinitVariablePolicyLib()
* Fix GCC building in shell-based functional test
* Rebase on latest origin/master

v5 changes:
* Fix the CONST mismatch in VariablePolicy.h and VariablePolicySmmDxe.c
* Fix EFIAPI mismatches in the functional unittest
* Rebase on latest origin/master

v4 changes:
* Remove Optional PcdAllowVariablePolicyEnforcementDisable PCD from platforms
* Rebase on master
* Migrate to new MmCommunicate2 protocol
* Fix an oversight in the default return value for InitMmCommonCommBuffer
* Fix in VariablePolicyLib to allow ExtraInitRuntimeDxe to consume variables

V3 changes:
* Address all non-unittest issues with ECC
* Make additional style changes
* Include section name in hunk headers in "ini-style" files
* Remove requirement for the EdkiiPiSmmCommunicationsRegionTable driver
  (now allocates its own buffer)
* Change names from VARIABLE_POLICY_PROTOCOL and gVariablePolicyProtocolGuid
  to EDKII_VARIABLE_POLICY_PROTOCOL and gEdkiiVariablePolicyProtocolGuid
* Fix GCC warning about initializing externs
* Add UNI strings for new PCD
* Add patches for ArmVirtPkg, OvmfXen, and UefiPayloadPkg
* Reorder patches according to Liming's feedback about adding to platforms
  before changing variable driver

V2 changes:
* Fixed implementation for RuntimeDxe
* Add PCD to block DisableVariablePolicy
* Fix the DumpVariablePolicy pagination in SMM

Bret Barkelew (14):
  MdeModulePkg: Define the VariablePolicy protocol interface
  MdeModulePkg: Define the VariablePolicyLib
  MdeModulePkg: Define the VariablePolicyHelperLib
  MdeModulePkg:

Re: [EXTERNAL] [edk2-devel] [PATCH v6 00/14] Add the VariablePolicy feature

2020-07-29 Thread Bret Barkelew via groups.io
I believe the ARM platforms already have the change. At least the ArmVirt does 
and some of the edk2-platforms.

This is not news. It’s been broadcast repeatedly for the last 3 months. And the 
last 6 months. And the last 15 months.

- Bret

From: Gao, Liming<mailto:liming@intel.com>
Sent: Wednesday, July 29, 2020 6:36 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Bret 
Barkelew<mailto:bret.barke...@microsoft.com>; 
b...@corthon.com<mailto:b...@corthon.com>; Leif 
Lindholm<mailto:l...@nuviainc.com>
Cc: Yao, Jiewen<mailto:jiewen@intel.com>; Wang, Jian 
J<mailto:jian.j.w...@intel.com>; Wu, Hao A<mailto:hao.a...@intel.com>; Justen, 
Jordan L<mailto:jordan.l.jus...@intel.com>; Laszlo 
Ersek<mailto:ler...@redhat.com>; Ard Biesheuvel<mailto:ard.biesheu...@arm.com>; 
Andrew Fish<mailto:af...@apple.com>; Ni, Ray<mailto:ray...@intel.com>
Subject: RE: [EXTERNAL] [edk2-devel] [PATCH v6 00/14] Add the VariablePolicy 
feature

Include Leif. This change adds new library class dependency for the variable 
driver. So, it requires to update the platform DSC file. It will impact ARM 
platforms.

Thanks
Liming
From: devel@edk2.groups.io  On Behalf Of Bret Barkelew 
via groups.io
Sent: 2020年7月30日 3:56
To: devel@edk2.groups.io; b...@corthon.com
Cc: Yao, Jiewen ; Chao Zhang ; 
Wang, Jian J ; Wu, Hao A ; Gao, 
Liming ; Justen, Jordan L ; 
Laszlo Ersek ; Ard Biesheuvel ; 
Andrew Fish ; Ni, Ray 
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v6 00/14] Add the VariablePolicy 
feature

Still waiting on some R-bs.

Have a new doc that will make it into a v7, if it helps anyone with their 
review…
https://github.com/microsoft/mu_basecore/blob/release/202005/MdeModulePkg/Universal/Variable/UefiVariablePolicy/ReadMe.md<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fmu_basecore%2Fblob%2Frelease%2F202005%2FMdeModulePkg%2FUniversal%2FVariable%2FUefiVariablePolicy%2FReadMe.md&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C4460189461a24b88baf008d83428f56f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637316697813662165&sdata=B0OhR3dFCCE8oh2D02yAV3wv7%2FznN4YfBqFXMrGcrfA%3D&reserved=0>

Thanks!

- Bret

From: Bret Barkelew via groups.io<mailto:bret=corthon@groups.io>
Sent: Tuesday, June 23, 2020 4:19 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Yao, Jiewen<mailto:jiewen@intel.com>; Chao 
Zhang<mailto:chao.b.zh...@intel.com>; Jian J 
Wang<mailto:jian.j.w...@intel.com>; Hao A Wu<mailto:hao.a...@intel.com>; 
liming.gao<mailto:liming@intel.com>; Jordan 
Justen<mailto:jordan.l.jus...@intel.com>; Laszlo 
Ersek<mailto:ler...@redhat.com>; Ard Biesheuvel<mailto:ard.biesheu...@arm.com>; 
Andrew Fish<mailto:af...@apple.com>; Ni, Ray<mailto:ray...@intel.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH v6 00/14] Add the VariablePolicy feature

REF:https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2522&data=02%7C01%7Cbret.barkelew%40microsoft.com%7Cdf2ee1dbc25a4810f5ce08d817674112%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637285079522114249&sdata=1%2F3MkPm5HuXeG%2FEaQgl%2F%2F8Tqu3UvgDs6Ich2ezXgjuY%3D&reserved=0

The 14 patches in this series add the VariablePolicy feature to the core,
deprecate Edk2VarLock (while adding a compatibility layer to reduce code
churn), and integrate the VariablePolicy libraries and protocols into
Variable Services.

Since the integration requires multiple changes, including adding libraries,
a protocol, an SMI communication handler, and VariableServices integration,
the patches are broken up by individual library additions and then a final
integration. Security-sensitive changes like bypassing Authenticated
Variable enforcement are also broken out into individual patches so that
attention can be called directly to them.

Platform porting instructions are described in this wiki entry:
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FVariablePolicy-Protocol---Enhanced-Method-for-Managing-Variables%23platform-porting&data=02%7C01%7Cbret.barkelew%40microsoft.com%7Cdf2ee1dbc25a4810f5ce08d817674112%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637285079522114249&sdata=b%2FFdg6Sy2pdxbk3C%2FgVzXvoOWOxW6Z60QXRQ%2BVxGfFs%3D&reserved=0<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FVariablePolicy-Protocol---Enhanced-Method-for-Managing-Variables%23platform-porting&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C4460189461a24b88baf008d83428f56f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637316697813662165&sdata=DS3OTIAEGm%2FgE9a%2FM87ILjkYuKdvFJg%2FI8nN1tSXP04%3D&reserved=0>

Discussion of the feature can be found in multiple places throughout

Re: [edk2-devel] [EXTERNAL] [PATCH v2 1/1] .pytool/Plugin/HostUnitTestCompilerPlugin: Enable BUILDREPORT on host tests

2020-08-03 Thread Bret Barkelew via groups.io
Second version (ignore the title) of this coming soon to update the regular 
builds and collect the artifacts.

- Bret

From: Bret Barkelew
Sent: Monday, August 3, 2020 3:50 PM
To: devel@edk2.groups.io
Cc: Sean Brogan; Bret 
Barkelew; Kinney, Michael 
D; liming.gao
Subject: [EXTERNAL] [PATCH v2 1/1] .pytool/Plugin/HostUnitTestCompilerPlugin: 
Enable BUILDREPORT on host tests

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/HostUnitTestCompilerPlugin/HostUnitTestCompilerPlugin.py | 2 ++
 1 file changed, 2 insertions(+)

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 (#63680): https://edk2.groups.io/g/devel/message/63680
Mute This Topic: https://groups.io/mt/75978577/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/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

2020-08-03 Thread Bret Barkelew via groups.io
The more I think about it, the more I like your idea of registering early and 
allowing a PPI notification callback.

Is that something we could get in this change, or would it be best to open a 
new BZ to track that request? Thanks!


- Bret


From: devel@edk2.groups.io  on behalf of Bret Barkelew 
via groups.io 
Sent: Wednesday, July 15, 2020 8:32 AM
To: Yao, Jiewen ; devel@edk2.groups.io 
; Zhang, Qi1 
Cc: Wang, Jian J 
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi 
header file.


Yeah, that’s kinda what I was thinking. It seemed like there was a little of 
overlap that might eliminate the need for the extra libs (in our current 
solution).



I’ll try to get a more detailed problem statement today, but I think you’ve got 
the right idea there.



- Bret



From: Yao, Jiewen<mailto:jiewen@intel.com>
Sent: Wednesday, July 15, 2020 8:20 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Yao, 
Jiewen<mailto:jiewen@intel.com>; Bret 
Barkelew<mailto:bret.barke...@microsoft.com>; Zhang, 
Qi1<mailto:qi1.zh...@intel.com>
Cc: Wang, Jian J<mailto:jian.j.w...@intel.com>
Subject: [EXTERNAL] RE: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi 
header file.



Maybe we can let TCG PEIM install the TCG_PPI *before* any measurement record, 
then the other PEIM can register a callback to record the HW ROT measurement ?



Thank you

Yao Jiewen



From: devel@edk2.groups.io  On Behalf Of Yao, Jiewen
Sent: Wednesday, July 15, 2020 10:45 PM
To: Bret Barkelew ; devel@edk2.groups.io; Zhang, 
Qi1 
Cc: Wang, Jian J 
Subject: Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header 
file.



Hi Bret

Do you have a full problem statement or Bugzilla?



If we are resolving same problem, we can resolve altogether.

If we are talking different problem, we can resolve one by one.



Thank you

Yao Jiewen



From: Bret Barkelew 
mailto:bret.barke...@microsoft.com>>
Sent: Wednesday, July 15, 2020 1:53 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Yao, Jiewen 
mailto:jiewen@intel.com>>; Zhang, Qi1 
mailto:qi1.zh...@intel.com>>
Cc: Wang, Jian J mailto:jian.j.w...@intel.com>>
Subject: Re: [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.



Since we’re working on early boot TCG interfaces, is this a good time to 
discuss a standard way to init the log with measurements made by the HW root of 
trust prior to Tcg2Pei? We were using a NULL lib and a registration pattern on 
the PEIM, but I’m open to other ideas, too. Thoughts?



- Bret



From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>> on behalf of Yao, Jiewen 
via groups.io 
mailto:jiewen.yao=intel@groups.io>>
Sent: Tuesday, July 14, 2020 10:08:30 PM
To: Zhang, Qi1 mailto:qi1.zh...@intel.com>>; 
devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>>
Cc: Wang, Jian J mailto:jian.j.w...@intel.com>>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi 
header file.



Thanks Qi.

I just thought one use case that a PEIM may already have a calculated hash  
(https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FSecurityPkg%2FTcg%2FTcg2Pei%2FTcg2Pei.c%23L652&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cbe2bb9ca3e0c4dd95a0a08d8287d21ec%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303865193113145&sdata=V3ofX%2Fvs6Pp%2Bc79cQx4iSB6K324Lyptqrj7FtvmDwsc%3D&reserved=0<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FSecurityPkg%2FTcg%2FTcg2Pei%2FTcg2Pei.c%23L652&data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cb085558d5f2f4302ec6e08d828d45a24%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637304239804005314&sdata=Mgd7fbYkhizLUstwfZHiMUwpvnyrzXO1fZLUvEXKvz8%3D&reserved=0>)
We may need add a flag to support this pre-hash use case. Such as:

> +(EFIAPI *EDKII_TCG_HASH_LOG_EXTEND_EVENT)(
>
> +  IN  EDKII_TCG_PPI *This,
>
> +  IN  UINT64   Flags,  // new field. BIT0 = 0 means 
> HashData is the data to be hashed; BIT0 = 1 means HashData is the pre-hash 
> digest.
>
> +  IN  UINT8 *HashData,
>
> +  IN  UINTN HashDataLen,
>
> +  IN  TCG_PCR_EVENT_HDR *NewEventHdr,
>
> +  IN  UINT8 *NewEventData
>
> +  );

> -Original Message-
> From: Zhang, Qi1 mailto:qi1.zh...@intel.com>>
> Sent: Tuesday, July 14, 2020 2:49 PM
> To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> Cc: Yao, Jiewen mailto:jiewen@intel.com>>; Wang, 
> Jian J mailto:jian.j.w...@intel.com>>;
> Zhang, Chao B mailto:chao.b.zh...@intel.com>>

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

Re: [edk2-devel] Soft Feature Freeze starts now for edk2-stable202008

2020-08-17 Thread Bret Barkelew via groups.io
I would like Variable Policy to be considered for this feature freeze. I have a 
couple of documentation things to respond to, but no serious functionality 
questions (that I know of).

- Bret

From: devel@edk2.groups.io  on behalf of Liming Gao via 
groups.io 
Sent: Friday, August 14, 2020 1:16:41 AM
To: devel@edk2.groups.io ; annou...@edk2.groups.io 

Cc: Laszlo Ersek ; Leif Lindholm ; 
af...@apple.com ; Kinney, Michael D 
; Guptha, Soumya K 
Subject: [EXTERNAL] [edk2-devel] Soft Feature Freeze starts now for 
edk2-stable202008


Hi, all

  We will enter into Soft Feature Freeze phase. In this phase, the feature 
under review will not be allowed to be pushed. The feature passed review can 
still be merged. Now, two features have passed code review. If no other 
comments, I will merge them into this stable tag. They are: 
https://edk2.groups.io/g/devel/message/64176
 SEV-ES guest support, 
https://edk2.groups.io/g/devel/message/64283
 Add a plugin to check Ecc issues for edk2 on open ci.



The patch review can continue without break in edk2 community. If the patch is 
sent before Soft Feature Freeze, and plans to catch this stable tag, the patch 
contributor need reply to his patch and notify edk2 community. If the patch is 
sent after Soft Feature Freeze, and plans to catch this stable tag, please add 
edk2-stable202008 key words in the patch title and BZ, so the community know 
this patch target and give the feedback.



Below is edk2-stable202008 tag planning 
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning
 Proposed Schedule

Date (00:00:00 UTC-8) Description

2020-06-03  Beginning of development

2020-08-07  Feature Planning Freeze

2020-08-14  Soft Feature Freeze

2020-08-21  Hard Feature Freeze

2020-08-28  Release



Thanks

Liming



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

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



Re: [edk2-devel] [EXTERNAL] Re: Soft Feature Freeze starts now for edk2-stable202008

2020-08-17 Thread Bret Barkelew via groups.io
Not yet, which is also why I’m raising the note ASAP. I’ll respond to the other 
feedback today to get that moving.

- Bret

From: Laszlo Ersek
Sent: Monday, August 17, 2020 1:46 PM
To: Bret Barkelew; 
devel@edk2.groups.io; 
liming.gao; 
annou...@edk2.groups.io
Cc: Leif Lindholm; 
af...@apple.com; Kinney, Michael 
D; Guptha, Soumya 
K
Subject: [EXTERNAL] Re: Soft Feature Freeze starts now for edk2-stable202008

Hi Bret,

On 08/17/20 20:14, Bret Barkelew wrote:
> I would like Variable Policy to be considered for this feature freeze. I have 
> a couple of documentation things to respond to, but no serious functionality 
> questions (that I know of).

Has review completed on the series (before entering the soft feature
freeze)?

https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FSoftFeatureFreeze&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C39b20e742dff4f810fa708d842eea26a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637332939979144622&sdata=%2BsSEmkhvkuzZqSUxNbK9cWWWnweRVmN0SG7HheLAIPc%3D&reserved=0

(Please note that I don't insist on this particular definition of the
SFF; it's what we have modeled on the QEMU soft feature freeze
definition. It's not carved in stone. It's just what we have for now.)

Thanks
Laszlo


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

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



Re: [edk2-devel] [PATCH v6 00/14] Add the VariablePolicy feature

2020-08-17 Thread Bret Barkelew via groups.io
Responses below…

- Bret

From: Dandan Bi via groups.io
Sent: Tuesday, August 11, 2020 6:52 AM
To: devel@edk2.groups.io; Bi, 
Dandan; b...@corthon.com
Cc: Yao, Jiewen; Zhang, Chao 
B; Wang, Jian J; 
Wu, Hao A; liming.gao; 
Justen, Jordan L; Laszlo 
Ersek; Ard Biesheuvel; 
Andrew Fish; Ni, Ray
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v6 00/14] Add the VariablePolicy 
feature

Hi Bret,

Sorry for the delayed response.

Some more comments here:

1. Currently I see the LockVaribePolicy is called at ReadyToBoot by variable 
driver, could we update it to be called at EndOfDxe? We should prevent 
malicious code registering policy after EndOfDxe for security concern. And 
could we also add the test case to check the variable policy is locked at 
EndofDxe?
We could. Right now it’s at ReadyToBoot because it’s just there as a safety net 
and the platform could lock it earlier. Would it work to have a PCD for which 
EventGroup GUID the platform should lock on?

2. For patch 4, the SMM communication,  some general guidelines for SMI handler:
a)  Check whether the communication buffer is outside SMM and valid.
For this feature, please double check whether the communication buffer is 
checked, if all the range in communication buffer has already been checked 
within existing edk2 core infrastructure, please also add the comments in the 
code to mention that it has been checked.
I checked this, but I will recheck (since there’ve been a few revisions in the 
patches) and update the comments.

b) Should copy the communication buffer to SMRAM before checking the data 
fields to avoid TOC/TOU attac
For this feature, for example, when dump variable policy, if malicious code 
updates the DumpParams->TotalSize in communication buffer to smaller one to 
allocate the PaginationCache buffer, and then update it the correct one and 
dump the variable policy data into the PaginationCache buffer, it will cause 
buffer overflow in this case.  So please double check the code and copy the 
communication buffer into SMRAM to avoid such kind issue.
Will also check for this.

3. Did you do any security test for this feature?
Such as? There are both unit tests and integration tests to ensure correct 
functionality and that the disable and lock interfaces work as expected. I 
haven’t fuzzed it or anything that involved.

4. Currently, LockVariablePolicy can prevent RegisterVariablePolicy and 
DisableVariablePolicy. So in SMI hander, could we check the variable policy is 
locked or not firstly and then decide whether need to check and execution for 
VAR_CHECK_POLICY_COMMAND_REGISTER and VAR_CHECK_POLICY_COMMAND_DISABLE?
I’ll take a look, but my gut says this may be an unnecessary complication.

5. Since there is the logic when variable policy is disabled, it will permit 
deletion of auth/protected variables. Could we add some comments in code to 
mention that variable policy should always be enabled for security concern to 
avoid giving bad example?
I’m happy to think about how to document this, but I’m not immediately inclined 
to outright say it shouldn’t be disabled. I’d be happy to say that it shouldn’t 
be disabled in “normal, production configuration”, but it’s entirely reasonable 
to be disabled in a Manufacturing or R&R environment and we would actually 
prefer this be used because it would at least be consistent across platforms, 
rather than being something done ad hoc by each platform that needs it. Would 
that be sufficient?

Thanks,
Dandan
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Dandan
> Bi
> Sent: Thursday, July 2, 2020 10:14 AM
> To: devel@edk2.groups.io; b...@corthon.com
> Cc: Yao, Jiewen ; Zhang, Chao B
> ; Wang, Jian J ; Wu, Hao
> A ; Gao, Liming ; Justen,
> Jordan L ; Laszlo Ersek ;
> Ard Biesheuvel ; Andrew Fish
> ; Ni, Ray 
> Subject: Re: [edk2-devel] [PATCH v6 00/14] Add the VariablePolicy feature
>
> Hi Bret,
>
> Thanks for the contribution.
>
> I have taken an overview of this patch series and have some small comments
> in the related patches, please check in sub-patch.
>
> I will review the patch series more in details and bring more comments back
> if have. Do you have a branch for these patches in GitHub? Which should be
> easy for review.
>
>
> Thanks,
> Dandan
>
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Bret
> > Barkelew
> > Sent: Tuesday, June 23, 2020 2:41 PM
> > To: devel@edk2.groups.io
> > Cc: Yao, Jiewen ; Zhang, Chao B
> > ; Wang, Jian J ; Wu,
> > Hao A ; Gao, Liming ;
> > Justen, Jordan L ; Laszlo Ersek
> > ; Ard Biesheuvel ;
> Andrew
> > Fish

Re: [edk2-devel] [EXTERNAL] Re: Soft Feature Freeze starts now for edk2-stable202008

2020-08-18 Thread Bret Barkelew via groups.io
I agree with the process and withdraw my request, replacing it instead with a 
disapproving head shake and deep sigh. I’ll go back to pushing on this after 
the tag.

- Bret

From: Laszlo Ersek 
Sent: Tuesday, August 18, 2020 3:29:19 AM
To: Bret Barkelew ; devel@edk2.groups.io 
; liming.gao ; 
annou...@edk2.groups.io 
Cc: Leif Lindholm ; af...@apple.com ; 
Kinney, Michael D ; Guptha, Soumya K 

Subject: Re: [EXTERNAL] Re: Soft Feature Freeze starts now for edk2-stable202008

On 08/17/20 23:33, Bret Barkelew wrote:
> Not yet, which is also why I’m raising the note ASAP. I’ll respond to the 
> other feedback today to get that moving.

During the SFF, only such feature sets may be merged whose review
completed *before* the SFF. In other words, for a feature series, only
the merging part may slip into the SFF; the review part must not.

(Again, I'm just explaining the current SFF definition. If we want to
change the SFF definition, that's a different discussion -- I'm not
particularly vested in the current one, I had just suggested it
following the pattern that QEMU had set. The edk2 community is free to
choose different definitions.)

Thanks!
Laszlo

>
> - Bret
>
> From: Laszlo Ersek
> Sent: Monday, August 17, 2020 1:46 PM
> To: Bret Barkelew; 
> devel@edk2.groups.io; 
> liming.gao; 
> annou...@edk2.groups.io
> Cc: Leif Lindholm; 
> af...@apple.com; Kinney, Michael 
> D; Guptha, Soumya 
> K
> Subject: [EXTERNAL] Re: Soft Feature Freeze starts now for edk2-stable202008
>
> Hi Bret,
>
> On 08/17/20 20:14, Bret Barkelew wrote:
>> I would like Variable Policy to be considered for this feature freeze. I 
>> have a couple of documentation things to respond to, but no serious 
>> functionality questions (that I know of).
>
> Has review completed on the series (before entering the soft feature
> freeze)?
>
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FSoftFeatureFreeze&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C7ff8e944ced74925aade08d8436195f3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637333433692184517&sdata=Z8nsDP5gMm9YR%2BFTr0sYIslXZXUA9sYgvyGH8CBKlJM%3D&reserved=0
>
> (Please note that I don't insist on this particular definition of the
> SFF; it's what we have modeled on the QEMU soft feature freeze
> definition. It's not carved in stone. It's just what we have for now.)
>
> Thanks
> Laszlo
>
>


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

View/Reply Online (#64387): https://edk2.groups.io/g/devel/message/64387
Mute This Topic: https://groups.io/mt/76253625/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 v2 1/1] SecurityPkg/DxeImageVerificationLib:Enhanced verification of Offset

2020-08-18 Thread Bret Barkelew via groups.io
Jiewen,

I don’t completely agree with your second point. If the underlying issue is 
already out of embargo, and we’ve just failed to fix it, that’s not a new 
issue. I would want to see fixes to the fixes fast-tracked (or at least heavily 
prioritized), rather than re-entering a full embargo period.

- Bret

From: Yao, Jiewen via groups.io
Sent: Tuesday, August 18, 2020 6:12 AM
To: devel@edk2.groups.io; 
ler...@redhat.com
Cc: xiewen...@huawei.com; Wang, Jian 
J; 
huangmin...@huawei.com; 
songdongku...@huawei.com; Marvin 
Häuser; Vitaly 
Cheptsov
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH EDK2 v2 1/1] 
SecurityPkg/DxeImageVerificationLib:Enhanced verification of Offset

Hi Laszlo
I agree with on your most points.
It is all about *return of investment* or *risk control*. Like we cannot pursue 
100% security because we will bankrupt ourselves if so.

Here I just raise my concern.
1) If we alway allow developers’ low quality patch without test, the overall 
quality will become lower and lower. Personally I have no confidence to help 
catch all those issues. You are the role model on code review. But not all 
people review the code like you. We need both expertise and time for code 
review.

2) I purposely separate security fix from non security one, because the process 
is different. The embargo might be 6 months. What if we found the security 
patch does not fix the problem after embargo? Unlike we send one more patch 
tomorrow, we need wait for another 6 months...

thank you!
Yao, Jiewen


> 在 2020年8月18日,下午6:17,Laszlo Ersek  写道:
>
> Hi Jiewen,
>
> (+Marvin, +Vitaly)
>
> On 08/18/20 01:23, Yao, Jiewen wrote:
>>> -Original Message-
>>> From: devel@edk2.groups.io  On Behalf Of Laszlo
>>> Ersek
>>> Sent: Tuesday, August 18, 2020 12:53 AM
>>> To: Yao, Jiewen ; devel@edk2.groups.io;
>>> xiewen...@huawei.com; Wang, Jian J 
>>> Cc: huangmin...@huawei.com; songdongku...@huawei.com
>>> Subject: Re: [edk2-devel] [PATCH EDK2 v2 1/1]
>>> SecurityPkg/DxeImageVerificationLib:Enhanced verification of Offset
>
> [...]
>
>> However, I do think the producer is mandatory for a fix or at least a
>> security fix.
>> The owner to fix the issue should guarantee the patch is good.
>> The owner shall never rely on the code reviewer to figure out if the
>> patch is good and complete.
>>
>> I have some bad experience that bug owner just wrote a patch and tried
>> to fix a problem, without any test.
>> And it happened passed code review from someone who does not well
>> understand the problem, but give rb based upon the time pressure.
>> Later, the fix was approved to be useless.
>>
>> In my memory, at least 3 cases were security fix. They are found, just
>> because they are sensitive, more people took a look later.
>>It was simple. It was one-line change.
>>   But it has not test, and it was wrong.
>> "It was ridiculous" -- commented by the people who find the so-called
>> security fix does not fix the issue.
>
> Just because sloppy/rushed reviews exist, and just because reviewers
> operate under time pressure, we should not automatically reject security
> fixes that come without a reproducer.
>
> Some organizations do develop reproducers, but they never share them
> publicly (for fear of abuse by others).
>
> But more importantly, in an open development project, a developer could
> have time and expertise to contribute a fix, but not to create a
> reproducer.
>
> - If we make contributing harder, fewer people will upstream their
>  fixes.
>
> - If we make contributing harder, then contributions that do make it to
>  the tree will be of higher quality.
>
> Both statements ring true to me -- so it's a tradeoff.
>
> (By "we", I mean the edk2 community.)
>
>>> Additionally, the exact statement that the bug report does make,
>>> namely
>>>
>>>  it's possible to overflow Offset back to 0 causing an endless loop
>>>
>>> is wrong (as far as I can tell anyway). It is not "OffSet" that can
>>> be overflowed to zero, but the *addend* that is added to OffSet can
>>> be overflowed to zero. Therefore the infinite loop will arise because
>>> OffSet remains stuck at its present value, and not because OffSet
>>> will be re-set to zero.
>>>
>>> For the reasons, we can only speculate as to what the actual problem
>>> is, unless Jian decides to join the discussion and clarifies what he
>>> had in mind originally.
>>
>> [Jiewen] Would you please clarify what do you mean "we" here?
>> If "we" means the bug dispatcher, it is totally OK. The dispatcher
>> just assign the bug.
>> If "we" means the developer assigned to fix the bug, it is NOT OK. The
>> developer should take the responsibility to understand the problem.
>
> By "we", I mean the edk2 community.
>
>>> We can w

Re: [edk2-devel] question about UnitTest Framework

2020-08-18 Thread Bret Barkelew via groups.io
Correct. It’s possible that we can have some sort of test reunion at some 
point, but SCT is largely for interfaces and spec compliance, and the UnitTest 
Framework is for implementation business logic, CI, and code coverage.

- Bret

From: Tiger Liu(BJ-RD) via groups.io
Sent: Tuesday, August 18, 2020 10:17 PM
To: devel@edk2.groups.io; Tiger 
Liu(BJ-RD)
Subject: [外部] Re: [edk2-devel] question about UnitTest Framework

Hi,
After studying previous discuss mail, UnitTest Framework is work for Continuous 
Integration mechanism.

Code writer will provide some unit test functions, maybe they could also do 
code coverage test.

Thanks
-邮件原件-
发件人: devel@edk2.groups.io  代表 Tiger Liu(BJ-RD)
发送时间: 2020年8月13日 16:03
收件人: devel@edk2.groups.io
主题: [edk2-devel] question about UnitTest Framework

Hi, Experts:
I have a question about UnitTest Framework.

UEFI Code has included some test infrastructure, such as:
PI-SCT / SCT / FWTS etc.

So, why we introduce a new UnitTest Framework?

Is it mainly for Code Coverage test?

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 (#64417): https://edk2.groups.io/g/devel/message/64417
Mute This Topic: https://groups.io/mt/76163664/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



  1   2   3   >