Re: [edk2-devel] 回复: [PATCH v3 1/1] MdePkg/BaseLib: Fix out-of-bounds reads in SafeString

2022-11-07 Thread Pedro Falcato
Thanks!

On Mon, 7 Nov 2022, 01:32 gaoliming via groups.io,  wrote:

> Create https://github.com/tianocore/edk2/pull/3604 to merge this patch.
>
>
>
> Thanks
>
> Liming
>
> *发件人:* devel@edk2.groups.io  *代表 *Pedro Falcato
> *发送时间:* 2022年11月5日 8:25
> *收件人:* devel@edk2.groups.io; gaolim...@byosoft.com.cn
> *抄送:* Vitaly Cheptsov ; Marvin Häuser <
> mhaeu...@posteo.de>; Michael D Kinney ;
> Zhiguang Liu ; Jiewen Yao 
> *主题:* Re: [edk2-devel] 回复: [PATCH v3 1/1] MdePkg/BaseLib: Fix
> out-of-bounds reads in SafeString
>
>
>
> Hi Liming,
>
>
>
> Thank you for the review. Can we please push this in time for the stable
> tag?
>
>
>
> Thanks,
>
> Pedro
>
>
>
> On Fri, Nov 4, 2022 at 1:22 AM gaoliming via groups.io  byosoft.com...@groups.io> wrote:
>
> Reviewed-by: Liming Gao 
>
> > -邮件原件-
> > 发件人: Pedro Falcato 
> > 发送时间: 2022年11月3日 9:12
> > 收件人: devel@edk2.groups.io
> > 抄送: Pedro Falcato ; Vitaly Cheptsov
> > ; Marvin Häuser ;
> > Michael D Kinney ; Liming Gao
> > ; Zhiguang Liu ;
> Jiewen
> > Yao 
> > 主题: [PATCH v3 1/1] MdePkg/BaseLib: Fix out-of-bounds reads in SafeString
> >
> > There was a OOB access in *StrHexTo* functions, when passed strings like
> > "XDEADBEEF".
> >
> > OpenCore folks established an ASAN-equipped project to fuzz Ext4Dxe,
> > which was able to catch these (mostly harmless) issues.
> >
> > Cc: Vitaly Cheptsov 
> > Cc: Marvin Häuser 
> > Cc: Michael D Kinney 
> > Cc: Liming Gao 
> > Cc: Zhiguang Liu 
> > Signed-off-by: Pedro Falcato 
> > Acked-by: Michael D Kinney 
> > Reviewed-by: Jiewen Yao 
> > ---
> >  MdePkg/Library/BaseLib/SafeString.c | 25 +
> >  1 file changed, 21 insertions(+), 4 deletions(-)
> >
> > diff --git a/MdePkg/Library/BaseLib/SafeString.c
> > b/MdePkg/Library/BaseLib/SafeString.c
> > index f338a32a3a41..b75b33381732 100644
> > --- a/MdePkg/Library/BaseLib/SafeString.c
> > +++ b/MdePkg/Library/BaseLib/SafeString.c
> > @@ -863,6 +863,9 @@ StrHexToUintnS (
> >OUT   UINTN   *Data
> >)
> >  {
> > +  BOOLEAN  FoundLeadingZero;
> > +
> > +  FoundLeadingZero = FALSE;
> >ASSERT (((UINTN)String & BIT0) == 0);
> >
> >//
> > @@ -892,12 +895,14 @@ StrHexToUintnS (
> >//
> >// Ignore leading Zeros after the spaces
> >//
> > +
> > +  FoundLeadingZero = *String == L'0';
> >while (*String == L'0') {
> >  String++;
> >}
> >
> >if (CharToUpper (*String) == L'X') {
> > -if (*(String - 1) != L'0') {
> > +if (!FoundLeadingZero) {
> >*Data = 0;
> >return RETURN_SUCCESS;
> >  }
> > @@ -992,6 +997,9 @@ StrHexToUint64S (
> >OUT   UINT64  *Data
> >)
> >  {
> > +  BOOLEAN  FoundLeadingZero;
> > +
> > +  FoundLeadingZero = FALSE;
> >ASSERT (((UINTN)String & BIT0) == 0);
> >
> >//
> > @@ -1021,12 +1029,13 @@ StrHexToUint64S (
> >//
> >// Ignore leading Zeros after the spaces
> >//
> > +  FoundLeadingZero = *String == L'0';
> >while (*String == L'0') {
> >  String++;
> >}
> >
> >if (CharToUpper (*String) == L'X') {
> > -if (*(String - 1) != L'0') {
> > +if (!FoundLeadingZero) {
> >*Data = 0;
> >return RETURN_SUCCESS;
> >  }
> > @@ -2393,6 +2402,9 @@ AsciiStrHexToUintnS (
> >OUT   UINTN  *Data
> >)
> >  {
> > +  BOOLEAN  FoundLeadingZero;
> > +
> > +  FoundLeadingZero = FALSE;
> >//
> >// 1. Neither String nor Data shall be a null pointer.
> >//
> > @@ -2420,12 +2432,13 @@ AsciiStrHexToUintnS (
> >//
> >// Ignore leading Zeros after the spaces
> >//
> > +  FoundLeadingZero = *String == '0';
> >while (*String == '0') {
> >  String++;
> >}
> >
> >if (AsciiCharToUpper (*String) == 'X') {
> > -if (*(String - 1) != '0') {
> > +if (!FoundLeadingZero) {
> >*Data = 0;
> >return RETURN_SUCCESS;
> >  }
> > @@ -2517,6 +2530,9 @@ AsciiStrHexToUint64S (
> >OUT   UINT64  *Data
> >)
> >  {
> > +  BOOLEAN  FoundLeadingZero;
> > +
> > +  FoundLeadingZero = FALSE;
> >//
> >// 1. Neither String nor Data shall be a null pointer.
> >//
> > @@ -2544,12 +2560,13 @@ AsciiStrHexToUint64S (
> >//
> >// Ignore leading Zeros after the spaces
> >//
> > +  FoundLeadingZero = *String == '0';
> >while (*String == '0') {
> >  String++;
> >}
> >
> >if (AsciiCharToUpper (*String) == 'X') {
> > -if (*(String - 1) != '0') {
> > +if (!FoundLeadingZero) {
> >*Data = 0;
> >return RETURN_SUCCESS;
> >  }
> > --
> > 2.38.1
>
>
>
>
>
>
>
>
>
> --
>
> Pedro Falcato
>
> 
>


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




[edk2-devel][PATCH v1] IntelFsp2Pkg: Adding FspHelperLib

2022-11-07 Thread Kuo, Ted
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4128
Adding FspHelperLib for platform code to consume. There will be
another patch raised later for FspSecCore to consume FspHelperLib.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Star Zeng 
Cc: Ashraf Ali S 
Cc: Chinni B Duggapu 
Cc: Amy Chan 
Signed-off-by: Ted Kuo 
---
 IntelFsp2Pkg/FspSecCore/SecFsp.h  | 25 +-
 IntelFsp2Pkg/Include/Library/FspHelperLib.h   | 35 +
 IntelFsp2Pkg/IntelFsp2Pkg.dsc |  2 +
 .../BaseFspHelperLib/BaseFspHelperLib.inf | 50 +++
 .../BaseFspHelperLib/Ia32/FspHelper.nasm  | 35 +
 .../BaseFspHelperLib/X64/FspHelper.nasm   | 34 +
 6 files changed, 157 insertions(+), 24 deletions(-)
 create mode 100644 IntelFsp2Pkg/Include/Library/FspHelperLib.h
 create mode 100644 IntelFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.inf
 create mode 100644 IntelFsp2Pkg/Library/BaseFspHelperLib/Ia32/FspHelper.nasm
 create mode 100644 IntelFsp2Pkg/Library/BaseFspHelperLib/X64/FspHelper.nasm

diff --git a/IntelFsp2Pkg/FspSecCore/SecFsp.h b/IntelFsp2Pkg/FspSecCore/SecFsp.h
index d7a5976c12..f12769890f 100644
--- a/IntelFsp2Pkg/FspSecCore/SecFsp.h
+++ b/IntelFsp2Pkg/FspSecCore/SecFsp.h
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define FSP_MCUD_SIGNATURE  SIGNATURE_32 ('M', 'C', 'U', 'D')
 #define FSP_PER0_SIGNATURE  SIGNATURE_32 ('P', 'E', 'R', '0')
@@ -64,28 +65,4 @@ FspDataPointerFixUp (
   IN UINTN  OffsetGap
   );
 
-/**
-  This interface returns the base address of FSP binary.
-
-  @return   FSP binary base address.
-
-**/
-UINTN
-EFIAPI
-AsmGetFspBaseAddress (
-  VOID
-  );
-
-/**
-  This interface gets FspInfoHeader pointer
-
-  @return   FSP binary base address.
-
-**/
-UINTN
-EFIAPI
-AsmGetFspInfoHeader (
-  VOID
-  );
-
 #endif
diff --git a/IntelFsp2Pkg/Include/Library/FspHelperLib.h 
b/IntelFsp2Pkg/Include/Library/FspHelperLib.h
new file mode 100644
index 00..84b74fa7aa
--- /dev/null
+++ b/IntelFsp2Pkg/Include/Library/FspHelperLib.h
@@ -0,0 +1,35 @@
+/** @file
+  Header file for FSP Helper Library.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _FSP_HELPER_LIB_H_
+#define _FSP_HELPER_LIB_H_
+
+/**
+  This interface returns the base address of FSP binary.
+
+  @return   FSP binary base address.
+
+**/
+UINTN
+EFIAPI
+AsmGetFspBaseAddress (
+  VOID
+  );
+
+/**
+  This interface gets FspInfoHeader pointer
+
+  @return   FSP info header.
+**/
+UINTN
+EFIAPI
+AsmGetFspInfoHeader (
+  VOID
+  );
+
+#endif // _FSP_HELPER_LIB_H_
diff --git a/IntelFsp2Pkg/IntelFsp2Pkg.dsc b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
index 0713f0028d..09893d70e8 100644
--- a/IntelFsp2Pkg/IntelFsp2Pkg.dsc
+++ b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
@@ -46,6 +46,7 @@
   
FspSwitchStackLib|IntelFsp2Pkg/Library/BaseFspSwitchStackLib/BaseFspSwitchStackLib.inf
   
FspSecPlatformLib|IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/SecFspSecPlatformLibNull.inf
   
FspMultiPhaseLib|IntelFsp2Pkg/Library/BaseFspMultiPhaseLib/BaseFspMultiPhaseLib.inf
+  FspHelperLib|IntelFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.inf
 
 [LibraryClasses.common.PEIM]
   PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
@@ -66,6 +67,7 @@
   IntelFsp2Pkg/Library/BaseDebugDeviceLibNull/BaseDebugDeviceLibNull.inf
   IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/SecFspSecPlatformLibNull.inf
   IntelFsp2Pkg/Library/BaseFspMultiPhaseLib/BaseFspMultiPhaseLib.inf
+  IntelFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.inf
 
   IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf
   IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
diff --git a/IntelFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.inf 
b/IntelFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.inf
new file mode 100644
index 00..318ad65330
--- /dev/null
+++ b/IntelFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.inf
@@ -0,0 +1,50 @@
+## @file
+#  FSP Helper Library.
+#
+#  Copyright (c) 2022, Intel Corporation. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+
+#
+# Defines Section - statements that will be processed to create a Makefile.
+#
+
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = FspHelperLib
+  FILE_GUID  = 65746991-8a41-4b89-b0f4-eb4e24b5b471
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = FspHelperLib
+
+#
+# The following information is for reference only and not required by the 
build tools.
+#
+#  VALID_ARCHITECTURES   = IA32 X64
+#
+
+
+#
+# Sources Section - list of files that are required for the build to succeed.
+#
+

Re: [edk2-devel][PATCH v1] IntelFsp2Pkg: Adding FspHelperLib

2022-11-07 Thread Ashraf Ali S
Hi.,

Instead of Hardcoded FSP ImageBase as 0x1C in FspHelper.nasm, can we have 
struct from there we can get it. So that in future if the Header is changing 
assembly code will not get impacted.

Regards,
Ashraf Ali S
Intel Technology India Pvt. Ltd. 

-Original Message-
From: Kuo, Ted  
Sent: Monday, November 7, 2022 2:14 PM
To: devel@edk2.groups.io
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Zeng, Star ; S, Ashraf 
Ali ; Duggapu, Chinni B ; 
Chan, Amy 
Subject: [edk2-devel][PATCH v1] IntelFsp2Pkg: Adding FspHelperLib

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4128
Adding FspHelperLib for platform code to consume. There will be another patch 
raised later for FspSecCore to consume FspHelperLib.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Star Zeng 
Cc: Ashraf Ali S 
Cc: Chinni B Duggapu 
Cc: Amy Chan 
Signed-off-by: Ted Kuo 
---
 IntelFsp2Pkg/FspSecCore/SecFsp.h  | 25 +-
 IntelFsp2Pkg/Include/Library/FspHelperLib.h   | 35 +
 IntelFsp2Pkg/IntelFsp2Pkg.dsc |  2 +
 .../BaseFspHelperLib/BaseFspHelperLib.inf | 50 +++
 .../BaseFspHelperLib/Ia32/FspHelper.nasm  | 35 +
 .../BaseFspHelperLib/X64/FspHelper.nasm   | 34 +
 6 files changed, 157 insertions(+), 24 deletions(-)  create mode 100644 
IntelFsp2Pkg/Include/Library/FspHelperLib.h
 create mode 100644 IntelFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.inf
 create mode 100644 IntelFsp2Pkg/Library/BaseFspHelperLib/Ia32/FspHelper.nasm
 create mode 100644 IntelFsp2Pkg/Library/BaseFspHelperLib/X64/FspHelper.nasm

diff --git a/IntelFsp2Pkg/FspSecCore/SecFsp.h b/IntelFsp2Pkg/FspSecCore/SecFsp.h
index d7a5976c12..f12769890f 100644
--- a/IntelFsp2Pkg/FspSecCore/SecFsp.h
+++ b/IntelFsp2Pkg/FspSecCore/SecFsp.h
@@ -17,6 +17,7 @@
 #include  #include  #include 
+#include   #define 
FSP_MCUD_SIGNATURE  SIGNATURE_32 ('M', 'C', 'U', 'D') #define 
FSP_PER0_SIGNATURE  SIGNATURE_32 ('P', 'E', 'R', '0')@@ -64,28 +65,4 @@ 
FspDataPointerFixUp (
   IN UINTN  OffsetGap   ); -/**-  This interface returns the base address of 
FSP binary.--  @return   FSP binary base 
address.--**/-UINTN-EFIAPI-AsmGetFspBaseAddress (-  VOID-  );--/**-  This 
interface gets FspInfoHeader pointer--  @return   FSP binary base 
address.--**/-UINTN-EFIAPI-AsmGetFspInfoHeader (-  VOID-  );- #endifdiff --git 
a/IntelFsp2Pkg/Include/Library/FspHelperLib.h 
b/IntelFsp2Pkg/Include/Library/FspHelperLib.h
new file mode 100644
index 00..84b74fa7aa
--- /dev/null
+++ b/IntelFsp2Pkg/Include/Library/FspHelperLib.h
@@ -0,0 +1,35 @@
+/** @file+  Header file for FSP Helper Library.++  Copyright (c) 2022, Intel 
Corporation. All rights reserved.+  SPDX-License-Identifier: 
BSD-2-Clause-Patent++**/++#ifndef _FSP_HELPER_LIB_H_+#define 
_FSP_HELPER_LIB_H_++/**+  This interface returns the base address of FSP 
binary.++  @return   FSP binary base 
address.++**/+UINTN+EFIAPI+AsmGetFspBaseAddress (+  VOID+  );++/**+  This 
interface gets FspInfoHeader pointer++  @return   FSP info 
header.+**/+UINTN+EFIAPI+AsmGetFspInfoHeader (+  VOID+  );++#endif // 
_FSP_HELPER_LIB_H_diff --git a/IntelFsp2Pkg/IntelFsp2Pkg.dsc 
b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
index 0713f0028d..09893d70e8 100644
--- a/IntelFsp2Pkg/IntelFsp2Pkg.dsc
+++ b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
@@ -46,6 +46,7 @@
   
FspSwitchStackLib|IntelFsp2Pkg/Library/BaseFspSwitchStackLib/BaseFspSwitchStackLib.inf
   
FspSecPlatformLib|IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/SecFspSecPlatformLibNull.inf
   
FspMultiPhaseLib|IntelFsp2Pkg/Library/BaseFspMultiPhaseLib/BaseFspMultiPhaseLib.inf+
  FspHelperLib|IntelFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.inf  
[LibraryClasses.common.PEIM]   
PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf@@ -66,6 +67,7 @@
   IntelFsp2Pkg/Library/BaseDebugDeviceLibNull/BaseDebugDeviceLibNull.inf   
IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/SecFspSecPlatformLibNull.inf   
IntelFsp2Pkg/Library/BaseFspMultiPhaseLib/BaseFspMultiPhaseLib.inf+  
IntelFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.inf
IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf   
IntelFsp2Pkg/FspSecCore/FspSecCoreM.infdiff --git 
a/IntelFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.inf 
b/IntelFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.inf
new file mode 100644
index 00..318ad65330
--- /dev/null
+++ b/IntelFsp2Pkg/Library/BaseFspHelperLib/BaseFspHelperLib.inf
@@ -0,0 +1,50 @@
+## @file+#  FSP Helper Library.+#+#  Copyright (c) 2022, Intel Corporation. 
All rights reserved.+#+#  SPDX-License-Identifier: 
BSD-2-Clause-Patent+#+##+++#+#
 Defines Section - statements that will be processed to create a 
Makefile.+#+++[Defines]+
  INF_VERSION= 0x00010005+  BASE_NAME  
= FspHelperLib+  FILE_GUID  = 
65746991-8a

Re: [edk2-devel] [PATCH v2] CryptoPkg/Readme.md: typo and grammar fixes

2022-11-07 Thread Laszlo Ersek
On 11/06/22 02:19, Yao, Jiewen wrote:
> Acked-by: Jiewen Yao 

Thanks for the ACKs; Jiewen, can you please merge the patch?

Thanks
Laszlo


> 
>> -Original Message-
>> From: Kinney, Michael D 
>> Sent: Friday, November 4, 2022 11:29 PM
>> To: Laszlo Ersek ; devel@edk2.groups.io; Kinney,
>> Michael D 
>> Cc: Zurcher, Christopher ; Jiang,
>> Guomin ; Wang, Jian J ;
>> Yao, Jiewen ; Lu, Xiaoyu1 
>> Subject: RE: [PATCH v2] CryptoPkg/Readme.md: typo and grammar fixes
>>
>> Reviewed-by: Michael D Kinney 
>>
>>
>>> -Original Message-
>>> From: Laszlo Ersek 
>>> Sent: Friday, November 4, 2022 5:02 AM
>>> To: devel@edk2.groups.io; ler...@redhat.com
>>> Cc: Zurcher, Christopher ; Jiang,
>> Guomin ; Wang, Jian J
>>> ; Yao, Jiewen ; Kinney,
>> Michael D ; Lu, Xiaoyu1
>>> 
>>> Subject: [PATCH v2] CryptoPkg/Readme.md: typo and grammar fixes
>>>
>>> Commit 244ce33bdd2f ("CryptoPkg: Add Readme.md", 2022-10-24) had
>> added the
>>> long-awaited documentation on the dynamic crypto services. Fix some of
>> the
>>> typos and arguable grammar errors in "Readme.md". A few light
>>> clarifications are also snuck in.
>>>
>>> Cc: Christopher Zurcher 
>>> Cc: Guomin Jiang 
>>> Cc: Jian J Wang 
>>> Cc: Jiewen Yao 
>>> Cc: Michael D Kinney 
>>> Cc: Xiaoyu Lu 
>>> Signed-off-by: Laszlo Ersek 
>>> ---
>>>
>>> Notes:
>>> v2:
>>>
>>> - URL:
>>>
>> https://pagure.io/lersek/edk2/c/8d7b26bfb6a1?branch=cryptopkg_readm
>> e_typos_v2
>>>
>>> - v1 was at:
>>>   - https://listman.redhat.com/archives/edk2-devel-archive/2022-
>> November/055153.html
>>>   - msgid <20221102093637.9132-1-ler...@redhat.com>
>>>
>>> - keep referring to the singular HashApiLib algorithm that
>>>   PcdHashApiLibPolicy exposes for configuration in singular [Mike]
>>>
>>> - still fix the duplicated "to" typo
>>>
>>> - range-diff against v1 (i.e., first hunk dropped, second hunk updated):
>>>
>>> > 1:  a7269f170437 ! 1:  8d7b26bfb6a1 CryptoPkg/Readme.md: typo
>> and grammar fixes
>>> > @@ -94,18 +94,11 @@
>>> >   ```
>>> >   [LibraryClasses.common.DXE_RUNTIME_DRIVER]
>>> >  @@
>>> > - ### PCD Configuration Settings
>>> > -
>>> > - There are 2 PCD settings that are used to configure 
>>> cryptographic
>> services.
>>> > --`PcdHashApiLibPolicy` is used to configure the hash algorithm
>> provided by the
>>> > -+`PcdHashApiLibPolicy` is used to configure the hash algorithms
>> provided by the
>>> > - BaseHashApiLib library instance. `PcdCryptoServiceFamilyEnable`
>> is used to
>>> > - configure the cryptographic services supported by the CryptoPei,
>> CryptoDxe,
>>> >   and CryptoSmm modules.
>>> >
>>> >   * `gEfiCryptoPkgTokenSpaceGuid.PcdHashApiLibPolicy` - This PCD
>> indicates the
>>> >  -  HASH algorithm to to use in the BaseHashApiLib to calculate
>> hash of data. The
>>> > -+  HASH algorithms to use in the BaseHashApiLib to calculate hash
>> of data. The
>>> > ++  HASH algorithm to use in the BaseHashApiLib to calculate hash
>> of data. The
>>> > default hashing algorithm for BaseHashApiLib is set to
>> HASH_ALG_SHA256.
>>> > |  Setting   |Algorithm |
>>> > ||--|
>>>
>>>  CryptoPkg/Readme.md | 46 ++--
>>>  1 file changed, 23 insertions(+), 23 deletions(-)
>>>
>>> diff --git a/CryptoPkg/Readme.md b/CryptoPkg/Readme.md
>>> index 946aa1e99e7d..067465b8eb7d 100644
>>> --- a/CryptoPkg/Readme.md
>>> +++ b/CryptoPkg/Readme.md
>>> @@ -39,7 +39,7 @@ provides the smallest overall firmware overhead.
>>>
>>>  ## Statically Linking Cryptographic Services
>>>
>>> -The figure below shows an example of a firmware modules that requires
>> the use of
>>> +The figure below shows an example of a firmware module that requires
>> the use of
>>>  cryptographic services. The cryptographic services are provided by three
>> library
>>>  classes called BaseCryptLib, TlsLib, and HashApiLib. These library classes
>> are
>>>  implemented using APIs from the OpenSSL project that are abstracted by
>> the
>>> @@ -49,7 +49,7 @@ full C runtime library for firmware components.
>> Instead, the CryptoPkg includes
>>>  the smallest subset of services required to build the OpenSSL project in
>> the
>>>  private library class called IntrinsicLib.
>>>
>>> -The CryptoPkg provides several instances if the BaseCryptLib and
>> OpensslLib with
>>> +The CryptoPkg provides several instances of the BaseCryptLib and
>> OpensslLib with
>>>  different cryptographic service features and performance optimizations.
>> The
>>>  platform developer must select the correct instances based on
>> cryptographic
>>>  service requirements in each UEFI/PI firmware phase (SEC, PEI, DXE, UEFI,
>>> @@ -97,9 +97,9 @@ linking is not available for SEC or UEFI RT modules.
>>>
>>>  The EDK II modules/libraries that require cryptographic services use the
>> same
>>>  Base

[edk2-devel] 1024 VCPU limitation

2022-11-07 Thread Paweł Poławski
Hi All,

I am trying to run edk2 with more than 1024 VCPU. It looks like it is not
possible
at the moment and results in an ASSERT trigger.

In the past the topic has been analyzed by Laszlo Ersek [1]. It turns out
that the limit
is result of HOB default allocation being limited to ~64KB, quoting
original email thread:

"""
If "NumberOfProcessors" is large enough, such as ~1024, then
"BistInformationSize" will exceed ~64KB, and PeiServicesAllocatePool()
will fail with EFI_OUT_OF_RESOURCES. The reason is that pool allocations
in PEI are implemented with memory alloaction HOBs, and HOBs can't be
larger than ~64KB. (See PeiAllocatePool() in
"MdeModulePkg/Core/Pei/Memory/MemoryServices.c".)
"""

Even with HOB allocation being changed, I am afraid it may break some
compatibility on the DXE level. This is the reason I am looking for a more
universal solution.
I believe the same limitation exists for the physical x86 platforms with
more than 1024 CPU.

If someone has encountered the same issue or has knowledge that workaround
/ solution for
this already exists or is being developed?

[1]
https://listman.redhat.com/archives/edk2-devel-archive/2021-June/msg01493

Best regards,
Pawel

-- 

Paweł Poławski

Red Hat  Virtualization

ppola...@redhat.com
@RedHat    Red Hat
  Red Hat




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




[edk2-devel] [PATCH v1 0/1] PrmPkg: Fix WHQL Signed Driver Test failure for PRMT device.

2022-11-07 Thread Xu, Wei6
This patch is to fix the WHQL Signed Driver Test failure when there is no 
driver installed for PRMT device.

The Bugzila link: https://bugzilla.tianocore.org/show_bug.cgi?id=4141
The forked branch for review: https://github.com/xuweiintel/edk2/tree/prm_cid

Cc: Michael Kubacki 
Cc: Nate DeSimone 
Cc: Ankit Sinha 

Wei6 Xu (1):
  PrmPkg/PrmSsdtInstallDxe: Update PRMT Device CID to PNP0C02.

 PrmPkg/PrmSsdtInstallDxe/Prm.asl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.29.2.windows.2



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




[edk2-devel] [PATCH v1 1/1] PrmPkg/PrmSsdtInstallDxe: Update PRMT Device CID to PNP0C02.

2022-11-07 Thread Xu, Wei6
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4141

PRMT device is an unknown device in Device Manager if there is no
Windows Driver installed for it. It will cause WHQL Signed Driver
test failure.
To complete WHQL certification, update PRMT Device CID to PNP0C02.
In this way, PRMT Device will be a Motherboard Resources when no
real driver is loaded (default), but will be shown as the actual
device name when a legitimate Windows Driver is loaded.

Cc: Michael Kubacki 
Cc: Nate DeSimone 
Cc: Ankit Sinha 
Signed-off-by: Wei6 Xu 
---
 PrmPkg/PrmSsdtInstallDxe/Prm.asl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PrmPkg/PrmSsdtInstallDxe/Prm.asl b/PrmPkg/PrmSsdtInstallDxe/Prm.asl
index e34336b4eee6..c4c406e93e2f 100644
--- a/PrmPkg/PrmSsdtInstallDxe/Prm.asl
+++ b/PrmPkg/PrmSsdtInstallDxe/Prm.asl
@@ -22,7 +22,7 @@ DefinitionBlock (
 Device (PRMT)
 {
 Name (_HID, "80860223")
-Name (_CID, "80860223")
+Name (_CID, EisaId ("PNP0C02"))
 Name (_DDN, "PRM Test Device")
 
 //PRM operation region format
-- 
2.29.2.windows.2



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




[edk2-devel] edk2-libc fopen() fails

2022-11-07 Thread Joaqu� Cono Bolillo via groups . io
Hi Rebecca,

to my knowledge, you are the maintainer of the AppPkg, that my team is currently
using to analyse a very sporadic reboot failure
(stuck, about 5 failures out of 100 reboots) on a x86-64 platform that
our company is going to ship soon.

Since the failure appears while Windows boots, it is safe to boot
to UEFI Shell first, analyse the register settings of the platform
using an UEFI Shell application, we are currently  implementing,
before  booting to Windows.

We are familiar with GIT and EDK2, but regrettably facing problems
using edk2-libc to refine the test program for our needs: fopen() always fails:

Our configuration:
* commit ba0e0e4c6a174b71b18ccd6e47319cc45878893c (HEAD, tag: edk2-stable202208)
* latest
  - AppPkg
  - StdLib
  - StdLibPrivateInternalFiles
* target.txt:
  - ACTIVE_PLATFORM  = AppPkg\AppPkg.dsc
  - TARGET= RELEASE
  - TARGET_ARCH  = X64
  - TOOL_CHAIN_CONF  = Conf/tools_def.txt
  - TOOL_CHAIN_TAG= VS2015x86

We are able to adjust, build and run AppPkg/Applications/Hello/Hello.c
on the target platform.

Regrettably fopen() always returns NULL.
ERRNO is always 0.

E.g.
FILE fp = fopen("test.txt", "w");
or open an existing file for reading:
FILE fp = fopen("test.txt", "r");

How can we do file access as specified by the Standard C Specification,
with edk2-libc?

Thanks in advance for your time and advice,
JC

PS: To doublecheck the problem on a Linux system, we ran the above
procedure on a WSL (Windows Subsystem for Linux) build environment with
the same result (TOOL_CHAIN_TAG set to GCC5).


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96030): https://edk2.groups.io/g/devel/message/96030
Mute This Topic: https://groups.io/mt/94866204/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 1/1] MdePkg/BaseLib: Fix out-of-bounds reads in SafeString

2022-11-07 Thread JC
Hi Pedro, this is just a test email

Thanks,
JC


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96032): https://edk2.groups.io/g/devel/message/96032
Mute This Topic: https://groups.io/mt/94861914/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 1/1] MdePkg/BaseLib: Fix out-of-bounds reads in SafeString

2022-11-07 Thread JC
test mail

On Mon, Nov 7, 2022 at 9:14 AM Pedro Falcato 
wrote:

> Thanks!
>
> On Mon, 7 Nov 2022, 01:32 gaoliming via groups.io,  byosoft.com...@groups.io> wrote:
>
>> Create https://github.com/tianocore/edk2/pull/3604 to merge this patch.
>>
>>
>>
>> Thanks
>>
>> Liming
>>
>> *发件人:* devel@edk2.groups.io  *代表 *Pedro Falcato
>> *发送时间:* 2022年11月5日 8:25
>> *收件人:* devel@edk2.groups.io; gaolim...@byosoft.com.cn
>> *抄送:* Vitaly Cheptsov ; Marvin Häuser <
>> mhaeu...@posteo.de>; Michael D Kinney ;
>> Zhiguang Liu ; Jiewen Yao 
>> *主题:* Re: [edk2-devel] 回复: [PATCH v3 1/1] MdePkg/BaseLib: Fix
>> out-of-bounds reads in SafeString
>>
>>
>>
>> Hi Liming,
>>
>>
>>
>> Thank you for the review. Can we please push this in time for the stable
>> tag?
>>
>>
>>
>> Thanks,
>>
>> Pedro
>>
>>
>>
>> On Fri, Nov 4, 2022 at 1:22 AM gaoliming via groups.io > byosoft.com...@groups.io> wrote:
>>
>> Reviewed-by: Liming Gao 
>>
>> > -邮件原件-
>> > 发件人: Pedro Falcato 
>> > 发送时间: 2022年11月3日 9:12
>> > 收件人: devel@edk2.groups.io
>> > 抄送: Pedro Falcato ; Vitaly Cheptsov
>> > ; Marvin Häuser ;
>> > Michael D Kinney ; Liming Gao
>> > ; Zhiguang Liu ;
>> Jiewen
>> > Yao 
>> > 主题: [PATCH v3 1/1] MdePkg/BaseLib: Fix out-of-bounds reads in
>> SafeString
>> >
>> > There was a OOB access in *StrHexTo* functions, when passed strings like
>> > "XDEADBEEF".
>> >
>> > OpenCore folks established an ASAN-equipped project to fuzz Ext4Dxe,
>> > which was able to catch these (mostly harmless) issues.
>> >
>> > Cc: Vitaly Cheptsov 
>> > Cc: Marvin Häuser 
>> > Cc: Michael D Kinney 
>> > Cc: Liming Gao 
>> > Cc: Zhiguang Liu 
>> > Signed-off-by: Pedro Falcato 
>> > Acked-by: Michael D Kinney 
>> > Reviewed-by: Jiewen Yao 
>> > ---
>> >  MdePkg/Library/BaseLib/SafeString.c | 25 +
>> >  1 file changed, 21 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/MdePkg/Library/BaseLib/SafeString.c
>> > b/MdePkg/Library/BaseLib/SafeString.c
>> > index f338a32a3a41..b75b33381732 100644
>> > --- a/MdePkg/Library/BaseLib/SafeString.c
>> > +++ b/MdePkg/Library/BaseLib/SafeString.c
>> > @@ -863,6 +863,9 @@ StrHexToUintnS (
>> >OUT   UINTN   *Data
>> >)
>> >  {
>> > +  BOOLEAN  FoundLeadingZero;
>> > +
>> > +  FoundLeadingZero = FALSE;
>> >ASSERT (((UINTN)String & BIT0) == 0);
>> >
>> >//
>> > @@ -892,12 +895,14 @@ StrHexToUintnS (
>> >//
>> >// Ignore leading Zeros after the spaces
>> >//
>> > +
>> > +  FoundLeadingZero = *String == L'0';
>> >while (*String == L'0') {
>> >  String++;
>> >}
>> >
>> >if (CharToUpper (*String) == L'X') {
>> > -if (*(String - 1) != L'0') {
>> > +if (!FoundLeadingZero) {
>> >*Data = 0;
>> >return RETURN_SUCCESS;
>> >  }
>> > @@ -992,6 +997,9 @@ StrHexToUint64S (
>> >OUT   UINT64  *Data
>> >)
>> >  {
>> > +  BOOLEAN  FoundLeadingZero;
>> > +
>> > +  FoundLeadingZero = FALSE;
>> >ASSERT (((UINTN)String & BIT0) == 0);
>> >
>> >//
>> > @@ -1021,12 +1029,13 @@ StrHexToUint64S (
>> >//
>> >// Ignore leading Zeros after the spaces
>> >//
>> > +  FoundLeadingZero = *String == L'0';
>> >while (*String == L'0') {
>> >  String++;
>> >}
>> >
>> >if (CharToUpper (*String) == L'X') {
>> > -if (*(String - 1) != L'0') {
>> > +if (!FoundLeadingZero) {
>> >*Data = 0;
>> >return RETURN_SUCCESS;
>> >  }
>> > @@ -2393,6 +2402,9 @@ AsciiStrHexToUintnS (
>> >OUT   UINTN  *Data
>> >)
>> >  {
>> > +  BOOLEAN  FoundLeadingZero;
>> > +
>> > +  FoundLeadingZero = FALSE;
>> >//
>> >// 1. Neither String nor Data shall be a null pointer.
>> >//
>> > @@ -2420,12 +2432,13 @@ AsciiStrHexToUintnS (
>> >//
>> >// Ignore leading Zeros after the spaces
>> >//
>> > +  FoundLeadingZero = *String == '0';
>> >while (*String == '0') {
>> >  String++;
>> >}
>> >
>> >if (AsciiCharToUpper (*String) == 'X') {
>> > -if (*(String - 1) != '0') {
>> > +if (!FoundLeadingZero) {
>> >*Data = 0;
>> >return RETURN_SUCCESS;
>> >  }
>> > @@ -2517,6 +2530,9 @@ AsciiStrHexToUint64S (
>> >OUT   UINT64  *Data
>> >)
>> >  {
>> > +  BOOLEAN  FoundLeadingZero;
>> > +
>> > +  FoundLeadingZero = FALSE;
>> >//
>> >// 1. Neither String nor Data shall be a null pointer.
>> >//
>> > @@ -2544,12 +2560,13 @@ AsciiStrHexToUint64S (
>> >//
>> >// Ignore leading Zeros after the spaces
>> >//
>> > +  FoundLeadingZero = *String == '0';
>> >while (*String == '0') {
>> >  String++;
>> >}
>> >
>> >if (AsciiCharToUpper (*String) == 'X') {
>> > -if (*(String - 1) != '0') {
>> > +if (!FoundLeadingZero) {
>> >*Data = 0;
>> >return RETURN_SUCCESS;
>> >  }
>> > --
>> > 2.38.1
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>>
>> Pedro Falcato
>>
>> 
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96031): https://edk2.groups.io/g/devel/message/960

Re: [edk2-devel] [PATCH v2] CryptoPkg/Readme.md: typo and grammar fixes

2022-11-07 Thread Yao, Jiewen
Merged https://github.com/tianocore/edk2/pull/3608

> -Original Message-
> From: Laszlo Ersek 
> Sent: Monday, November 7, 2022 6:09 PM
> To: Yao, Jiewen ; Kinney, Michael D
> ; devel@edk2.groups.io
> Cc: Zurcher, Christopher ; Jiang,
> Guomin ; Wang, Jian J ;
> Lu, Xiaoyu1 
> Subject: Re: [PATCH v2] CryptoPkg/Readme.md: typo and grammar fixes
> 
> On 11/06/22 02:19, Yao, Jiewen wrote:
> > Acked-by: Jiewen Yao 
> 
> Thanks for the ACKs; Jiewen, can you please merge the patch?
> 
> Thanks
> Laszlo
> 
> 
> >
> >> -Original Message-
> >> From: Kinney, Michael D 
> >> Sent: Friday, November 4, 2022 11:29 PM
> >> To: Laszlo Ersek ; devel@edk2.groups.io; Kinney,
> >> Michael D 
> >> Cc: Zurcher, Christopher ; Jiang,
> >> Guomin ; Wang, Jian J
> ;
> >> Yao, Jiewen ; Lu, Xiaoyu1
> 
> >> Subject: RE: [PATCH v2] CryptoPkg/Readme.md: typo and grammar fixes
> >>
> >> Reviewed-by: Michael D Kinney 
> >>
> >>
> >>> -Original Message-
> >>> From: Laszlo Ersek 
> >>> Sent: Friday, November 4, 2022 5:02 AM
> >>> To: devel@edk2.groups.io; ler...@redhat.com
> >>> Cc: Zurcher, Christopher ; Jiang,
> >> Guomin ; Wang, Jian J
> >>> ; Yao, Jiewen ; Kinney,
> >> Michael D ; Lu, Xiaoyu1
> >>> 
> >>> Subject: [PATCH v2] CryptoPkg/Readme.md: typo and grammar fixes
> >>>
> >>> Commit 244ce33bdd2f ("CryptoPkg: Add Readme.md", 2022-10-24)
> had
> >> added the
> >>> long-awaited documentation on the dynamic crypto services. Fix some
> of
> >> the
> >>> typos and arguable grammar errors in "Readme.md". A few light
> >>> clarifications are also snuck in.
> >>>
> >>> Cc: Christopher Zurcher 
> >>> Cc: Guomin Jiang 
> >>> Cc: Jian J Wang 
> >>> Cc: Jiewen Yao 
> >>> Cc: Michael D Kinney 
> >>> Cc: Xiaoyu Lu 
> >>> Signed-off-by: Laszlo Ersek 
> >>> ---
> >>>
> >>> Notes:
> >>> v2:
> >>>
> >>> - URL:
> >>>
> >>
> https://pagure.io/lersek/edk2/c/8d7b26bfb6a1?branch=cryptopkg_readm
> >> e_typos_v2
> >>>
> >>> - v1 was at:
> >>>   - https://listman.redhat.com/archives/edk2-devel-archive/2022-
> >> November/055153.html
> >>>   - msgid <20221102093637.9132-1-ler...@redhat.com>
> >>>
> >>> - keep referring to the singular HashApiLib algorithm that
> >>>   PcdHashApiLibPolicy exposes for configuration in singular [Mike]
> >>>
> >>> - still fix the duplicated "to" typo
> >>>
> >>> - range-diff against v1 (i.e., first hunk dropped, second hunk 
> >>> updated):
> >>>
> >>> > 1:  a7269f170437 ! 1:  8d7b26bfb6a1 CryptoPkg/Readme.md:
> typo
> >> and grammar fixes
> >>> > @@ -94,18 +94,11 @@
> >>> >   ```
> >>> >   [LibraryClasses.common.DXE_RUNTIME_DRIVER]
> >>> >  @@
> >>> > - ### PCD Configuration Settings
> >>> > -
> >>> > - There are 2 PCD settings that are used to configure
> cryptographic
> >> services.
> >>> > --`PcdHashApiLibPolicy` is used to configure the hash algorithm
> >> provided by the
> >>> > -+`PcdHashApiLibPolicy` is used to configure the hash algorithms
> >> provided by the
> >>> > - BaseHashApiLib library instance.
> `PcdCryptoServiceFamilyEnable`
> >> is used to
> >>> > - configure the cryptographic services supported by the
> CryptoPei,
> >> CryptoDxe,
> >>> >   and CryptoSmm modules.
> >>> >
> >>> >   * `gEfiCryptoPkgTokenSpaceGuid.PcdHashApiLibPolicy` - This
> PCD
> >> indicates the
> >>> >  -  HASH algorithm to to use in the BaseHashApiLib to calculate
> >> hash of data. The
> >>> > -+  HASH algorithms to use in the BaseHashApiLib to calculate
> hash
> >> of data. The
> >>> > ++  HASH algorithm to use in the BaseHashApiLib to calculate
> hash
> >> of data. The
> >>> > default hashing algorithm for BaseHashApiLib is set to
> >> HASH_ALG_SHA256.
> >>> > |  Setting   |Algorithm |
> >>> > ||--|
> >>>
> >>>  CryptoPkg/Readme.md | 46 ++--
> >>>  1 file changed, 23 insertions(+), 23 deletions(-)
> >>>
> >>> diff --git a/CryptoPkg/Readme.md b/CryptoPkg/Readme.md
> >>> index 946aa1e99e7d..067465b8eb7d 100644
> >>> --- a/CryptoPkg/Readme.md
> >>> +++ b/CryptoPkg/Readme.md
> >>> @@ -39,7 +39,7 @@ provides the smallest overall firmware overhead.
> >>>
> >>>  ## Statically Linking Cryptographic Services
> >>>
> >>> -The figure below shows an example of a firmware modules that
> requires
> >> the use of
> >>> +The figure below shows an example of a firmware module that
> requires
> >> the use of
> >>>  cryptographic services. The cryptographic services are provided by
> three
> >> library
> >>>  classes called BaseCryptLib, TlsLib, and HashApiLib. These library
> classes
> >> are
> >>>  implemented using APIs from the OpenSSL project that are abstracted
> by
> >> the
> >>> @@ -49,7 +49,7 @@ full C runtime library for firmware components.
> >> Instead, the CryptoPkg includes
> >>>  the smallest subset of services required to build the OpenSSL project in
> >> the
> >

Re: [edk2-devel] [edk2-CCodingStandardsSpecification] Create release/2.30 branch

2022-11-07 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Hi Mike,
You probably missed this email. I checked the below C coding standard spec 
related BZ and had some comments in line below.

> -Original Message-
> From: Chang, Abner
> Sent: Saturday, October 29, 2022 11:33 AM
> To: Kinney, Michael D ; devel@edk2.groups.io
> Subject: RE: [edk2-devel] [edk2-CCodingStandardsSpecification] Create
> release/2.30 branch
> 
> [AMD Official Use Only - General]
> 
> Hi Mike,
> Below are the tickets pulled out from BZ, is there any one you think is not
> necessary now?
> Abner
> 
> 713   EDK2Documentmichael.d.kin...@intel.com  CONF---
>   Update EDK II C Coding standard to state a stronger preference for 80
> column line widths2021-07-27
Seems no conclusion from the discussion in BZ.

> 1766  EDK2Documentmichael.d.kin...@intel.com  CONF---
>   Remove use of STATIC macros from EDK II C Coding Standard
> Specification 2020-12-09
No conclusion yet.

> 1698  EDK2Documentmichael.d.kin...@intel.com  CONF---
>   Spurious rule about comment style in CCS 6.2.3  2021-07-27
Had we addressed this issue on the coding standard spec yet? If not, we can fix 
this in the version 2.3.

> 714   EDK2Documentmichael.d.kin...@intel.com  CONF---
>   Update EDK II C Coding Standards to allow multiple arguments per
> line in a function call   2021-07-27
Have these patches been reviewed?
[edk2] [edk2-CCodingStandardsSpecification PATCH 0/2] improvements related to 
line wrapping
[edk2] [edk2-CCodingStandardsSpecification PATCH 1/2] Source Files / General 
Rules: limit line lengths to 80 columns
[edk2] [edk2-CCodingStandardsSpecification PATCH 2/2] Source Files / Spacing / 
Multi-line func. calls: allow condensed arguments

http://mid.mail-archive.com/20170811164851.9466-1-lersek@redhat.com
http://mid.mail-archive.com/20170811164851.9466-2-lersek@redhat.com
http://mid.mail-archive.com/20170811164851.9466-3-lersek@redhat.com 

> 2664  EDK2Documentmichael.d.kin...@intel.com  CONF---
>   Discrepancies/inconsistencies in coding standards, style and
> examples  2021-10-02
I think we can fix the above inconsistent issues in the version 2.3 release.

Thanks
Abner

> 
> > -Original Message-
> > From: Kinney, Michael D 
> > Sent: Friday, October 28, 2022 11:22 PM
> > To: devel@edk2.groups.io; Chang, Abner ;
> Kinney,
> > Michael D 
> > Subject: RE: [edk2-devel] [edk2-CCodingStandardsSpecification] Create
> > release/2.30 branch
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Hi Abner,
> >
> > Have you reviewed the open BZs against the EDK II C Coding Standard.
> >
> > Are there any other issues that are considered important to fix before
> > making a new official release?
> >
> > Thanks,
> >
> > Mike
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of
> > > Chang, Abner via groups.io
> > > Sent: Thursday, October 27, 2022 9:54 AM
> > > To: devel@edk2.groups.io
> > > Cc: Abner Chang 
> > > Subject: [edk2-devel] [edk2-CCodingStandardsSpecification] Create
> > > release/2.30 branch
> > >
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Abner Chang 
> > > ---
> > >  book.json | 3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/book.json b/book.json
> > > index d112b26..1fdd570 100644
> > > --- a/book.json
> > > +++ b/book.json
> > > @@ -1,8 +1,7 @@
> > >  {
> > >
> > >"variables" : {
> > >
> > > -"draft"   : "yes",
> > >
> > >  "title"   : "EDK II C Coding Standards Specification",
> > >
> > > -"version" : "Revision 2.2"
> > >
> > > +"version" : "Revision 2.3"
> > >
> > >},
> > >
> > >"plugins": ["puml-aleung"],
> > >
> > >"pluginsConfig": {}
> > >
> > > --
> > > 2.37.1.windows.1
> > >
> > >
> > >
> > > 
> > >


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




[edk2-devel] [PATCH] DynamicTablesPkg: Allow for specified CPU names

2022-11-07 Thread Jeff Brasen via groups.io
Allow object to specify the name of processor and processor container

nodes and the UID of processor containers.



This allows these to be more accurately referenced from other tables.

For example for the _PSL method or the UID in the APMT table.



The UID and Name for processor container may be different as if the

intention is to set names as the corresponding affinity level the UID

may need to be different if there are multiple levels of containers.



Signed-off-by: Jeff Brasen 

---

 .../Include/ArmNameSpaceObjects.h | 11 +

 .../SsdtCpuTopologyGenerator.c| 40 ++-

 .../ConfigurationManagerObjectParser.c|  3 ++

 3 files changed, 43 insertions(+), 11 deletions(-)



diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h

index 6aafd41a2e..19098609de 100644

--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h

+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h

@@ -768,6 +768,17 @@ typedef struct CmArmProcHierarchyInfo {

   /// Token identifying a CM_ARM_OBJ_REF structure, itself referencing

   /// CM_ARM_LPI_INFO objects.

   CM_OBJECT_TOKENLpiToken;

+  /// Set to TRUE if UID should override index for name and _UID

+  /// for processor container nodes and name of processors.

+  /// This should be consistently set for containers or processors to avoid

+  /// duplicate values

+  BOOLEANOverrideNameUidEnabled;

+  /// If OverrideNameUidEnabled is TRUE then this value will be used for name 
of

+  /// processors and processor containers.

+  UINT16 OverrideName;

+  /// If OverrideNameUidEnabled is TRUE then this value will be used for

+  /// the UID of processor containers.

+  UINT32 OverrideUid;

 } CM_ARM_PROC_HIERARCHY_INFO;

 

 /** A structure that describes the Cache Type Structure (Type 1) in PPTT

diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c

index d06c7615fb..92fa904103 100644

--- 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c

+++ 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c

@@ -553,7 +553,7 @@ GenerateLpiStates (

   @param [in]  GeneratorThe SSDT Cpu Topology generator.

   @param [in]  ParentNode   Parent node to attach the Cpu node to.

   @param [in]  GicCInfo CM_ARM_GICC_INFO object used to create the node.

-  @param [in]  CpuIndex Index used to generate the node name.

+  @param [in]  CpuName  Value used to generate the node name.

   @param [out] CpuNodePtr   If not NULL, return the created Cpu node.

 

   @retval EFI_SUCCESS Success.

@@ -567,7 +567,7 @@ CreateAmlCpu (

   IN   ACPI_CPU_TOPOLOGY_GENERATOR  *Generator,

   IN   AML_NODE_HANDLE  ParentNode,

   IN   CM_ARM_GICC_INFO *GicCInfo,

-  IN   UINT32   CpuIndex,

+  IN   UINT32   CpuName,

   OUT  AML_OBJECT_NODE_HANDLE   *CpuNodePtr OPTIONAL

   )

 {

@@ -579,7 +579,7 @@ CreateAmlCpu (

   ASSERT (ParentNode != NULL);

   ASSERT (GicCInfo != NULL);

 

-  Status = WriteAslName ('C', CpuIndex, AslName);

+  Status = WriteAslName ('C', CpuName, AslName);

   if (EFI_ERROR (Status)) {

 ASSERT (0);

 return Status;

@@ -628,7 +628,7 @@ CreateAmlCpu (

   @param [in]  CfgMgrProtocol Pointer to the Configuration Manager

   Protocol Interface.

   @param [in]  ParentNode Parent node to attach the Cpu node to.

-  @param [in]  CpuIndex   Index used to generate the node name.

+  @param [in]  CpuNameValue used to generate the node name.

   @param [in]  ProcHierarchyNodeInfo  CM_ARM_PROC_HIERARCHY_INFO describing

   the Cpu.

 

@@ -643,7 +643,7 @@ CreateAmlCpuFromProcHierarchy (

   INACPI_CPU_TOPOLOGY_GENERATOR   *Generator,

   IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,

   INAML_NODE_HANDLE   ParentNode,

-  INUINT32CpuIndex,

+  INUINT32CpuName,

   INCM_ARM_PROC_HIERARCHY_INFO
*ProcHierarchyNodeInfo

   )

 {

@@ -668,7 +668,7 @@ CreateAmlCpuFromProcHierarchy (

 return Status;

   }

 

-  Status = CreateAmlCpu (Generator, ParentNode, GicCInfo, CpuIndex, &CpuNode);

+  Status = CreateAmlCpu (Generator, ParentNode, GicCInfo, CpuName, &CpuNode);

   if (EFI_ERROR (Status)) {

 ASSERT (0);

 return Status;

@@ -735,7 +735,8 @@ CreateAmlProcessorContainer (

   IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,

   INAML_NODE_HANDLE 

Re: [edk2-devel] [PATCH] DynamicTablesPkg: Allow for specified CPU names

2022-11-07 Thread Jeff Brasen via groups.io
This was the simplest approach that I had to solve this issue, but not sure if 
it would be better to do something smarter. A couple other ideas I had where:
- Specify the affinity level that CPUs use and use the levels above that for 
the containers.
- Have a new object that has the container levels and affinity mapping. This 
wouldn't support unbalanced layouts.
- I can't think of a good way to auto detect the cpu level affinity level but 
that would be nice. 

-Jeff


> -Original Message-
> From: Jeff Brasen 
> Sent: Monday, November 7, 2022 8:57 AM
> To: devel@edk2.groups.io
> Cc: sami.muja...@arm.com; alexei.fedo...@arm.com;
> pierre.gond...@arm.com; quic_llind...@quicinc.com;
> ardb+tianoc...@kernel.org; Jeff Brasen 
> Subject: [PATCH] DynamicTablesPkg: Allow for specified CPU names
> 
> Allow object to specify the name of processor and processor container
> 
> nodes and the UID of processor containers.
> 
> 
> 
> This allows these to be more accurately referenced from other tables.
> 
> For example for the _PSL method or the UID in the APMT table.
> 
> 
> 
> The UID and Name for processor container may be different as if the
> 
> intention is to set names as the corresponding affinity level the UID
> 
> may need to be different if there are multiple levels of containers.
> 
> 
> 
> Signed-off-by: Jeff Brasen 
> 
> ---
> 
>  .../Include/ArmNameSpaceObjects.h | 11 +
> 
>  .../SsdtCpuTopologyGenerator.c| 40 ++-
> 
>  .../ConfigurationManagerObjectParser.c|  3 ++
> 
>  3 files changed, 43 insertions(+), 11 deletions(-)
> 
> 
> 
> diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> 
> index 6aafd41a2e..19098609de 100644
> 
> --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> 
> +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> 
> @@ -768,6 +768,17 @@ typedef struct CmArmProcHierarchyInfo {
> 
>/// Token identifying a CM_ARM_OBJ_REF structure, itself referencing
> 
>/// CM_ARM_LPI_INFO objects.
> 
>CM_OBJECT_TOKENLpiToken;
> 
> +  /// Set to TRUE if UID should override index for name and _UID
> 
> +  /// for processor container nodes and name of processors.
> 
> +  /// This should be consistently set for containers or processors to avoid
> 
> +  /// duplicate values
> 
> +  BOOLEANOverrideNameUidEnabled;
> 
> +  /// If OverrideNameUidEnabled is TRUE then this value will be used for
> name of
> 
> +  /// processors and processor containers.
> 
> +  UINT16 OverrideName;
> 
> +  /// If OverrideNameUidEnabled is TRUE then this value will be used for
> 
> +  /// the UID of processor containers.
> 
> +  UINT32 OverrideUid;
> 
>  } CM_ARM_PROC_HIERARCHY_INFO;
> 
> 
> 
>  /** A structure that describes the Cache Type Structure (Type 1) in PPTT
> 
> diff --git
> a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCp
> uTopologyGenerator.c
> b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCp
> uTopologyGenerator.c
> 
> index d06c7615fb..92fa904103 100644
> 
> ---
> a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCp
> uTopologyGenerator.c
> 
> +++
> b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCp
> uTopologyGenerator.c
> 
> @@ -553,7 +553,7 @@ GenerateLpiStates (
> 
>@param [in]  GeneratorThe SSDT Cpu Topology generator.
> 
>@param [in]  ParentNode   Parent node to attach the Cpu node to.
> 
>@param [in]  GicCInfo CM_ARM_GICC_INFO object used to create the
> node.
> 
> -  @param [in]  CpuIndex Index used to generate the node name.
> 
> +  @param [in]  CpuName  Value used to generate the node name.
> 
>@param [out] CpuNodePtr   If not NULL, return the created Cpu node.
> 
> 
> 
>@retval EFI_SUCCESS Success.
> 
> @@ -567,7 +567,7 @@ CreateAmlCpu (
> 
>IN   ACPI_CPU_TOPOLOGY_GENERATOR  *Generator,
> 
>IN   AML_NODE_HANDLE  ParentNode,
> 
>IN   CM_ARM_GICC_INFO *GicCInfo,
> 
> -  IN   UINT32   CpuIndex,
> 
> +  IN   UINT32   CpuName,
> 
>OUT  AML_OBJECT_NODE_HANDLE   *CpuNodePtr OPTIONAL
> 
>)
> 
>  {
> 
> @@ -579,7 +579,7 @@ CreateAmlCpu (
> 
>ASSERT (ParentNode != NULL);
> 
>ASSERT (GicCInfo != NULL);
> 
> 
> 
> -  Status = WriteAslName ('C', CpuIndex, AslName);
> 
> +  Status = WriteAslName ('C', CpuName, AslName);
> 
>if (EFI_ERROR (Status)) {
> 
>  ASSERT (0);
> 
>  return Status;
> 
> @@ -628,7 +628,7 @@ CreateAmlCpu (
> 
>@param [in]  CfgMgrProtocol Pointer to the Configuration Manager
> 
>Protocol Interface.
> 
>@param [in]  ParentNode Parent node to attach the Cpu node to.
> 
> -  @param [in]  CpuIndex   Index used to generate the node name.
> 
> +  @param [in]  CpuNameValue used to generate the node name.
> 
> 

Re: [edk2-devel] [edk2-CCodingStandardsSpecification] Create release/2.30 branch

2022-11-07 Thread Michael D Kinney
Hi Abner,

Thanks for the review.  I agree we should try to get a few more of these 
resolved for Version 2.3.

+Michael Kubacki for Uncrustify configuration settings discussion on the column 
width
and args per line in function call topics. We need to know what the current 
Uncrustify
configuration settings for these 2 topics. It would be better of the spec and 
the 
Uncrustify settings were aligned and for any changes going forward they are 
made to the 
spec and Uncrustify settings at the same time.

Details of these 2 topics are as follows:

* TianoCore BZ links:
https://bugzilla.tianocore.org/show_bug.cgi?id=713 - Update EDK II C Coding 
standard to state a stronger preference for 80 column line widths
https://bugzilla.tianocore.org/show_bug.cgi?id=714 - Update EDK II C Coding 
Standards to allow multiple arguments per line in a function call

* The patch emails and discussions are in groups.io:
https://edk2.groups.io/g/devel/message/13204
https://edk2.groups.io/g/devel/message/13205
Leif provide a Reviewed-by: https://edk2.groups.io/g/devel/message/13228
https://edk2.groups.io/g/devel/message/13206
There is a good discussion of this change with no Rb.

* The links to the formatted versions of the reviews are no longer working,
  but they can be view on GitHub in the branch Laszlo provided and select the
  "Display the rich diff" view of the markdown changes:

https://github.com/lersek/edk2-CCodingStandardsSpecification/commit/2c5534a24b15616fdaa02478858ed1d8908dc653

https://github.com/lersek/edk2-CCodingStandardsSpecification/commit/e3797dc48316052005cefa26246ab2fd32641881

Best regards,

Mike

> -Original Message-
> From: Chang, Abner 
> Sent: Monday, November 7, 2022 6:18 AM
> To: Kinney, Michael D ; devel@edk2.groups.io
> Cc: Wee, Sing ; Rebecca Cran ; 
> ler...@redhat.com; heyi@linaro.org
> Subject: RE: [edk2-devel] [edk2-CCodingStandardsSpecification] Create 
> release/2.30 branch
> 
> [AMD Official Use Only - General]
> 
> Hi Mike,
> You probably missed this email. I checked the below C coding standard spec 
> related BZ and had some comments in line below.
> 
> > -Original Message-
> > From: Chang, Abner
> > Sent: Saturday, October 29, 2022 11:33 AM
> > To: Kinney, Michael D ; devel@edk2.groups.io
> > Subject: RE: [edk2-devel] [edk2-CCodingStandardsSpecification] Create
> > release/2.30 branch
> >
> > [AMD Official Use Only - General]
> >
> > Hi Mike,
> > Below are the tickets pulled out from BZ, is there any one you think is not
> > necessary now?
> > Abner
> >
> > 713 EDK2Documentmichael.d.kin...@intel.com  CONF---
> > Update EDK II C Coding standard to state a stronger preference for 80
> > column line widths  2021-07-27
> Seems no conclusion from the discussion in BZ.
> 
> > 1766EDK2Documentmichael.d.kin...@intel.com  CONF
> > ---
> > Remove use of STATIC macros from EDK II C Coding Standard
> > Specification   2020-12-09
> No conclusion yet.
> 
> > 1698EDK2Documentmichael.d.kin...@intel.com  CONF
> > ---
> > Spurious rule about comment style in CCS 6.2.3  2021-07-27
> Had we addressed this issue on the coding standard spec yet? If not, we can 
> fix this in the version 2.3.
> 
> > 714 EDK2Documentmichael.d.kin...@intel.com  CONF---
> > Update EDK II C Coding Standards to allow multiple arguments per
> > line in a function call 2021-07-27
> Have these patches been reviewed?
> [edk2] [edk2-CCodingStandardsSpecification PATCH 0/2] improvements related to 
> line wrapping
> [edk2] [edk2-CCodingStandardsSpecification PATCH 1/2] Source Files / General 
> Rules: limit line lengths to 80 columns
> [edk2] [edk2-CCodingStandardsSpecification PATCH 2/2] Source Files / Spacing 
> / Multi-line func. calls: allow condensed arguments
> 
> http://mid.mail-archive.com/20170811164851.9466-1-lersek@redhat.com
> http://mid.mail-archive.com/20170811164851.9466-2-lersek@redhat.com
> http://mid.mail-archive.com/20170811164851.9466-3-lersek@redhat.com
> 
> > 2664EDK2Documentmichael.d.kin...@intel.com  CONF
> > ---
> > Discrepancies/inconsistencies in coding standards, style and
> > examples  2021-10-02
> I think we can fix the above inconsistent issues in the version 2.3 release.
> 
> Thanks
> Abner
> 
> >
> > > -Original Message-
> > > From: Kinney, Michael D 
> > > Sent: Friday, October 28, 2022 11:22 PM
> > > To: devel@edk2.groups.io; Chang, Abner ;
> > Kinney,
> > > Michael D 
> > > Subject: RE: [edk2-devel] [edk2-CCodingStandardsSpecification] Create
> > > release/2.30 branch
> > >
> > > Caution: This message originated from an External Source. Use proper
> > > caution when opening attachments, clicking links, or responding.
> > >
> > >
> > > Hi Abner,
> > >
> > > Have you reviewed the open BZs against the EDK II C Coding Standard.
> > >
> > > Are there any other issues that

Re: [edk2-devel] 1024 VCPU limitation

2022-11-07 Thread Michael D Kinney
Hi Pawel,

I see the following union involved in the size of this structure.

typedef union {
  IA32_HANDOFF_STATUS   IA32HealthFlags;
  X64_HANDOFF_STATUSx64HealthFlags;
  ITANIUM_HANDOFF_STATUSItaniumHealthFlags;
} EFI_SEC_PLATFORM_INFORMATION_RECORD;

IA32 is 4 bytes per CPU
X64 is 4 bytes per CPU
Itanium is 56 bytes per CPU

We have removed the Itanium content from edk2 repo and it look like we missed 
this
union.

If you comment out the following line from the union does it resolve the issue?

https://github.com/tianocore/edk2/blob/7c0ad2c33810ead45b7919f8f8d0e282dae52e71/MdePkg/Include/Ppi/SecPlatformInformation.h#L137

I know this only increases the total number of CPUs that can be handled by a 
single 64kb HOB, so we would run into
it again at a higher number of CPUs.  However, I think this gets the overhead 
per CPU down to 8 bytes, which should
scale to about 8091 CPUs.

Thanks,

Mike


From: Pawel Polawski 
Sent: Monday, November 7, 2022 3:52 AM
To: devel@edk2.groups.io
Cc: Dong, Eric ; Laszlo Ersek ; Ni, Ray 
; Kumar, Rahul R ; Kinney, Michael D 

Subject: [edk2-devel] 1024 VCPU limitation

Hi All,

I am trying to run edk2 with more than 1024 VCPU. It looks like it is not 
possible
at the moment and results in an ASSERT trigger.

In the past the topic has been analyzed by Laszlo Ersek [1]. It turns out that 
the limit
is result of HOB default allocation being limited to ~64KB, quoting original 
email thread:

"""
If "NumberOfProcessors" is large enough, such as ~1024, then
"BistInformationSize" will exceed ~64KB, and PeiServicesAllocatePool()
will fail with EFI_OUT_OF_RESOURCES. The reason is that pool allocations
in PEI are implemented with memory alloaction HOBs, and HOBs can't be
larger than ~64KB. (See PeiAllocatePool() in
"MdeModulePkg/Core/Pei/Memory/MemoryServices.c".)
"""

Even with HOB allocation being changed, I am afraid it may break some
compatibility on the DXE level. This is the reason I am looking for a more 
universal solution.
I believe the same limitation exists for the physical x86 platforms with more 
than 1024 CPU.

If someone has encountered the same issue or has knowledge that workaround / 
solution for
this already exists or is being developed?

[1] https://listman.redhat.com/archives/edk2-devel-archive/2021-June/msg01493

Best regards,
Pawel

--

Paweł Poławski

Red Hat Virtualization

ppola...@redhat.com
@RedHat   Red 
Hat  Red 
Hat
[https://static.redhat.com/libs/redhat/brand-assets/latest/corp/logo.png]


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




[edk2-devel] [PATCH v2 0/2] CryptoPkg bug fixes

2022-11-07 Thread Judah Vang
https://bugzilla.tianocore.org/show_bug.cgi?id=3991
https://bugzilla.tianocore.org/show_bug.cgi?id=3992

There is a #define to deprecate Sha1 functions but not
all the Sha1 function are wrapped around this #define causing
a build error. The fix is to wrap all Sha1 functions with
the #define.

Need crypto AES to be supported for PEI phase and need
crypto KDF to be supported for SMM phase. Update Readme
to show AES and HKDF defaults.

Judah Vang (2):
  CryptoPkg: Sha1 functions causing build errors
  CryptoPkg: Need to enable crypto functions

 CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf|  2 +-
 CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf|  2 +-
 CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 14 ++-
 CryptoPkg/Readme.md   | 26 +++-
 4 files changed, 29 insertions(+), 15 deletions(-)

-- 
2.35.1.windows.2



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




[edk2-devel] [PATCH v2 1/2] CryptoPkg: Sha1 functions causing build errors

2022-11-07 Thread Judah Vang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3991

Fix build issue when DiSABLE_SHA1_DEPRECATED_INTERFACES
is defined. Percolate the #ifndef DiSABLE_SHA1_DEPRECATED_INTERFACES
to all the Sha1 functions.

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Xiaoyu Lu 
Cc: Guomin Jiang 
Cc: Nishant C Mistry 
Signed-off-by: Jian J Wang 
Signed-off-by: Nishant C Mistry 
Signed-off-by: Judah Vang 
---
 CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c 
b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
index f9796b215865..ede9fa8c09ec 100644
--- a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
+++ b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
@@ -6,7 +6,7 @@
   This API, when called, will calculate the Hash using the
   hashing algorithm specified by PcdHashApiLibPolicy.
 
-  Copyright (c) 2020, Intel Corporation. All rights reserved.
+  Copyright (c) 2020-2022, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -33,9 +33,11 @@ HashApiGetContextSize (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1GetContextSize ();
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256GetContextSize ();
@@ -75,9 +77,11 @@ HashApiInit (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1Init (HashContext);
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256Init (HashContext);
@@ -119,9 +123,11 @@ HashApiDuplicate (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1Duplicate (HashContext, NewHashContext);
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256Duplicate (HashContext, NewHashContext);
@@ -165,9 +171,11 @@ HashApiUpdate (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1Update (HashContext, DataToHash, DataToHashLen);
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256Update (HashContext, DataToHash, DataToHashLen);
@@ -209,9 +217,11 @@ HashApiFinal (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1Final (HashContext, Digest);
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256Final (HashContext, Digest);
@@ -255,9 +265,11 @@ HashApiHashAll (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1HashAll (DataToHash, DataToHashLen, Digest);
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256HashAll (DataToHash, DataToHashLen, Digest);
-- 
2.35.1.windows.2



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




[edk2-devel] [PATCH v2 2/2] CryptoPkg: Need to enable crypto functions

2022-11-07 Thread Judah Vang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3992

V2: Update Readme.md

V1: Enable CryptAes for PEI phase. Enable CryptHkdf for SMM phase.

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Xiaoyu Lu 
Cc: Guomin Jiang 
Cc: Nishant C Mistry 
Signed-off-by: Jian J Wang 
Signed-off-by: Nishant C Mistry 
Signed-off-by: Judah Vang 
---
 CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf |  2 +-
 CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf |  2 +-
 CryptoPkg/Readme.md| 26 +++-
 3 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
index b1629647f9c6..ee5f3cd5d4b6 100644
--- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
@@ -43,7 +43,7 @@ [Sources]
   Hash/CryptParallelHashNull.c
   Hmac/CryptHmac.c
   Kdf/CryptHkdf.c
-  Cipher/CryptAesNull.c
+  Cipher/CryptAes.c
   Cipher/CryptAeadAesGcmNull.c
   Pk/CryptRsaBasic.c
   Pk/CryptRsaExtNull.c
diff --git a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
index 0af7a3f96e8f..cc5a53ca92cd 100644
--- a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
@@ -43,7 +43,7 @@ [Sources]
   Hash/CryptCShake256.c
   Hash/CryptParallelHash.c
   Hmac/CryptHmac.c
-  Kdf/CryptHkdfNull.c
+  Kdf/CryptHkdf.c
   Cipher/CryptAes.c
   Cipher/CryptAeadAesGcmNull.c
   Pk/CryptRsaBasic.c
diff --git a/CryptoPkg/Readme.md b/CryptoPkg/Readme.md
index 067465b8eb7d..fe8fc5e03684 100644
--- a/CryptoPkg/Readme.md
+++ b/CryptoPkg/Readme.md
@@ -447,18 +447,20 @@ and CryptoSmm modules.
  Common PEI PcdCryptoServiceFamilyEnable Settings
 
 ```
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family   
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha384.Family   
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family 
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family   
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Family   
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Family   
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Family  
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-  
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Pkcs1Verify
| TRUE
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.New
| TRUE
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Free   
| TRUE
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.SetKey 
| TRUE
-  
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs5HashPassword
 | TRUE
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha384.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family 
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Family  
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Family  
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Pkcs1Verify
 | TRUE
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.New
 | TRUE
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Free   
 | TRUE
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.SetKey 
 | TRUE
+  
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs5HashPassword
  | TRUE
+  
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Hkdf.Services.Sha256ExtractAndExpand
 | TRUE
 ```
 
  Common DXE and SMM PcdCryptoServiceFamilyEnable Settings
-- 
2.35.1.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Li

Re: [edk2-devel] [PATCH v2 0/2] CryptoPkg bug fixes

2022-11-07 Thread Yao, Jiewen
Hey
Would you please split this patch set to two different one? They are two 
different HSDs.

Please aware that we are in software freeze phase now.

I suggest we include 3991 in this release, because it is an important bug fix.

I suggest we defer 3992 to next release, because it is feature enhancement.

Comment is welcome!

Thank you
Yao, Jiewen


> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Judah
> Vang
> Sent: Tuesday, November 8, 2022 2:37 AM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [PATCH v2 0/2] CryptoPkg bug fixes
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=3991
> https://bugzilla.tianocore.org/show_bug.cgi?id=3992
> 
> There is a #define to deprecate Sha1 functions but not
> all the Sha1 function are wrapped around this #define causing
> a build error. The fix is to wrap all Sha1 functions with
> the #define.
> 
> Need crypto AES to be supported for PEI phase and need
> crypto KDF to be supported for SMM phase. Update Readme
> to show AES and HKDF defaults.
> 
> Judah Vang (2):
>   CryptoPkg: Sha1 functions causing build errors
>   CryptoPkg: Need to enable crypto functions
> 
>  CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf|  2 +-
>  CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf|  2 +-
>  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 14 ++-
>  CryptoPkg/Readme.md   | 26 +++-
>  4 files changed, 29 insertions(+), 15 deletions(-)
> 
> --
> 2.35.1.windows.2
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [PATCH V1 0/2] CryptoPkg bug fixes

2022-11-07 Thread Judah Vang
Hi all,

I resubmitted the patches with an update to the CryptoPkg/Readme.
The CryptoPkg.dsc has already been updated with the AES and KDF feature changes.

Thanks!

Judah

-Original Message-
From: Kinney, Michael D  
Sent: Monday, October 24, 2022 10:22 AM
To: devel@edk2.groups.io; Vang, Judah ; Kinney, Michael D 

Subject: RE: [edk2-devel] [PATCH V1 0/2] CryptoPkg bug fixes

Hi Judah,

There was an update to CryptoPkg pushed yesterday.

1) There is a CryptoPkg/Readme.md with tables and DSC content for services that 
are
   enabled in each phase.  I think that needs updates too for the AES and KDF 
features.
2) The CryptoPkg.dsc file has recommended settings for PEI, DXE, SMM.  I think
   they need to be updated for the AES and KDF features.
3) It looks like the SHA1 disable caused a build break.  I would like to see the
   standard package builds for EDK II CI be updated to cover the failure case so
   we know that this case is covered in the future.  It looks like the default 
is
   for SHA1 enabled and the build break is when define for SHA1 disabled is 
   asserted.
4) There is an overlap between the defines to deprecate MD5 and SH1 and the
   structured PCD that allows those services to be disabled in the Crypto 
   Protocol/PPI.  The defines to deprecate MD5 and SH1 extend into the 
BaseCryptLib
   instance implementations such that a call to those services when static 
linking
   will generate a build error instead of a runtime ASSERT().  Which behavior do
   you prefer?

Best regards,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Judah 
> Vang
> Sent: Monday, October 24, 2022 9:42 AM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [PATCH V1 0/2] CryptoPkg bug fixes
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=3991
> https://bugzilla.tianocore.org/show_bug.cgi?id=3992
> 
> There is a #define to deprecate Sha1 functions but not all the Sha1 
> function are wrapped around this #define causing a build error. The 
> fix is to wrap all Sha1 functions with the #define.
> 
> Need crypto AES to be supported for PEI phase and need crypto KDF to 
> be supported for SMM phase.
> 
> Judah Vang (2):
>   CryptoPkg: Sha1 functions causing build errors
>   CryptoPkg: Need to enable crypto functions
> 
>  CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf|  2 +-
>  CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf|  2 +-
>  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 14 +-
>  3 files changed, 15 insertions(+), 3 deletions(-)
> 
> --
> 2.35.1.windows.2
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [PATCH v2 0/2] CryptoPkg bug fixes

2022-11-07 Thread Judah Vang
Sure, I can do that.  I will resubmit as separate patches.

-Original Message-
From: Yao, Jiewen  
Sent: Monday, November 7, 2022 10:42 AM
To: devel@edk2.groups.io; Vang, Judah 
Subject: RE: [edk2-devel] [PATCH v2 0/2] CryptoPkg bug fixes

Hey
Would you please split this patch set to two different one? They are two 
different HSDs.

Please aware that we are in software freeze phase now.

I suggest we include 3991 in this release, because it is an important bug fix.

I suggest we defer 3992 to next release, because it is feature enhancement.

Comment is welcome!

Thank you
Yao, Jiewen


> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Judah 
> Vang
> Sent: Tuesday, November 8, 2022 2:37 AM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [PATCH v2 0/2] CryptoPkg bug fixes
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=3991
> https://bugzilla.tianocore.org/show_bug.cgi?id=3992
> 
> There is a #define to deprecate Sha1 functions but not all the Sha1 
> function are wrapped around this #define causing a build error. The 
> fix is to wrap all Sha1 functions with the #define.
> 
> Need crypto AES to be supported for PEI phase and need crypto KDF to 
> be supported for SMM phase. Update Readme to show AES and HKDF 
> defaults.
> 
> Judah Vang (2):
>   CryptoPkg: Sha1 functions causing build errors
>   CryptoPkg: Need to enable crypto functions
> 
>  CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf|  2 +-
>  CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf|  2 +-
>  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 14 ++-
>  CryptoPkg/Readme.md   | 26 +++-
>  4 files changed, 29 insertions(+), 15 deletions(-)
> 
> --
> 2.35.1.windows.2
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [PATCH v2 0/2] CryptoPkg bug fixes

2022-11-07 Thread Yao, Jiewen
Also, please ensure your patch can pass tiano CI.

I cannot find the PR to CI for those features. Would you please point to me?

Thank you
Yao Jiewen


> -Original Message-
> From: Vang, Judah 
> Sent: Tuesday, November 8, 2022 2:45 AM
> To: Yao, Jiewen ; devel@edk2.groups.io
> Subject: RE: [edk2-devel] [PATCH v2 0/2] CryptoPkg bug fixes
> 
> Sure, I can do that.  I will resubmit as separate patches.
> 
> -Original Message-
> From: Yao, Jiewen 
> Sent: Monday, November 7, 2022 10:42 AM
> To: devel@edk2.groups.io; Vang, Judah 
> Subject: RE: [edk2-devel] [PATCH v2 0/2] CryptoPkg bug fixes
> 
> Hey
> Would you please split this patch set to two different one? They are two
> different HSDs.
> 
> Please aware that we are in software freeze phase now.
> 
> I suggest we include 3991 in this release, because it is an important bug fix.
> 
> I suggest we defer 3992 to next release, because it is feature enhancement.
> 
> Comment is welcome!
> 
> Thank you
> Yao, Jiewen
> 
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Judah
> > Vang
> > Sent: Tuesday, November 8, 2022 2:37 AM
> > To: devel@edk2.groups.io
> > Subject: [edk2-devel] [PATCH v2 0/2] CryptoPkg bug fixes
> >
> > https://bugzilla.tianocore.org/show_bug.cgi?id=3991
> > https://bugzilla.tianocore.org/show_bug.cgi?id=3992
> >
> > There is a #define to deprecate Sha1 functions but not all the Sha1
> > function are wrapped around this #define causing a build error. The
> > fix is to wrap all Sha1 functions with the #define.
> >
> > Need crypto AES to be supported for PEI phase and need crypto KDF to
> > be supported for SMM phase. Update Readme to show AES and HKDF
> > defaults.
> >
> > Judah Vang (2):
> >   CryptoPkg: Sha1 functions causing build errors
> >   CryptoPkg: Need to enable crypto functions
> >
> >  CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf|  2 +-
> >  CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf|  2 +-
> >  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 14 ++-
> >  CryptoPkg/Readme.md   | 26 +++-
> >  4 files changed, 29 insertions(+), 15 deletions(-)
> >
> > --
> > 2.35.1.windows.2
> >
> >
> >
> > 
> >



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




Re: [edk2-devel] [PATCH v2 0/2] CryptoPkg bug fixes

2022-11-07 Thread Judah Vang
Jiewen,

Thanks.  Running the CI now.
https://github.com/tianocore/edk2/pull/3609

Judah

-Original Message-
From: Yao, Jiewen  
Sent: Monday, November 7, 2022 10:48 AM
To: Vang, Judah ; devel@edk2.groups.io
Subject: RE: [edk2-devel] [PATCH v2 0/2] CryptoPkg bug fixes

Also, please ensure your patch can pass tiano CI.

I cannot find the PR to CI for those features. Would you please point to me?

Thank you
Yao Jiewen


> -Original Message-
> From: Vang, Judah 
> Sent: Tuesday, November 8, 2022 2:45 AM
> To: Yao, Jiewen ; devel@edk2.groups.io
> Subject: RE: [edk2-devel] [PATCH v2 0/2] CryptoPkg bug fixes
> 
> Sure, I can do that.  I will resubmit as separate patches.
> 
> -Original Message-
> From: Yao, Jiewen 
> Sent: Monday, November 7, 2022 10:42 AM
> To: devel@edk2.groups.io; Vang, Judah 
> Subject: RE: [edk2-devel] [PATCH v2 0/2] CryptoPkg bug fixes
> 
> Hey
> Would you please split this patch set to two different one? They are 
> two different HSDs.
> 
> Please aware that we are in software freeze phase now.
> 
> I suggest we include 3991 in this release, because it is an important bug fix.
> 
> I suggest we defer 3992 to next release, because it is feature enhancement.
> 
> Comment is welcome!
> 
> Thank you
> Yao, Jiewen
> 
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Judah 
> > Vang
> > Sent: Tuesday, November 8, 2022 2:37 AM
> > To: devel@edk2.groups.io
> > Subject: [edk2-devel] [PATCH v2 0/2] CryptoPkg bug fixes
> >
> > https://bugzilla.tianocore.org/show_bug.cgi?id=3991
> > https://bugzilla.tianocore.org/show_bug.cgi?id=3992
> >
> > There is a #define to deprecate Sha1 functions but not all the Sha1 
> > function are wrapped around this #define causing a build error. The 
> > fix is to wrap all Sha1 functions with the #define.
> >
> > Need crypto AES to be supported for PEI phase and need crypto KDF to 
> > be supported for SMM phase. Update Readme to show AES and HKDF 
> > defaults.
> >
> > Judah Vang (2):
> >   CryptoPkg: Sha1 functions causing build errors
> >   CryptoPkg: Need to enable crypto functions
> >
> >  CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf|  2 +-
> >  CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf|  2 +-
> >  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 14 ++-
> >  CryptoPkg/Readme.md   | 26 +++-
> >  4 files changed, 29 insertions(+), 15 deletions(-)
> >
> > --
> > 2.35.1.windows.2
> >
> >
> >
> > 
> >



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




Re: [edk2-devel] [PATCH v1 1/1] PrmPkg/PrmSsdtInstallDxe: Update PRMT Device CID to PNP0C02.

2022-11-07 Thread Ankit Sinha
Reviewed-by: Ankit Sinha 


> -Original Message-
> From: Xu, Wei6 
> Sent: Monday, November 7, 2022 3:58 AM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael ; Desimone,
> Nathaniel L ; Sinha, Ankit
> 
> Subject: [PATCH v1 1/1] PrmPkg/PrmSsdtInstallDxe: Update PRMT Device CID
> to PNP0C02.
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4141
> 
> PRMT device is an unknown device in Device Manager if there is no Windows
> Driver installed for it. It will cause WHQL Signed Driver test failure.
> To complete WHQL certification, update PRMT Device CID to PNP0C02.
> In this way, PRMT Device will be a Motherboard Resources when no real
> driver is loaded (default), but will be shown as the actual device name when
> a legitimate Windows Driver is loaded.
> 
> Cc: Michael Kubacki 
> Cc: Nate DeSimone 
> Cc: Ankit Sinha 
> Signed-off-by: Wei6 Xu 
> ---
>  PrmPkg/PrmSsdtInstallDxe/Prm.asl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/PrmPkg/PrmSsdtInstallDxe/Prm.asl
> b/PrmPkg/PrmSsdtInstallDxe/Prm.asl
> index e34336b4eee6..c4c406e93e2f 100644
> --- a/PrmPkg/PrmSsdtInstallDxe/Prm.asl
> +++ b/PrmPkg/PrmSsdtInstallDxe/Prm.asl
> @@ -22,7 +22,7 @@ DefinitionBlock (
>  Device (PRMT)
>  {
>  Name (_HID, "80860223")
> -Name (_CID, "80860223")
> +Name (_CID, EisaId ("PNP0C02"))
>  Name (_DDN, "PRM Test Device")
> 
>  //PRM operation region format
> --
> 2.29.2.windows.2



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




[edk2-devel] [PATCH v3 1/1] CryptoPkg: Sha1 functions causing build errors

2022-11-07 Thread Judah Vang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3991

Fix build issue when DiSABLE_SHA1_DEPRECATED_INTERFACES
is defined. Percolate the #ifndef DiSABLE_SHA1_DEPRECATED_INTERFACES
to all the Sha1 functions.

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Xiaoyu Lu 
Cc: Guomin Jiang 
Cc: Nishant C Mistry 
Signed-off-by: Jian J Wang 
Signed-off-by: Nishant C Mistry 
Signed-off-by: Judah Vang 
---
 CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c 
b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
index f9796b215865..ede9fa8c09ec 100644
--- a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
+++ b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
@@ -6,7 +6,7 @@
   This API, when called, will calculate the Hash using the
   hashing algorithm specified by PcdHashApiLibPolicy.
 
-  Copyright (c) 2020, Intel Corporation. All rights reserved.
+  Copyright (c) 2020-2022, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -33,9 +33,11 @@ HashApiGetContextSize (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1GetContextSize ();
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256GetContextSize ();
@@ -75,9 +77,11 @@ HashApiInit (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1Init (HashContext);
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256Init (HashContext);
@@ -119,9 +123,11 @@ HashApiDuplicate (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1Duplicate (HashContext, NewHashContext);
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256Duplicate (HashContext, NewHashContext);
@@ -165,9 +171,11 @@ HashApiUpdate (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1Update (HashContext, DataToHash, DataToHashLen);
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256Update (HashContext, DataToHash, DataToHashLen);
@@ -209,9 +217,11 @@ HashApiFinal (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1Final (HashContext, Digest);
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256Final (HashContext, Digest);
@@ -255,9 +265,11 @@ HashApiHashAll (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1HashAll (DataToHash, DataToHashLen, Digest);
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256HashAll (DataToHash, DataToHashLen, Digest);
-- 
2.35.1.windows.2



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




[edk2-devel] [PATCH v3 0/1] CryptoPkg bug fix

2022-11-07 Thread Judah Vang
https://bugzilla.tianocore.org/show_bug.cgi?id=3991

There is a #define to deprecate Sha1 functions but not
all the Sha1 function are wrapped around this #define causing
a build error. The fix is to wrap all Sha1 functions with
the #define.

Judah Vang (1):
  CryptoPkg: Sha1 functions causing build errors

 CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

-- 
2.35.1.windows.2



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




[edk2-devel] [PATCH v1 0/1] Enable AES and HKDF

2022-11-07 Thread Judah Vang
https://bugzilla.tianocore.org/show_bug.cgi?id=3992

Need crypto AES to be supported for PEI phase and need
crypto KDF to be supported for SMM phase. Update Readme
to show AES and HKDF defaults.

Judah Vang (1):
  CryptoPkg: Need to enable crypto functions

 CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf |  2 +-
 CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf |  2 +-
 CryptoPkg/Readme.md| 27 +++-
 3 files changed, 17 insertions(+), 14 deletions(-)

-- 
2.35.1.windows.2



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




[edk2-devel] [PATCH v1 1/1] CryptoPkg: Need to enable crypto functions

2022-11-07 Thread Judah Vang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3992

V1: Enable CryptAes for PEI phase. Enable CryptHkdf for SMM phase.
Update Readme.md

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Xiaoyu Lu 
Cc: Guomin Jiang 
Cc: Nishant C Mistry 
Signed-off-by: Jian J Wang 
Signed-off-by: Nishant C Mistry 
Signed-off-by: Judah Vang 
---
 CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf |  2 +-
 CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf |  2 +-
 CryptoPkg/Readme.md| 27 +++-
 3 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
index b1629647f9c6..ee5f3cd5d4b6 100644
--- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
@@ -43,7 +43,7 @@ [Sources]
   Hash/CryptParallelHashNull.c
   Hmac/CryptHmac.c
   Kdf/CryptHkdf.c
-  Cipher/CryptAesNull.c
+  Cipher/CryptAes.c
   Cipher/CryptAeadAesGcmNull.c
   Pk/CryptRsaBasic.c
   Pk/CryptRsaExtNull.c
diff --git a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
index 0af7a3f96e8f..cc5a53ca92cd 100644
--- a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
@@ -43,7 +43,7 @@ [Sources]
   Hash/CryptCShake256.c
   Hash/CryptParallelHash.c
   Hmac/CryptHmac.c
-  Kdf/CryptHkdfNull.c
+  Kdf/CryptHkdf.c
   Cipher/CryptAes.c
   Cipher/CryptAeadAesGcmNull.c
   Pk/CryptRsaBasic.c
diff --git a/CryptoPkg/Readme.md b/CryptoPkg/Readme.md
index 067465b8eb7d..cb072db72397 100644
--- a/CryptoPkg/Readme.md
+++ b/CryptoPkg/Readme.md
@@ -447,18 +447,20 @@ and CryptoSmm modules.
  Common PEI PcdCryptoServiceFamilyEnable Settings
 
 ```
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family   
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha384.Family   
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family 
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family   
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Family   
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Family   
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Family  
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-  
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Pkcs1Verify
| TRUE
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.New
| TRUE
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Free   
| TRUE
-  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.SetKey 
| TRUE
-  
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs5HashPassword
 | TRUE
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha384.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family 
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Family  
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Family  
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Pkcs1Verify
 | TRUE
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.New
 | TRUE
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Free   
 | TRUE
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.SetKey 
 | TRUE
+  
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs5HashPassword
  | TRUE
+  
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Hkdf.Services.Sha256ExtractAndExpand
 | TRUE
 ```
 
  Common DXE and SMM PcdCryptoServiceFamilyEnable Settings
@@ -466,6 +468,7 @@ and CryptoSmm modules.
 ```
   gEfiCrypto

[edk2-devel] Event: Tools, CI, Code base construction meeting series - Monday, November 7, 2022 #cal-reminder

2022-11-07 Thread Group Notification
*Reminder: Tools, CI, Code base construction meeting series*

*When:*
Monday, November 7, 2022
4:30pm to 5:30pm
(UTC-08:00) America/Los Angeles

*Where:*
https://github.com/tianocore/edk2/discussions/2614

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1623293 )

*Description:*

TianoCore community,

Microsoft and Intel will be hosting a series of open meetings to discuss build, 
CI, tools, and other related topics. If you are interested, have ideas/opinions 
please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft 
Teams.

MS Teams Link in following discussion: * 
https://github.com/tianocore/edk2/discussions/2614

Anyone is welcome to join.

* tianocore/edk2: EDK II (github.com)
* tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP module 
(github.com) https://github.com/tianocore/edk2-basetools
* tianocore/edk2-pytool-extensions: Extensions to the edk2 build system 
allowing for a more robust and plugin based build system and tool execution 
environment (github.com) https://github.com/tianocore/edk2-pytool-extensions
* tianocore/edk2-pytool-library: Python library package that supports UEFI 
development (github.com) https://github.com/tianocore/edk2-pytool-library

MS Teams Browser Clients * 
https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client


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




[edk2-devel] Now: Tools, CI, Code base construction meeting series - Monday, November 7, 2022 #cal-notice

2022-11-07 Thread Group Notification
*Tools, CI, Code base construction meeting series*

*When:*
Monday, November 7, 2022
4:30pm to 5:30pm
(UTC-08:00) America/Los Angeles

*Where:*
https://github.com/tianocore/edk2/discussions/2614

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1623293 )

*Description:*

TianoCore community,

Microsoft and Intel will be hosting a series of open meetings to discuss build, 
CI, tools, and other related topics. If you are interested, have ideas/opinions 
please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft 
Teams.

MS Teams Link in following discussion: * 
https://github.com/tianocore/edk2/discussions/2614

Anyone is welcome to join.

* tianocore/edk2: EDK II (github.com)
* tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP module 
(github.com) https://github.com/tianocore/edk2-basetools
* tianocore/edk2-pytool-extensions: Extensions to the edk2 build system 
allowing for a more robust and plugin based build system and tool execution 
environment (github.com) https://github.com/tianocore/edk2-pytool-extensions
* tianocore/edk2-pytool-library: Python library package that supports UEFI 
development (github.com) https://github.com/tianocore/edk2-pytool-library

MS Teams Browser Clients * 
https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client


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




回复: [edk2-devel] 回复: [Patch 1/1] BaseTools/Source/C: Use /Z7 instead of /Zi for host tools

2022-11-07 Thread gaoliming via groups.io
Mike:
 I agree there is no impact with debug symbol in the binary C tools. 

 But, the release version binary C tools should be better for the developer. If 
you think this change is big, I will submit one BZ for future stable tag 
release. 

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Michael D
> Kinney
> 发送时间: 2022年11月7日 15:21
> 收件人: devel@edk2.groups.io; Gao, Liming ;
> Kinney, Michael D 
> 抄送: Feng, Bob C ; Chen, Christine
> 
> 主题: Re: [edk2-devel] 回复: [Patch 1/1] BaseTools/Source/C: Use /Z7
> instead of /Zi for host tools
> 
> Hi Liming,
> 
> That seems like a bigger change.
> 
> I see no harm in always producing symbols when build C host tools.
> 
> Mike
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of
> gaoliming via groups.io
> > Sent: Sunday, November 6, 2022 8:23 PM
> > To: Kinney, Michael D ;
> devel@edk2.groups.io
> > Cc: Feng, Bob C ; Chen, Christine
> 
> > Subject: [edk2-devel] 回复: [Patch 1/1] BaseTools/Source/C: Use /Z7
> instead of /Zi for host tools
> >
> > Mike:
> >   I suggest to remove /Zi and /DEBUG option for BaseTools C tool
> generation,
> > because only tool developer may require the debug version C tool.
> >
> > Thanks
> > Liming
> > > -邮件原件-
> > > 发件人: Michael D Kinney 
> > > 发送时间: 2022年11月6日 4:36
> > > 收件人: devel@edk2.groups.io
> > > 抄送: Bob Feng ; Liming Gao
> > > ; Yuwei Chen 
> > > 主题: [Patch 1/1] BaseTools/Source/C: Use /Z7 instead of /Zi for host
> > tools
> > >
> > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4139
> > >
> > > Update ms.common and *.mak files to use /Z7 instead of /Zi to embed
> > > symbol information in obj files for host tools built with VS compilers.
> > > This prevents vcxxx.pdb files from being generated in the root of
> > > the local edk2 repository or in BaseTools directories.
> > >
> > > Cc: Bob Feng 
> > > Cc: Liming Gao 
> > > Cc: Yuwei Chen 
> > > Signed-off-by: Michael D Kinney 
> > > ---
> > >  BaseTools/Source/C/Makefiles/ms.common | 5
> ++---
> > >  BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak | 4 ++--
> > >  BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrMS.mak  | 6 +++---
> > >  BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgDDK.mak | 4 ++--
> > >  BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgMS.mak  | 7
> +++
> > >  5 files changed, 12 insertions(+), 14 deletions(-)
> > >
> > > diff --git a/BaseTools/Source/C/Makefiles/ms.common
> > > b/BaseTools/Source/C/Makefiles/ms.common
> > > index b2dbcf376c04..8391f10d5dd2 100644
> > > --- a/BaseTools/Source/C/Makefiles/ms.common
> > > +++ b/BaseTools/Source/C/Makefiles/ms.common
> > > @@ -57,6 +57,5 @@ LINKER = $(LD)
> > >
> > >  INC = $(INC) -I . -I $(SOURCE_PATH)\Include -I $(ARCH_INCLUDE) -I
> > > $(SOURCE_PATH)\Common
> > >
> > > -CFLAGS = $(CFLAGS) /nologo /Zi /c /O2 /MT /W4 /WX /D
> > > _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
> > > -CPPFLAGS = $(CPPFLAGS) /EHsc /nologo /Zi /c /O2 /MT /D
> > > _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
> > > -
> > > +CFLAGS = $(CFLAGS) /nologo /Z7 /c /O2 /MT /W4 /WX /D
> > > _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
> > > +CPPFLAGS = $(CPPFLAGS) /EHsc /nologo /Z7 /c /O2 /MT /D
> > > _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
> > > diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak
> > > b/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak
> > > index 71b7c6b0b141..cde91a47159e 100644
> > > --- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak
> > > +++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak
> > > @@ -16,7 +16,7 @@ SET=$(PCCTS_HOME)\support\set
> > >  # Compiler stuff
> > >  CC = cl
> > >  CFLAGS = /nologo -I "." -I "$(PCCTS_H)" -I "$(SET)" -D "USER_ZZSYN" -D
> > "PC"
> > > \
> > > --D "ZZLEXBUFSIZE=65536"  -D "LONGFILENAMES" /Zi /W3
> > > -D__USE_PROTOS /wd4700
> > > +-D "ZZLEXBUFSIZE=65536"  -D "LONGFILENAMES" /Z7 /W3
> > > -D__USE_PROTOS /wd4700
> > >
> > >  ANTLR_OBJS = antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \
> > >  fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \
> > > @@ -225,7 +225,7 @@ set.obj: $(SET)\set.c \
> > >
> > >  $(CC) -c $(CFLAGS) $(SET)\set.c
> > >
> > > -clean:
> > > +clean:
> > >  del *.obj
> > >
> > >  distclean:
> > > diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrMS.mak
> > > b/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrMS.mak
> > > index b30a73bb7424..6fc4d5c15d6c 100644
> > > --- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrMS.mak
> > > +++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrMS.mak
> > > @@ -16,8 +16,8 @@ SET=$(PCCTS_HOME)\support\set
> > >  # Compiler stuff
> > >  CC = cl
> > >  CFLAGS = /nologo -I "." -I "$(PCCTS_H)" -I "$(SET)" -D "USER_ZZSYN" -D
> > "PC"
> > > \
> > > --D "ZZLEXBUFSIZE=65536"  /D "LONGFILENAMES" /Zi /W3
> > > -D__USE_PROTOS /wd4700 \
> > > - /D _CRT_SECURE_NO_DEPRECATE /D
> > > _CRT_NONSTDC_NO_DEPRECATE
> > > +  

[edk2-devel] [PATCH V4 0/3] Rename VmgExitLib to CcExitLib

2022-11-07 Thread Min Xu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4123

VmgExitLib once was designed to provide interfaces to support #VC handler
and issue VMGEXIT instruction. After TDVF (enable TDX feature in OVMF) is
introduced, this library is updated to support #VE as well. Now the name
of VmgExitLib cannot reflect what the lib does.

This patch-set renames VmgExitLib to CcExitLib (Cc means Confidential
Computing). This is simple renaming and there is no logic changes. Then
APIs defined in CcExitLib.h are added with a CcExit prefix. This is to
make the name more meaningful.

Code: https://github.com/mxu9/edk2/tree/CcExitLib.v4

v4 changes:
 - The previous versions of the patch-set are to first duplicate a new
   CcExitLib then delete the old VmgExitLib. According to this comments
   https://edk2.groups.io/g/devel/message/96019 it suggests renaming in
   a single patch is better.
 - Lib APIs are added with CcExit prefix, not CcExitLib prefix.

v3 changes:
 - Rename CcExitHandleVc / CcExitHandleVe to
   CcExitLibHandleVc / CcExitLibHandleVe to make the nameing consistent.
 - Update the CcExitLib to merge the patch eff44c008d99
  (OvmfPkg/VmgExitLig: HALT on #VE when access to private memory).
 
v2 changes:
 - Patch #3 is added to import CcExitLib in OvmfPkg's *.dsc. This is to
   prevent the building from being broken in the following patches.

Cc: Eric Dong 
Cc: Ray Ni 
Cc: Brijesh Singh 
Cc: Erdem Aktas 
Cc: Gerd Hoffmann 
Cc: James Bottomley 
Cc: Jiewen Yao 
Cc: Tom Lendacky 
Cc: Guo Dong 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
Cc: Michael D Kinney 
Cc: Liming Gao 
Reviewed-by: Jiewen Yao 
Signed-off-by: Min Xu 

Min M Xu (3):
  OvmfPkg/UefiCpuPkg/UefiPayloadPkg: Rename VmgExitLib to CcExitLib
  OvmfPkg/UefiCpuPkg: Add CcExit prefix to the APIs of CcExitLib
  Maintainers: Update the VmgExitLib to CcExitLib

 Maintainers.txt   |   2 +-
 OvmfPkg/AmdSev/AmdSevX64.dsc  |   4 +-
 OvmfPkg/Bhyve/BhyveX64.dsc|   2 +-
 OvmfPkg/CloudHv/CloudHvX64.dsc|   6 +-
 OvmfPkg/IntelTdx/IntelTdxX64.dsc  |   4 +-
 .../DxeMemEncryptSevLib.inf   |   2 +-
 .../PeiMemEncryptSevLib.inf   |   2 +-
 .../SecMemEncryptSevLib.inf   |   2 +-
 .../X64/SnpPageStateChangeInternal.c  |  10 +-
 .../VmgExitLib.c => CcExitLib/CcExitLib.c}|  23 ++--
 .../CcExitLib.inf}|  17 +--
 .../CcExitTd.h}   |   4 +-
 .../CcExitVcHandler.c}| 129 +-
 .../CcExitVcHandler.h}|   6 +-
 .../CcExitVeHandler.c}|   6 +-
 .../PeiDxeCcExitVcHandler.c}  |   6 +-
 .../SecCcExitLib.inf} |  14 +-
 .../SecCcExitVcHandler.c} |   6 +-
 .../X64/TdVmcallCpuid.nasm|   0
 OvmfPkg/Microvm/MicrovmX64.dsc|   4 +-
 OvmfPkg/OvmfPkgIa32.dsc   |   4 +-
 OvmfPkg/OvmfPkgIa32X64.dsc|   4 +-
 OvmfPkg/OvmfPkgX64.dsc|   6 +-
 OvmfPkg/OvmfXen.dsc   |   2 +-
 OvmfPkg/PlatformPei/AmdSev.c  |  10 +-
 OvmfPkg/PlatformPei/PlatformPei.inf   |   2 +-
 .../FvbServicesRuntimeDxe.inf |   2 +-
 .../QemuFlashDxe.c|  10 +-
 .../Library/{VmgExitLib.h => CcExitLib.h} |  29 ++--
 .../CcExitLibNull.c}  |  47 +--
 .../CcExitLibNull.inf}|  12 +-
 .../Library/CcExitLibNull/CcExitLibNull.uni   |  14 ++
 .../DxeCpuExceptionHandlerLib.inf |   2 +-
 .../PeiCpuExceptionHandlerLib.inf |   2 +-
 .../PeiDxeSmmCpuException.c   |   6 +-
 .../SecPeiCpuException.c  |   6 +-
 .../SecPeiCpuExceptionHandlerLib.inf  |   2 +-
 .../SmmCpuExceptionHandlerLib.inf |   2 +-
 .../Xcode5SecPeiCpuExceptionHandlerLib.inf|   2 +-
 UefiCpuPkg/Library/MpInitLib/AmdSev.c |  10 +-
 UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |   2 +-
 UefiCpuPkg/Library/MpInitLib/DxeMpLib.c   |   8 +-
 UefiCpuPkg/Library/MpInitLib/MpLib.c  |   2 +-
 UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf |   2 +-
 UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c |  10 +-
 .../Library/VmgExitLibNull/VmTdExitNull.c |  38 --
 .../Library/VmgExitLibNull/VmgExitLibNull.uni |  15 --
 UefiCpuPkg/UefiCpuPkg.dec |   4 +-
 UefiCpuPkg/UefiCpuPkg.dsc |   4 +-
 UefiPayloadPkg/UefiPayloadPkg.dsc |   2 +-
 50 files changed, 252 insertions(+), 258 deletions(-)
 rename OvmfPkg/Library/{VmgExitLib/VmgExitLib.c => CcExitLib/CcExitLib.c} (89%)
 rename OvmfPkg/Library/{VmgExitLib/VmgExitLib.inf => CcExitLib/CcExitLib.inf} 
(66%)
 rename OvmfPkg/Library/{VmgExitLib/VmTdExitHandler.h => CcExitLib/CcExitTd.h} 
(86%)
 rename OvmfPkg/Library/{VmgE

[edk2-devel] [PATCH V4 1/3] OvmfPkg/UefiCpuPkg/UefiPayloadPkg: Rename VmgExitLib to CcExitLib

2022-11-07 Thread Min Xu
From: Min M Xu 

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

VmgExitLib once was designed to provide interfaces to support #VC handler
and issue VMGEXIT instruction. After TDVF (enable TDX feature in OVMF) is
introduced, this library is updated to support #VE as well. Now the name
of VmgExitLib cannot reflect what the lib does.

This patch renames VmgExitLib to CcExitLib (Cc means Confidential
Computing). This is a simple renaming and there is no logic changes.
After renaming all the VmgExitLib related codes are updated with
CcExitLib. These changes are in OvmfPkg/UefiCpuPkg/UefiPayloadPkg.

Cc: Guo Dong 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Brijesh Singh 
Cc: Erdem Aktas 
Cc: Gerd Hoffmann 
Cc: James Bottomley 
Cc: Jiewen Yao 
Cc: Tom Lendacky 
Signed-off-by: Min Xu 
---
 OvmfPkg/AmdSev/AmdSevX64.dsc  |  4 +-
 OvmfPkg/Bhyve/BhyveX64.dsc|  2 +-
 OvmfPkg/CloudHv/CloudHvX64.dsc|  6 +--
 OvmfPkg/IntelTdx/IntelTdxX64.dsc  |  4 +-
 .../DxeMemEncryptSevLib.inf   |  2 +-
 .../PeiMemEncryptSevLib.inf   |  2 +-
 .../SecMemEncryptSevLib.inf   |  2 +-
 .../X64/SnpPageStateChangeInternal.c  |  2 +-
 .../VmgExitLib.c => CcExitLib/CcExitLib.c}|  5 ++-
 .../CcExitLib.inf}| 17 +
 .../CcExitTd.h}   |  4 +-
 .../CcExitVcHandler.c}|  5 +--
 .../CcExitVcHandler.h}|  6 +--
 .../CcExitVeHandler.c}|  4 +-
 .../PeiDxeCcExitVcHandler.c}  |  4 +-
 .../SecCcExitLib.inf} | 14 +++
 .../SecCcExitVcHandler.c} |  4 +-
 .../X64/TdVmcallCpuid.nasm|  0
 OvmfPkg/Microvm/MicrovmX64.dsc|  4 +-
 OvmfPkg/OvmfPkgIa32.dsc   |  4 +-
 OvmfPkg/OvmfPkgIa32X64.dsc|  4 +-
 OvmfPkg/OvmfPkgX64.dsc|  6 +--
 OvmfPkg/OvmfXen.dsc   |  2 +-
 OvmfPkg/PlatformPei/AmdSev.c  |  2 +-
 OvmfPkg/PlatformPei/PlatformPei.inf   |  2 +-
 .../FvbServicesRuntimeDxe.inf |  2 +-
 .../QemuFlashDxe.c|  2 +-
 .../Library/{VmgExitLib.h => CcExitLib.h} | 13 ---
 .../CcExitLibNull.c}  | 33 +++-
 .../CcExitLibNull.inf}| 12 +++---
 .../Library/CcExitLibNull/CcExitLibNull.uni   | 14 +++
 .../DxeCpuExceptionHandlerLib.inf |  2 +-
 .../PeiCpuExceptionHandlerLib.inf |  2 +-
 .../PeiDxeSmmCpuException.c   |  2 +-
 .../SecPeiCpuException.c  |  2 +-
 .../SecPeiCpuExceptionHandlerLib.inf  |  2 +-
 .../SmmCpuExceptionHandlerLib.inf |  2 +-
 .../Xcode5SecPeiCpuExceptionHandlerLib.inf|  2 +-
 UefiCpuPkg/Library/MpInitLib/AmdSev.c |  2 +-
 UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |  2 +-
 UefiCpuPkg/Library/MpInitLib/DxeMpLib.c   |  2 +-
 UefiCpuPkg/Library/MpInitLib/MpLib.c  |  2 +-
 UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf |  2 +-
 UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c |  2 +-
 .../Library/VmgExitLibNull/VmTdExitNull.c | 38 ---
 .../Library/VmgExitLibNull/VmgExitLibNull.uni | 15 
 UefiCpuPkg/UefiCpuPkg.dec |  4 +-
 UefiCpuPkg/UefiCpuPkg.dsc |  4 +-
 UefiPayloadPkg/UefiPayloadPkg.dsc |  2 +-
 49 files changed, 135 insertions(+), 141 deletions(-)
 rename OvmfPkg/Library/{VmgExitLib/VmgExitLib.c => CcExitLib/CcExitLib.c} (94%)
 rename OvmfPkg/Library/{VmgExitLib/VmgExitLib.inf => CcExitLib/CcExitLib.inf} 
(66%)
 rename OvmfPkg/Library/{VmgExitLib/VmTdExitHandler.h => CcExitLib/CcExitTd.h} 
(86%)
 rename OvmfPkg/Library/{VmgExitLib/VmgExitVcHandler.c => 
CcExitLib/CcExitVcHandler.c} (95%)
 rename OvmfPkg/Library/{VmgExitLib/VmgExitVcHandler.h => 
CcExitLib/CcExitVcHandler.h} (89%)
 rename OvmfPkg/Library/{VmgExitLib/VmTdExitVeHandler.c => 
CcExitLib/CcExitVeHandler.c} (95%)
 rename OvmfPkg/Library/{VmgExitLib/PeiDxeVmgExitVcHandler.c => 
CcExitLib/PeiDxeCcExitVcHandler.c} (94%)
 rename OvmfPkg/Library/{VmgExitLib/SecVmgExitLib.inf => 
CcExitLib/SecCcExitLib.inf} (79%)
 rename OvmfPkg/Library/{VmgExitLib/SecVmgExitVcHandler.c => 
CcExitLib/SecCcExitVcHandler.c} (94%)
 rename OvmfPkg/Library/{VmgExitLib => CcExitLib}/X64/TdVmcallCpuid.nasm (100%)
 rename UefiCpuPkg/Include/Library/{VmgExitLib.h => CcExitLib.h} (89%)
 rename UefiCpuPkg/Library/{VmgExitLibNull/VmgExitLibNull.c => 
CcExitLibNull/CcExitLibNull.c} (79%)
 rename UefiCpuPkg/Library/{VmgExitLibNull/VmgExitLibNull.inf => 
CcExitLibNull/CcExitLibNull.inf} (60%)
 create mode 100644 UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.uni
 delete mode 100644 UefiCpuPkg/Library/VmgExitLibNull/VmTdExitNull.c
 delete mode 100644

[edk2-devel] [PATCH V4 2/3] OvmfPkg/UefiCpuPkg: Add CcExit prefix to the APIs of CcExitLib

2022-11-07 Thread Min Xu
From: Min M Xu 

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

APIs which are defined in CcExitLib.h are added with the CcExit prefix.
This is to make the APIs' name more meaningful.

This change impacts OvmfPkg/UefiCpuPkg.

Cc: Eric Dong 
Cc: Ray Ni 
Cc: Brijesh Singh 
Cc: Erdem Aktas 
Cc: Gerd Hoffmann 
Cc: James Bottomley 
Cc: Jiewen Yao 
Cc: Tom Lendacky 
Signed-off-by: Min Xu 
---
 .../X64/SnpPageStateChangeInternal.c  |   8 +-
 OvmfPkg/Library/CcExitLib/CcExitLib.c |  18 +--
 OvmfPkg/Library/CcExitLib/CcExitVcHandler.c   | 124 +-
 OvmfPkg/Library/CcExitLib/CcExitVeHandler.c   |   2 +-
 .../Library/CcExitLib/PeiDxeCcExitVcHandler.c |   2 +-
 .../Library/CcExitLib/SecCcExitVcHandler.c|   2 +-
 OvmfPkg/PlatformPei/AmdSev.c  |   8 +-
 .../QemuFlashDxe.c|   8 +-
 UefiCpuPkg/Include/Library/CcExitLib.h|  16 +--
 .../Library/CcExitLibNull/CcExitLibNull.c |  16 +--
 .../PeiDxeSmmCpuException.c   |   4 +-
 .../SecPeiCpuException.c  |   4 +-
 UefiCpuPkg/Library/MpInitLib/AmdSev.c |   8 +-
 UefiCpuPkg/Library/MpInitLib/DxeMpLib.c   |   6 +-
 UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c |   8 +-
 15 files changed, 117 insertions(+), 117 deletions(-)

diff --git 
a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c 
b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c
index 73698a7b9d8c..4d684964d838 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c
@@ -193,9 +193,9 @@ PageStateChangeVmgExit (
   //
   while (Info->Header.CurrentEntry <= Info->Header.EndEntry) {
 Ghcb->SaveArea.SwScratch = (UINT64)Ghcb->SharedBuffer;
-VmgSetOffsetValid (Ghcb, GhcbSwScratch);
+CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch);
 
-Status = VmgExit (Ghcb, SVM_EXIT_SNP_PAGE_STATE_CHANGE, 0, 0);
+Status = CcExitVmgExit (Ghcb, SVM_EXIT_SNP_PAGE_STATE_CHANGE, 0, 0);
 
 //
 // The Page State Change VMGEXIT can pass the failure through the
@@ -251,7 +251,7 @@ InternalSetPageState (
 //
 // Initialize the GHCB
 //
-VmgInit (Ghcb, &InterruptState);
+CcExitVmgInit (Ghcb, &InterruptState);
 
 //
 // Build the page state structure
@@ -293,7 +293,7 @@ InternalSetPageState (
   PvalidateRange (Info, CurrentEntry, EndEntry, TRUE);
 }
 
-VmgDone (Ghcb, InterruptState);
+CcExitVmgDone (Ghcb, InterruptState);
 
 BaseAddress = NextAddress;
   }
diff --git a/OvmfPkg/Library/CcExitLib/CcExitLib.c 
b/OvmfPkg/Library/CcExitLib/CcExitLib.c
index 477064cde2bb..e256000fb283 100644
--- a/OvmfPkg/Library/CcExitLib/CcExitLib.c
+++ b/OvmfPkg/Library/CcExitLib/CcExitLib.c
@@ -103,7 +103,7 @@ VmgExitErrorCheck (
 **/
 UINT64
 EFIAPI
-VmgExit (
+CcExitVmgExit (
   IN OUT GHCB*Ghcb,
   IN UINT64  ExitCode,
   IN UINT64  ExitInfo1,
@@ -114,9 +114,9 @@ VmgExit (
   Ghcb->SaveArea.SwExitInfo1 = ExitInfo1;
   Ghcb->SaveArea.SwExitInfo2 = ExitInfo2;
 
-  VmgSetOffsetValid (Ghcb, GhcbSwExitCode);
-  VmgSetOffsetValid (Ghcb, GhcbSwExitInfo1);
-  VmgSetOffsetValid (Ghcb, GhcbSwExitInfo2);
+  CcExitVmgSetOffsetValid (Ghcb, GhcbSwExitCode);
+  CcExitVmgSetOffsetValid (Ghcb, GhcbSwExitInfo1);
+  CcExitVmgSetOffsetValid (Ghcb, GhcbSwExitInfo2);
 
   //
   // Guest memory is used for the guest-hypervisor communication, so fence
@@ -138,12 +138,12 @@ VmgExit (
 
   @param[in, out]  GhcbA pointer to the GHCB
   @param[in, out]  InterruptState  A pointer to hold the current interrupt
-   state, used for restoring in VmgDone ()
+   state, used for restoring in CcExitVmgDone 
()
 
 **/
 VOID
 EFIAPI
-VmgInit (
+CcExitVmgInit (
   IN OUT GHCB *Ghcb,
   IN OUT BOOLEAN  *InterruptState
   )
@@ -173,7 +173,7 @@ VmgInit (
 **/
 VOID
 EFIAPI
-VmgDone (
+CcExitVmgDone (
   IN OUT GHCB *Ghcb,
   IN BOOLEAN  InterruptState
   )
@@ -195,7 +195,7 @@ VmgDone (
 **/
 VOID
 EFIAPI
-VmgSetOffsetValid (
+CcExitVmgSetOffsetValid (
   IN OUT GHCB   *Ghcb,
   IN GHCB_REGISTER  Offset
   )
@@ -224,7 +224,7 @@ VmgSetOffsetValid (
 **/
 BOOLEAN
 EFIAPI
-VmgIsOffsetValid (
+CcExitVmgIsOffsetValid (
   IN GHCB   *Ghcb,
   IN GHCB_REGISTER  Offset
   )
diff --git a/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c 
b/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c
index ad2a922c9f43..985e5479775c 100644
--- a/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c
+++ b/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c
@@ -611,7 +611,7 @@ UnsupportedExit (
 {
   UINT64  Status;
 
-  Status = VmgExit (Ghcb, SVM_EXIT_UNSUPPORTED, Regs->ExceptionData, 0);
+  Status = CcExitVmgExit (Ghcb, SVM_EXIT_UNSUPPORTED, Regs->ExceptionData, 0);
   if (Status == 0) {
 GHCB_EVENT_INJECTION  Event;
 
@@ -755,8 +755,8 @@ MmioExit (
   CopyMem (Ghcb->SharedBuffer,

[edk2-devel] [PATCH V4 3/3] Maintainers: Update the VmgExitLib to CcExitLib

2022-11-07 Thread Min Xu
From: Min M Xu 

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

VmgExitLib is renamed as CcExitLib. The related section in
Maintainers.txt should be updated as well.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Erdem Aktas 
Cc: Gerd Hoffmann 
Cc: James Bottomley 
Cc: Jiewen Yao 
Cc: Tom Lendacky 
Reviewed-by: Michael D Kinney 
Signed-off-by: Min Xu 
---
 Maintainers.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index 889990fa566f..454b93420da4 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -475,7 +475,7 @@ F: OvmfPkg/Include/Library/MemEncryptSevLib.h
 F: OvmfPkg/IoMmuDxe/AmdSevIoMmu.*
 F: OvmfPkg/Library/BaseMemEncryptSevLib/
 F: OvmfPkg/Library/PlatformBootManagerLibGrub/
-F: OvmfPkg/Library/VmgExitLib/
+F: OvmfPkg/Library/CcExitLib/
 F: OvmfPkg/PlatformPei/AmdSev.c
 F: OvmfPkg/ResetVector/
 F: OvmfPkg/Sec/
-- 
2.29.2.windows.2



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




回复: [edk2-devel] 回复: [edk2-devel] [PATCH] ShellPkg:Improved Smbios Type 9 data under smbiosview

2022-11-07 Thread gaoliming via groups.io
Create PR https://github.com/tianocore/edk2/pull/3611 to merge it. 

 

Thanks

Liming

发件人: devel@edk2.groups.io  代表 gaoliming via groups.io
发送时间: 2022年11月7日 12:19
收件人: devel@edk2.groups.io; saina...@ami.com
抄送: zhichao@intel.com
主题: 回复: [edk2-devel] 回复: [edk2-devel] [PATCH] ShellPkg:Improved Smbios Type 9 
data under smbiosview

 

Sainadh:

 The change is good to me. Reviewed-by: Liming Gao mailto:gaolim...@byosoft.com.cn> >

 

Thanks

Liming

发件人: devel@edk2.groups.io   mailto:devel@edk2.groups.io> > 代表 Sainadh Nagolu via groups.io
发送时间: 2022年11月4日 19:32
收件人: gaoliming mailto:gaolim...@byosoft.com.cn> >; 
devel@edk2.groups.io  
主题: Re: [edk2-devel] 回复: [edk2-devel] [PATCH] ShellPkg:Improved Smbios Type 9 
data under smbiosview

 

Hi Liming,

Created Pull request and passed CI check.

https://github.com/tianocore/edk2/pull/3593

Thanks,
Sainadh. 





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




[edk2-devel] [edk2-stable202211] [PATCH v3 1/1] CryptoPkg: Sha1 functions causing build errors

2022-11-07 Thread Yao, Jiewen
Hello
I suggest we add this to edk2-stable202211, since this is an important bug fix.

The V1 and V2 patch are sent before soft freeze.
V3 patch splits V2.


Thank you
Yao Jiewen


> -Original Message-
> From: Vang, Judah 
> Sent: Tuesday, November 8, 2022 4:02 AM
> To: devel@edk2.groups.io
> Cc: Yao, Jiewen ; Wang, Jian J
> ; Xiaoyu Lu ; Jiang, Guomin
> ; Mistry, Nishant C 
> Subject: [PATCH v3 1/1] CryptoPkg: Sha1 functions causing build errors
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3991
> 
> Fix build issue when DiSABLE_SHA1_DEPRECATED_INTERFACES
> is defined. Percolate the #ifndef DiSABLE_SHA1_DEPRECATED_INTERFACES
> to all the Sha1 functions.
> 
> Cc: Jiewen Yao 
> Cc: Jian J Wang 
> Cc: Xiaoyu Lu 
> Cc: Guomin Jiang 
> Cc: Nishant C Mistry 
> Signed-off-by: Jian J Wang 
> Signed-off-by: Nishant C Mistry 
> Signed-off-by: Judah Vang 
> ---
>  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 14
> +-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
> b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
> index f9796b215865..ede9fa8c09ec 100644
> --- a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
> +++ b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
> @@ -6,7 +6,7 @@
>This API, when called, will calculate the Hash using the
>hashing algorithm specified by PcdHashApiLibPolicy.
> 
> -  Copyright (c) 2020, Intel Corporation. All rights reserved.
> +  Copyright (c) 2020-2022, Intel Corporation. All rights reserved.
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -33,9 +33,11 @@ HashApiGetContextSize (
>)
>  {
>switch (PcdGet32 (PcdHashApiLibPolicy)) {
> + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
>  case HASH_ALG_SHA1:
>return Sha1GetContextSize ();
>break;
> + #endif
> 
>  case HASH_ALG_SHA256:
>return Sha256GetContextSize ();
> @@ -75,9 +77,11 @@ HashApiInit (
>)
>  {
>switch (PcdGet32 (PcdHashApiLibPolicy)) {
> + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
>  case HASH_ALG_SHA1:
>return Sha1Init (HashContext);
>break;
> + #endif
> 
>  case HASH_ALG_SHA256:
>return Sha256Init (HashContext);
> @@ -119,9 +123,11 @@ HashApiDuplicate (
>)
>  {
>switch (PcdGet32 (PcdHashApiLibPolicy)) {
> + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
>  case HASH_ALG_SHA1:
>return Sha1Duplicate (HashContext, NewHashContext);
>break;
> + #endif
> 
>  case HASH_ALG_SHA256:
>return Sha256Duplicate (HashContext, NewHashContext);
> @@ -165,9 +171,11 @@ HashApiUpdate (
>)
>  {
>switch (PcdGet32 (PcdHashApiLibPolicy)) {
> + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
>  case HASH_ALG_SHA1:
>return Sha1Update (HashContext, DataToHash, DataToHashLen);
>break;
> + #endif
> 
>  case HASH_ALG_SHA256:
>return Sha256Update (HashContext, DataToHash, DataToHashLen);
> @@ -209,9 +217,11 @@ HashApiFinal (
>)
>  {
>switch (PcdGet32 (PcdHashApiLibPolicy)) {
> + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
>  case HASH_ALG_SHA1:
>return Sha1Final (HashContext, Digest);
>break;
> + #endif
> 
>  case HASH_ALG_SHA256:
>return Sha256Final (HashContext, Digest);
> @@ -255,9 +265,11 @@ HashApiHashAll (
>)
>  {
>switch (PcdGet32 (PcdHashApiLibPolicy)) {
> + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
>  case HASH_ALG_SHA1:
>return Sha1HashAll (DataToHash, DataToHashLen, Digest);
>break;
> + #endif
> 
>  case HASH_ALG_SHA256:
>return Sha256HashAll (DataToHash, DataToHashLen, Digest);
> --
> 2.35.1.windows.2



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




[edk2-devel] [edk2-stable202211] [PATCH V4 0/3] Rename VmgExitLib to CcExitLib

2022-11-07 Thread Yao, Jiewen
Hi
I suggest we catch this to edk2-stable202211.

I already give R-B for V3 before soft-freeze.

The V4 just merges 2 patch into 1, based upon other feedback.

Thank you
Yao, Jiewen


> -Original Message-
> From: Xu, Min M 
> Sent: Tuesday, November 8, 2022 9:15 AM
> To: devel@edk2.groups.io
> Cc: Xu, Min M ; Dong, Eric ;
> Ni, Ray ; Brijesh Singh ; Aktas,
> Erdem ; Gerd Hoffmann ;
> James Bottomley ; Yao, Jiewen
> ; Tom Lendacky ;
> Dong, Guo ; Rhodes, Sean ;
> Lu, James ; Guo, Gua ; Kinney,
> Michael D ; Gao, Liming
> 
> Subject: [PATCH V4 0/3] Rename VmgExitLib to CcExitLib
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4123
> 
> VmgExitLib once was designed to provide interfaces to support #VC handler
> and issue VMGEXIT instruction. After TDVF (enable TDX feature in OVMF) is
> introduced, this library is updated to support #VE as well. Now the name
> of VmgExitLib cannot reflect what the lib does.
> 
> This patch-set renames VmgExitLib to CcExitLib (Cc means Confidential
> Computing). This is simple renaming and there is no logic changes. Then
> APIs defined in CcExitLib.h are added with a CcExit prefix. This is to
> make the name more meaningful.
> 
> Code: https://github.com/mxu9/edk2/tree/CcExitLib.v4
> 
> v4 changes:
>  - The previous versions of the patch-set are to first duplicate a new
>CcExitLib then delete the old VmgExitLib. According to this comments
>https://edk2.groups.io/g/devel/message/96019 it suggests renaming in
>a single patch is better.
>  - Lib APIs are added with CcExit prefix, not CcExitLib prefix.
> 
> v3 changes:
>  - Rename CcExitHandleVc / CcExitHandleVe to
>CcExitLibHandleVc / CcExitLibHandleVe to make the nameing consistent.
>  - Update the CcExitLib to merge the patch eff44c008d99
>   (OvmfPkg/VmgExitLig: HALT on #VE when access to private memory).
> 
> v2 changes:
>  - Patch #3 is added to import CcExitLib in OvmfPkg's *.dsc. This is to
>prevent the building from being broken in the following patches.
> 
> Cc: Eric Dong 
> Cc: Ray Ni 
> Cc: Brijesh Singh 
> Cc: Erdem Aktas 
> Cc: Gerd Hoffmann 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Cc: Guo Dong 
> Cc: Sean Rhodes 
> Cc: James Lu 
> Cc: Gua Guo 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Reviewed-by: Jiewen Yao 
> Signed-off-by: Min Xu 
> 
> Min M Xu (3):
>   OvmfPkg/UefiCpuPkg/UefiPayloadPkg: Rename VmgExitLib to CcExitLib
>   OvmfPkg/UefiCpuPkg: Add CcExit prefix to the APIs of CcExitLib
>   Maintainers: Update the VmgExitLib to CcExitLib
> 
>  Maintainers.txt   |   2 +-
>  OvmfPkg/AmdSev/AmdSevX64.dsc  |   4 +-
>  OvmfPkg/Bhyve/BhyveX64.dsc|   2 +-
>  OvmfPkg/CloudHv/CloudHvX64.dsc|   6 +-
>  OvmfPkg/IntelTdx/IntelTdxX64.dsc  |   4 +-
>  .../DxeMemEncryptSevLib.inf   |   2 +-
>  .../PeiMemEncryptSevLib.inf   |   2 +-
>  .../SecMemEncryptSevLib.inf   |   2 +-
>  .../X64/SnpPageStateChangeInternal.c  |  10 +-
>  .../VmgExitLib.c => CcExitLib/CcExitLib.c}|  23 ++--
>  .../CcExitLib.inf}|  17 +--
>  .../CcExitTd.h}   |   4 +-
>  .../CcExitVcHandler.c}| 129 +-
>  .../CcExitVcHandler.h}|   6 +-
>  .../CcExitVeHandler.c}|   6 +-
>  .../PeiDxeCcExitVcHandler.c}  |   6 +-
>  .../SecCcExitLib.inf} |  14 +-
>  .../SecCcExitVcHandler.c} |   6 +-
>  .../X64/TdVmcallCpuid.nasm|   0
>  OvmfPkg/Microvm/MicrovmX64.dsc|   4 +-
>  OvmfPkg/OvmfPkgIa32.dsc   |   4 +-
>  OvmfPkg/OvmfPkgIa32X64.dsc|   4 +-
>  OvmfPkg/OvmfPkgX64.dsc|   6 +-
>  OvmfPkg/OvmfXen.dsc   |   2 +-
>  OvmfPkg/PlatformPei/AmdSev.c  |  10 +-
>  OvmfPkg/PlatformPei/PlatformPei.inf   |   2 +-
>  .../FvbServicesRuntimeDxe.inf |   2 +-
>  .../QemuFlashDxe.c|  10 +-
>  .../Library/{VmgExitLib.h => CcExitLib.h} |  29 ++--
>  .../CcExitLibNull.c}  |  47 +--
>  .../CcExitLibNull.inf}|  12 +-
>  .../Library/CcExitLibNull/CcExitLibNull.uni   |  14 ++
>  .../DxeCpuExceptionHandlerLib.inf |   2 +-
>  .../PeiCpuExceptionHandlerLib.inf |   2 +-
>  .../PeiDxeSmmCpuException.c   |   6 +-
>  .../SecPeiCpuException.c  |   6 +-
>  .../SecPeiCpuExceptionHandlerLib.inf  |   2 +-
>  .../SmmCpuExceptionHandlerLib.inf |   2 +-
>  .../Xcode5SecPeiCpuExceptionHandlerLib.inf|   2 +-
>  UefiCpuPkg/Library/MpInitLib/AmdSev.c |  10 +-
>  UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |   2 +-
>  UefiCpuPkg/Library/MpInitLib/DxeMpLib.c   |   8 +-
>  Ue

Re: [edk2-devel] [edk2-stable202211] [PATCH v3 1/1] CryptoPkg: Sha1 functions causing build errors

2022-11-07 Thread Michael D Kinney
I agree.

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Yao, Jiewen
> Sent: Monday, November 7, 2022 5:26 PM
> To: Vang, Judah ; devel@edk2.groups.io
> Cc: Wang, Jian J ; Xiaoyu Lu ; 
> Jiang, Guomin ; Mistry,
> Nishant C 
> Subject: [edk2-devel] [edk2-stable202211] [PATCH v3 1/1] CryptoPkg: Sha1 
> functions causing build errors
> 
> Hello
> I suggest we add this to edk2-stable202211, since this is an important bug 
> fix.
> 
> The V1 and V2 patch are sent before soft freeze.
> V3 patch splits V2.
> 
> 
> Thank you
> Yao Jiewen
> 
> 
> > -Original Message-
> > From: Vang, Judah 
> > Sent: Tuesday, November 8, 2022 4:02 AM
> > To: devel@edk2.groups.io
> > Cc: Yao, Jiewen ; Wang, Jian J
> > ; Xiaoyu Lu ; Jiang, Guomin
> > ; Mistry, Nishant C 
> > Subject: [PATCH v3 1/1] CryptoPkg: Sha1 functions causing build errors
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3991
> >
> > Fix build issue when DiSABLE_SHA1_DEPRECATED_INTERFACES
> > is defined. Percolate the #ifndef DiSABLE_SHA1_DEPRECATED_INTERFACES
> > to all the Sha1 functions.
> >
> > Cc: Jiewen Yao 
> > Cc: Jian J Wang 
> > Cc: Xiaoyu Lu 
> > Cc: Guomin Jiang 
> > Cc: Nishant C Mistry 
> > Signed-off-by: Jian J Wang 
> > Signed-off-by: Nishant C Mistry 
> > Signed-off-by: Judah Vang 
> > ---
> >  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 14
> > +-
> >  1 file changed, 13 insertions(+), 1 deletion(-)
> >
> > diff --git a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
> > b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
> > index f9796b215865..ede9fa8c09ec 100644
> > --- a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
> > +++ b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
> > @@ -6,7 +6,7 @@
> >This API, when called, will calculate the Hash using the
> >hashing algorithm specified by PcdHashApiLibPolicy.
> >
> > -  Copyright (c) 2020, Intel Corporation. All rights reserved.
> > +  Copyright (c) 2020-2022, Intel Corporation. All rights reserved.
> >SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >  **/
> > @@ -33,9 +33,11 @@ HashApiGetContextSize (
> >)
> >  {
> >switch (PcdGet32 (PcdHashApiLibPolicy)) {
> > + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
> >  case HASH_ALG_SHA1:
> >return Sha1GetContextSize ();
> >break;
> > + #endif
> >
> >  case HASH_ALG_SHA256:
> >return Sha256GetContextSize ();
> > @@ -75,9 +77,11 @@ HashApiInit (
> >)
> >  {
> >switch (PcdGet32 (PcdHashApiLibPolicy)) {
> > + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
> >  case HASH_ALG_SHA1:
> >return Sha1Init (HashContext);
> >break;
> > + #endif
> >
> >  case HASH_ALG_SHA256:
> >return Sha256Init (HashContext);
> > @@ -119,9 +123,11 @@ HashApiDuplicate (
> >)
> >  {
> >switch (PcdGet32 (PcdHashApiLibPolicy)) {
> > + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
> >  case HASH_ALG_SHA1:
> >return Sha1Duplicate (HashContext, NewHashContext);
> >break;
> > + #endif
> >
> >  case HASH_ALG_SHA256:
> >return Sha256Duplicate (HashContext, NewHashContext);
> > @@ -165,9 +171,11 @@ HashApiUpdate (
> >)
> >  {
> >switch (PcdGet32 (PcdHashApiLibPolicy)) {
> > + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
> >  case HASH_ALG_SHA1:
> >return Sha1Update (HashContext, DataToHash, DataToHashLen);
> >break;
> > + #endif
> >
> >  case HASH_ALG_SHA256:
> >return Sha256Update (HashContext, DataToHash, DataToHashLen);
> > @@ -209,9 +217,11 @@ HashApiFinal (
> >)
> >  {
> >switch (PcdGet32 (PcdHashApiLibPolicy)) {
> > + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
> >  case HASH_ALG_SHA1:
> >return Sha1Final (HashContext, Digest);
> >break;
> > + #endif
> >
> >  case HASH_ALG_SHA256:
> >return Sha256Final (HashContext, Digest);
> > @@ -255,9 +265,11 @@ HashApiHashAll (
> >)
> >  {
> >switch (PcdGet32 (PcdHashApiLibPolicy)) {
> > + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
> >  case HASH_ALG_SHA1:
> >return Sha1HashAll (DataToHash, DataToHashLen, Digest);
> >break;
> > + #endif
> >
> >  case HASH_ALG_SHA256:
> >return Sha256HashAll (DataToHash, DataToHashLen, Digest);
> > --
> > 2.35.1.windows.2
> 
> 
> 
> 
> 



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




Re: [edk2-devel] 回复: [Patch 1/1] BaseTools/Source/C: Use /Z7 instead of /Zi for host tools

2022-11-07 Thread Michael D Kinney
Hi Liming,

I think a BZ feature request for BaseTools to support building with or without 
symbols would be good to submit for future stable tag.

I would like to see this patch be added to the current stable tag.

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of gaoliming via 
> groups.io
> Sent: Monday, November 7, 2022 5:04 PM
> To: devel@edk2.groups.io; Kinney, Michael D 
> Cc: Feng, Bob C ; Chen, Christine 
> Subject: 回复: [edk2-devel] 回复: [Patch 1/1] BaseTools/Source/C: Use /Z7 instead 
> of /Zi for host tools
> 
> Mike:
>  I agree there is no impact with debug symbol in the binary C tools.
> 
>  But, the release version binary C tools should be better for the developer. 
> If you think this change is big, I will submit one
> BZ for future stable tag release.
> 
> Thanks
> Liming
> > -邮件原件-
> > 发件人: devel@edk2.groups.io  代表 Michael D
> > Kinney
> > 发送时间: 2022年11月7日 15:21
> > 收件人: devel@edk2.groups.io; Gao, Liming ;
> > Kinney, Michael D 
> > 抄送: Feng, Bob C ; Chen, Christine
> > 
> > 主题: Re: [edk2-devel] 回复: [Patch 1/1] BaseTools/Source/C: Use /Z7
> > instead of /Zi for host tools
> >
> > Hi Liming,
> >
> > That seems like a bigger change.
> >
> > I see no harm in always producing symbols when build C host tools.
> >
> > Mike
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of
> > gaoliming via groups.io
> > > Sent: Sunday, November 6, 2022 8:23 PM
> > > To: Kinney, Michael D ;
> > devel@edk2.groups.io
> > > Cc: Feng, Bob C ; Chen, Christine
> > 
> > > Subject: [edk2-devel] 回复: [Patch 1/1] BaseTools/Source/C: Use /Z7
> > instead of /Zi for host tools
> > >
> > > Mike:
> > >   I suggest to remove /Zi and /DEBUG option for BaseTools C tool
> > generation,
> > > because only tool developer may require the debug version C tool.
> > >
> > > Thanks
> > > Liming
> > > > -邮件原件-
> > > > 发件人: Michael D Kinney 
> > > > 发送时间: 2022年11月6日 4:36
> > > > 收件人: devel@edk2.groups.io
> > > > 抄送: Bob Feng ; Liming Gao
> > > > ; Yuwei Chen 
> > > > 主题: [Patch 1/1] BaseTools/Source/C: Use /Z7 instead of /Zi for host
> > > tools
> > > >
> > > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4139
> > > >
> > > > Update ms.common and *.mak files to use /Z7 instead of /Zi to embed
> > > > symbol information in obj files for host tools built with VS compilers.
> > > > This prevents vcxxx.pdb files from being generated in the root of
> > > > the local edk2 repository or in BaseTools directories.
> > > >
> > > > Cc: Bob Feng 
> > > > Cc: Liming Gao 
> > > > Cc: Yuwei Chen 
> > > > Signed-off-by: Michael D Kinney 
> > > > ---
> > > >  BaseTools/Source/C/Makefiles/ms.common | 5
> > ++---
> > > >  BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak | 4 ++--
> > > >  BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrMS.mak  | 6 +++---
> > > >  BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgDDK.mak | 4 ++--
> > > >  BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgMS.mak  | 7
> > +++
> > > >  5 files changed, 12 insertions(+), 14 deletions(-)
> > > >
> > > > diff --git a/BaseTools/Source/C/Makefiles/ms.common
> > > > b/BaseTools/Source/C/Makefiles/ms.common
> > > > index b2dbcf376c04..8391f10d5dd2 100644
> > > > --- a/BaseTools/Source/C/Makefiles/ms.common
> > > > +++ b/BaseTools/Source/C/Makefiles/ms.common
> > > > @@ -57,6 +57,5 @@ LINKER = $(LD)
> > > >
> > > >  INC = $(INC) -I . -I $(SOURCE_PATH)\Include -I $(ARCH_INCLUDE) -I
> > > > $(SOURCE_PATH)\Common
> > > >
> > > > -CFLAGS = $(CFLAGS) /nologo /Zi /c /O2 /MT /W4 /WX /D
> > > > _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
> > > > -CPPFLAGS = $(CPPFLAGS) /EHsc /nologo /Zi /c /O2 /MT /D
> > > > _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
> > > > -
> > > > +CFLAGS = $(CFLAGS) /nologo /Z7 /c /O2 /MT /W4 /WX /D
> > > > _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
> > > > +CPPFLAGS = $(CPPFLAGS) /EHsc /nologo /Z7 /c /O2 /MT /D
> > > > _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
> > > > diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak
> > > > b/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak
> > > > index 71b7c6b0b141..cde91a47159e 100644
> > > > --- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak
> > > > +++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak
> > > > @@ -16,7 +16,7 @@ SET=$(PCCTS_HOME)\support\set
> > > >  # Compiler stuff
> > > >  CC = cl
> > > >  CFLAGS = /nologo -I "." -I "$(PCCTS_H)" -I "$(SET)" -D "USER_ZZSYN" -D
> > > "PC"
> > > > \
> > > > --D "ZZLEXBUFSIZE=65536"  -D "LONGFILENAMES" /Zi /W3
> > > > -D__USE_PROTOS /wd4700
> > > > +-D "ZZLEXBUFSIZE=65536"  -D "LONGFILENAMES" /Z7 /W3
> > > > -D__USE_PROTOS /wd4700
> > > >
> > > >  ANTLR_OBJS = antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \
> > > >  fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \
> > > > @@ -225,7 +225,7 @@ set.obj: $(SET)\set.c \
> > > >
> > > >  $(CC) -c $(CFLA

[edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, November 8, 2022 #cal-reminder

2022-11-07 Thread Group Notification
*Reminder: TianoCore Bug Triage - APAC / NAMO*

*When:*
Tuesday, November 8, 2022
6:30pm to 7:30pm
(UTC-08:00) America/Los Angeles

*Where:*
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d

*Organizer:* Liming Gao gaolim...@byosoft.com.cn ( 
gaolim...@byosoft.com.cn?subject=Re:%20Event:%20TianoCore%20Bug%20Triage%20-%20APAC%20%2F%20NAMO
 )

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1268288 )

*Description:*

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao



Microsoft Teams meeting

*Join on your computer or mobile app*

Click here to join the meeting ( 
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d
 )

*Join with a video conferencing device*

te...@conf.intel.com

Video Conference ID: 116 062 094 0

Alternate VTC dialing instructions ( 
https://conf.intel.com/teams/?conf=1160620940&ivr=teams&d=conf.intel.com&test=test_call
 )

*Or call in (audio only)*

+1 916-245-6934,,77463821# ( tel:+19162456934,,77463821# ) United States, 
Sacramento

Phone Conference ID: 774 638 21#

Find a local number ( 
https://dialin.teams.microsoft.com/d195d438-2daa-420e-b9ea-da26f9d1d6d5?id=77463821
 ) | Reset PIN ( https://mysettings.lync.com/pstnconferencing )

Learn More ( https://aka.ms/JoinTeamsMeeting ) | Meeting options ( 
https://teams.microsoft.com/meetingOptions/?organizerId=b286b53a-1218-4db3-bfc9-3d4c5aa7669e&tenantId=46c98d88-e344-4ed4-8496-4ed7712e255d&threadId=19_meeting_OTUyZTg2NjgtNDhlNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh@thread.v2&messageId=0&language=en-US
 )


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




Re: [edk2-devel] [PATCH] UefiCpuPkg/ResetVector:Add Option to reserve 4K region at 4GB

2022-11-07 Thread Ni, Ray
Reviewed-by: Ray Ni 

> -Original Message-
> From: Duggapu, Chinni B 
> Sent: Monday, November 7, 2022 2:48 PM
> To: devel@edk2.groups.io
> Cc: Duggapu, Chinni B ; Ni, Ray
> 
> Subject: [PATCH] UefiCpuPkg/ResetVector:Add Option to reserve 4K region
> at 4GB
> 
> From: "Duggapu, Chinni B" 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4140
> 
> Some implementations may need to keep the initial Reset code to be
> separated out from rest of the code.This request is to add padding at
> lower 4K region below 4 GB which will result having only few jmp
> instructions and data at that region.
> 
> Cc: Ray Ni 
> Signed-off-by: Duggapu Chinni B 
> ---
>  UefiCpuPkg/ResetVector/Vtf0/Ia16/ResetVectorVtf0.asm | 10 +-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/UefiCpuPkg/ResetVector/Vtf0/Ia16/ResetVectorVtf0.asm
> b/UefiCpuPkg/ResetVector/Vtf0/Ia16/ResetVectorVtf0.asm
> index 7538192876..fe5bbea803 100644
> --- a/UefiCpuPkg/ResetVector/Vtf0/Ia16/ResetVectorVtf0.asm
> +++ b/UefiCpuPkg/ResetVector/Vtf0/Ia16/ResetVectorVtf0.asm
> @@ -21,7 +21,15 @@ ALIGN   16
>  ; located just below 0x1 (4GB) in the firmware device.
> 
>  ;
> 
>  %ifdef ALIGN_TOP_TO_4K_FOR_PAGING
> 
> -TIMES (0x1000 - ($ - EndOfPageTables) - 0x20) DB 0
> 
> +TIMES (0x1000 - ($ - EndOfPageTables)) DB 0
> 
> +;
> 
> +; Pad the VTF0 Reset code for Bsp & Ap to 4k aligned block.
> 
> +; Some implementations may need to keep the initial Reset code
> 
> +; to be separated out from rest of the code.
> 
> +; This padding will make sure lower 4K region below 4 GB may
> 
> +; only contains few jmp instructions and data.
> 
> +;
> 
> +TIMES (0x1000 - 0x20) DB 0
> 
>  %endif
> 
> 
> 
>  applicationProcessorEntryPoint:
> 
> --
> 2.30.2.windows.1



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




Re: [edk2-devel] [edk2-stable202211] [PATCH v3 1/1] CryptoPkg: Sha1 functions causing build errors

2022-11-07 Thread Yao, Jiewen
Thank you.

Merged https://github.com/tianocore/edk2/pull/3612

> -Original Message-
> From: Kinney, Michael D 
> Sent: Tuesday, November 8, 2022 9:58 AM
> To: devel@edk2.groups.io; Yao, Jiewen ; Vang,
> Judah ; Kinney, Michael D
> 
> Cc: Wang, Jian J ; Xiaoyu Lu
> ; Jiang, Guomin ; Mistry,
> Nishant C 
> Subject: RE: [edk2-stable202211] [PATCH v3 1/1] CryptoPkg: Sha1
> functions causing build errors
> 
> I agree.
> 
> Mike
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Yao,
> Jiewen
> > Sent: Monday, November 7, 2022 5:26 PM
> > To: Vang, Judah ; devel@edk2.groups.io
> > Cc: Wang, Jian J ; Xiaoyu Lu
> ; Jiang, Guomin ; Mistry,
> > Nishant C 
> > Subject: [edk2-devel] [edk2-stable202211] [PATCH v3 1/1] CryptoPkg:
> Sha1 functions causing build errors
> >
> > Hello
> > I suggest we add this to edk2-stable202211, since this is an important
> bug fix.
> >
> > The V1 and V2 patch are sent before soft freeze.
> > V3 patch splits V2.
> >
> >
> > Thank you
> > Yao Jiewen
> >
> >
> > > -Original Message-
> > > From: Vang, Judah 
> > > Sent: Tuesday, November 8, 2022 4:02 AM
> > > To: devel@edk2.groups.io
> > > Cc: Yao, Jiewen ; Wang, Jian J
> > > ; Xiaoyu Lu ; Jiang,
> Guomin
> > > ; Mistry, Nishant C
> 
> > > Subject: [PATCH v3 1/1] CryptoPkg: Sha1 functions causing build errors
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3991
> > >
> > > Fix build issue when DiSABLE_SHA1_DEPRECATED_INTERFACES
> > > is defined. Percolate the #ifndef
> DiSABLE_SHA1_DEPRECATED_INTERFACES
> > > to all the Sha1 functions.
> > >
> > > Cc: Jiewen Yao 
> > > Cc: Jian J Wang 
> > > Cc: Xiaoyu Lu 
> > > Cc: Guomin Jiang 
> > > Cc: Nishant C Mistry 
> > > Signed-off-by: Jian J Wang 
> > > Signed-off-by: Nishant C Mistry 
> > > Signed-off-by: Judah Vang 
> > > ---
> > >  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 14
> > > +-
> > >  1 file changed, 13 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
> > > b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
> > > index f9796b215865..ede9fa8c09ec 100644
> > > --- a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
> > > +++ b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
> > > @@ -6,7 +6,7 @@
> > >This API, when called, will calculate the Hash using the
> > >hashing algorithm specified by PcdHashApiLibPolicy.
> > >
> > > -  Copyright (c) 2020, Intel Corporation. All rights reserved.
> > > +  Copyright (c) 2020-2022, Intel Corporation. All rights reserved.
> > >SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > >  **/
> > > @@ -33,9 +33,11 @@ HashApiGetContextSize (
> > >)
> > >  {
> > >switch (PcdGet32 (PcdHashApiLibPolicy)) {
> > > + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
> > >  case HASH_ALG_SHA1:
> > >return Sha1GetContextSize ();
> > >break;
> > > + #endif
> > >
> > >  case HASH_ALG_SHA256:
> > >return Sha256GetContextSize ();
> > > @@ -75,9 +77,11 @@ HashApiInit (
> > >)
> > >  {
> > >switch (PcdGet32 (PcdHashApiLibPolicy)) {
> > > + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
> > >  case HASH_ALG_SHA1:
> > >return Sha1Init (HashContext);
> > >break;
> > > + #endif
> > >
> > >  case HASH_ALG_SHA256:
> > >return Sha256Init (HashContext);
> > > @@ -119,9 +123,11 @@ HashApiDuplicate (
> > >)
> > >  {
> > >switch (PcdGet32 (PcdHashApiLibPolicy)) {
> > > + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
> > >  case HASH_ALG_SHA1:
> > >return Sha1Duplicate (HashContext, NewHashContext);
> > >break;
> > > + #endif
> > >
> > >  case HASH_ALG_SHA256:
> > >return Sha256Duplicate (HashContext, NewHashContext);
> > > @@ -165,9 +171,11 @@ HashApiUpdate (
> > >)
> > >  {
> > >switch (PcdGet32 (PcdHashApiLibPolicy)) {
> > > + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
> > >  case HASH_ALG_SHA1:
> > >return Sha1Update (HashContext, DataToHash, DataToHashLen);
> > >break;
> > > + #endif
> > >
> > >  case HASH_ALG_SHA256:
> > >return Sha256Update (HashContext, DataToHash, DataToHashLen);
> > > @@ -209,9 +217,11 @@ HashApiFinal (
> > >)
> > >  {
> > >switch (PcdGet32 (PcdHashApiLibPolicy)) {
> > > + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
> > >  case HASH_ALG_SHA1:
> > >return Sha1Final (HashContext, Digest);
> > >break;
> > > + #endif
> > >
> > >  case HASH_ALG_SHA256:
> > >return Sha256Final (HashContext, Digest);
> > > @@ -255,9 +265,11 @@ HashApiHashAll (
> > >)
> > >  {
> > >switch (PcdGet32 (PcdHashApiLibPolicy)) {
> > > + #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
> > >  case HASH_ALG_SHA1:
> > >return Sha1HashAll (DataToHash, DataToHashLen, Digest);
> > >break;
> > > + #endif
> > >
> > >  case HASH_ALG_SHA256:
> > >return Sha256HashAll (DataToHash, DataToHashLen, Digest);
> > > --
> > > 2.35.1.windows.

[edk2-devel] Access 64bit address space in 32bit mode

2022-11-07 Thread Yoshinoya
Hello
Is it possible to access 64bit address space in 32bit mode?


For example, opcode prefix 0x66/67 could let code running in 16bit mode to 
access 32bit data/address.


Or, establishing page table is a must requirement for accessing 64bit address 
space.


Thanks
 

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




回复: [edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, November 8, 2022 #cal-reminder

2022-11-07 Thread gaoliming via groups.io
Few new issues are submitted. Let’s cancel this week meeting. 

 

Thanks

Liming

发件人: devel@edk2.groups.io  代表 Group Notification
发送时间: 2022年11月8日 10:30
收件人: devel@edk2.groups.io
主题: [edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, November 
8, 2022 #cal-reminder

 

Reminder: TianoCore Bug Triage - APAC / NAMO 

When:
Tuesday, November 8, 2022
6:30pm to 7:30pm
(UTC-08:00) America/Los Angeles 

Where:
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d
 

Organizer: Liming Gao gaolim...@byosoft.com.cn 

  

View Event  

Description:

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao

 


 

Microsoft Teams meeting 

Join on your computer or mobile app 

 

 Click here to join the meeting 

Join with a video conferencing device 

te...@conf.intel.com   

Video Conference ID: 116 062 094 0 

 

 Alternate VTC dialing instructions 

Or call in (audio only) 

  +1 916-245-6934,,77463821#   United States, 
Sacramento 

Phone Conference ID: 774 638 21# 

 

 Find a local number |   Reset 
PIN 

  Learn More |  

 Meeting options 





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




[edk2-devel] 回复: [Patch V2 1/7] MdePkg/Include: Update Base.h to improve C++ compatibility

2022-11-07 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: Michael D Kinney 
> 发送时间: 2022年11月5日 4:25
> 收件人: devel@edk2.groups.io
> 抄送: Liming Gao ; Zhiguang Liu
> 
> 主题: [Patch V2 1/7] MdePkg/Include: Update Base.h to improve C++
> compatibility
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4134
> 
> * Map NULL to nullptr or __null when c++ compiler is used.
> * Map STATIC_ASSERT to static_assert when a c++ compiler is used.
> * Typecast RETURN_SUCCESS to type RETURN_STATUS to match type used
>   by all return error/warning status codes.  C++ has stricter type
>   checking and found this inconsistency.
> 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Signed-off-by: Michael D Kinney 
> ---
>  MdePkg/Include/Base.h | 12 ++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
> index d19ddfe4bba7..d209e6de280a 100644
> --- a/MdePkg/Include/Base.h
> +++ b/MdePkg/Include/Base.h
> @@ -309,7 +309,15 @@ struct _LIST_ENTRY {
>  ///
>  /// NULL pointer (VOID *)
>  ///
> +#if defined (__cplusplus)
> +  #if defined (_MSC_EXTENSIONS)
> +#define NULL  nullptr
> +  #else
> +#define NULL  __null
> +  #endif
> +#else
>  #define NULL  ((VOID *) 0)
> +#endif
> 
>  //
>  // Null character
> @@ -760,7 +768,7 @@ typedef UINTN *BASE_LIST;
>  **/
>  #ifdef MDE_CPU_EBC
>  #define STATIC_ASSERT(Expression, Message)
> -#elif defined (_MSC_EXTENSIONS)
> +#elif defined (_MSC_EXTENSIONS) || defined (__cplusplus)
>  #define STATIC_ASSERT  static_assert
>  #else
>  #define STATIC_ASSERT  _Static_assert
> @@ -959,7 +967,7 @@ typedef UINTN RETURN_STATUS;
>  ///
>  /// The operation completed successfully.
>  ///
> -#define RETURN_SUCCESS  0
> +#define RETURN_SUCCESS  (RETURN_STATUS)(0)
> 
>  ///
>  /// The image failed to load.
> --
> 2.37.1.windows.1





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




[edk2-devel] 回复: [Patch V2 2/7] MdePkg/Include/Library: Undefine _ASSERT() if already defined

2022-11-07 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: Michael D Kinney 
> 发送时间: 2022年11月5日 4:25
> 收件人: devel@edk2.groups.io
> 抄送: Liming Gao ; Zhiguang Liu
> 
> 主题: [Patch V2 2/7] MdePkg/Include/Library: Undefine _ASSERT() if already
> defined
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4134
> 
> When unit testing is enabled, make sure _ASSERT() is not already
> defined by the host environment before defining _ASSERT().  This
> avoids conflicts with VS20xx builds of GoogleTest based unit tests.
> 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Signed-off-by: Michael D Kinney 
> ---
>  MdePkg/Include/Library/DebugLib.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/MdePkg/Include/Library/DebugLib.h
> b/MdePkg/Include/Library/DebugLib.h
> index 8d3d08638d73..9110be2f41b3 100644
> --- a/MdePkg/Include/Library/DebugLib.h
> +++ b/MdePkg/Include/Library/DebugLib.h
> @@ -337,6 +337,9 @@ UnitTestDebugAssert (
>IN CONST CHAR8  *Description
>);
> 
> +  #if defined (_ASSERT)
> +#undef _ASSERT
> +  #endif
>#if defined (__clang__) && defined (__FILE_NAME__)
>  #define _ASSERT(Expression)  UnitTestDebugAssert (__FILE_NAME__,
> DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
>#else
> --
> 2.37.1.windows.1





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




回复: [edk2-devel] [Patch V2 7/7] MdePkg/Test: Add port of BaseSafeIntLib unit tests to GoogleTest

2022-11-07 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Michael D
> Kinney
> 发送时间: 2022年11月5日 4:25
> 收件人: devel@edk2.groups.io
> 抄送: Liming Gao ; Zhiguang Liu
> 
> 主题: [edk2-devel] [Patch V2 7/7] MdePkg/Test: Add port of BaseSafeIntLib
> unit tests to GoogleTest
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4134
> 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Signed-off-by: Michael D Kinney 
> ---
>  .../GoogleTestBaseSafeIntLib.inf  |   37 +
>  .../GoogleTestBaseSafeIntLib.uni  |   13 +
>  .../SafeIntLibUintnIntnUnitTests32.cpp|  425 +++
>  .../SafeIntLibUintnIntnUnitTests64.cpp|  429 
>  .../BaseSafeIntLib/TestBaseSafeIntLib.cpp | 2274
> +
>  MdePkg/Test/MdePkgHostTest.dsc|1 +
>  6 files changed, 3179 insertions(+)
>  create mode 100644
> MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/GoogleTestBaseSafeIntLib.i
> nf
>  create mode 100644
> MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/GoogleTestBaseSafeIntLib.u
> ni
>  create mode 100644
> MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnitTest
> s32.cpp
>  create mode 100644
> MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnitTest
> s64.cpp
>  create mode 100644
> MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/TestBaseSafeIntLib.cpp
> 
> diff --git
> a/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/GoogleTestBaseSafeIntLib
> .inf
> b/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/GoogleTestBaseSafeIntLib
> .inf
> new file mode 100644
> index ..f609bfa57f7b
> --- /dev/null
> +++
> b/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/GoogleTestBaseSafeIntLib
> .inf
> @@ -0,0 +1,37 @@
> +## @file
> +# Host OS based Application that Unit Tests the SafeIntLib using Google
Test
> +#
> +# Copyright (c) 2022, Intel Corporation. All rights reserved.
> +# SPDX-License-Identifier: BSD-2-Clause-Patent
> +##
> +
> +[Defines]
> +  INF_VERSION = 0x00010005
> +  BASE_NAME   = GoogleTestBaseSafeIntLib
> +  MODULE_UNI_FILE = GoogleTestBaseSafeIntLib.uni
> +  FILE_GUID   = 2D9C1796-B0D2-4DA7-9529-1F8D9CCC11D3
> +  MODULE_TYPE = HOST_APPLICATION
> +  VERSION_STRING  = 1.0
> +
> +#
> +# The following information is for reference only and not required by the
> build tools.
> +#
> +#  VALID_ARCHITECTURES   = IA32 X64
> +#
> +
> +[Sources]
> +  TestBaseSafeIntLib.cpp
> +
> +[Sources.IA32]
> +  SafeIntLibUintnIntnUnitTests32.cpp
> +
> +[Sources.X64]
> +  SafeIntLibUintnIntnUnitTests64.cpp
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> +
> +[LibraryClasses]
> +  GoogleTestLib
> +  SafeIntLib
> diff --git
> a/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/GoogleTestBaseSafeIntLib
> .uni
> b/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/GoogleTestBaseSafeIntLib
> .uni
> new file mode 100644
> index ..1c11b9e05205
> --- /dev/null
> +++
> b/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/GoogleTestBaseSafeIntLib
> .uni
> @@ -0,0 +1,13 @@
> +// /** @file
> +// Application that Unit Tests the SafeIntLib using Google Test
> +//
> +// Copyright (c) 2020, Intel Corporation. All rights reserved.
> +//
> +// SPDX-License-Identifier: BSD-2-Clause-Patent
> +//
> +// **/
> +
> +#string STR_MODULE_ABSTRACT #language en-US
> "Application that Unit Tests the SafeIntLib using Google Test"
> +
> +#string STR_MODULE_DESCRIPTION  #language en-US
> "Application that Unit Tests the SafeIntLib using Google Test."
> +
> diff --git
> a/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnitT
> ests32.cpp
> b/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnitT
> ests32.cpp
> new file mode 100644
> index ..6fbf302c1c5e
> --- /dev/null
> +++
> b/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnitT
> ests32.cpp
> @@ -0,0 +1,425 @@
> +/** @file
> +  IA32-specific functions for unit-testing INTN and UINTN functions in
> +  SafeIntLib.
> +
> +  Copyright (c) Microsoft Corporation.
> +  Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +extern "C" {
> +  #include 
> +  #include 
> +}
> +
> +TEST(ConversionTestSuite, TestSafeInt32ToUintn) {
> +  RETURN_STATUS  Status;
> +  INT32   Operand;
> +  UINTN   Result;
> +
> +  //
> +  // If Operand is non-negative, then it's a cast
> +  //
> +  Operand = 0x5bababab;
> +  Result  = 0;
> +  Status  = SafeInt32ToUintn (Operand, &Result);
> +  ASSERT_EQ (Status, RETURN_SUCCESS);
> +  ASSERT_EQ ((UINTN)0x5bababab, Result);
> +
> +  //
> +  // Otherwise should result in an error status
> +  //
> +  Operand = (-1537977259);
> +  Status  = SafeInt32ToUintn (Operand, &Result);
> +  ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status);
> +}
> +
> +TEST(ConversionTestSuite, TestSafeUint32ToIntn) {
> +  RETURN_STATUS  Status;
> +  UINT32  Operand;
> +  INTNResult;
> +
> 

回复: [edk2-devel] 回复: [Patch 1/1] BaseTools/Source/C: Use /Z7 instead of /Zi for host tools

2022-11-07 Thread gaoliming via groups.io
Mike: 
  I submit https://bugzilla.tianocore.org/show_bug.cgi?id=4145 to remove debug 
symbol in the C tools generation. 

  I am OK to merge current change first. Reviewed-by: Liming Gao 


Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Michael D
> Kinney
> 发送时间: 2022年11月8日 10:00
> 收件人: devel@edk2.groups.io; Gao, Liming ;
> Kinney, Michael D 
> 抄送: Feng, Bob C ; Chen, Christine
> 
> 主题: Re: [edk2-devel] 回复: [Patch 1/1] BaseTools/Source/C: Use /Z7
> instead of /Zi for host tools
> 
> Hi Liming,
> 
> I think a BZ feature request for BaseTools to support building with or without
> symbols would be good to submit for future stable tag.
> 
> I would like to see this patch be added to the current stable tag.
> 
> Thanks,
> 
> Mike
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of
> gaoliming via groups.io
> > Sent: Monday, November 7, 2022 5:04 PM
> > To: devel@edk2.groups.io; Kinney, Michael D
> 
> > Cc: Feng, Bob C ; Chen, Christine
> 
> > Subject: 回复: [edk2-devel] 回复: [Patch 1/1] BaseTools/Source/C: Use
> /Z7 instead of /Zi for host tools
> >
> > Mike:
> >  I agree there is no impact with debug symbol in the binary C tools.
> >
> >  But, the release version binary C tools should be better for the developer.
> If you think this change is big, I will submit one
> > BZ for future stable tag release.
> >
> > Thanks
> > Liming
> > > -邮件原件-
> > > 发件人: devel@edk2.groups.io  代表 Michael
> D
> > > Kinney
> > > 发送时间: 2022年11月7日 15:21
> > > 收件人: devel@edk2.groups.io; Gao, Liming
> ;
> > > Kinney, Michael D 
> > > 抄送: Feng, Bob C ; Chen, Christine
> > > 
> > > 主题: Re: [edk2-devel] 回复: [Patch 1/1] BaseTools/Source/C: Use /Z7
> > > instead of /Zi for host tools
> > >
> > > Hi Liming,
> > >
> > > That seems like a bigger change.
> > >
> > > I see no harm in always producing symbols when build C host tools.
> > >
> > > Mike
> > >
> > > > -Original Message-
> > > > From: devel@edk2.groups.io  On Behalf Of
> > > gaoliming via groups.io
> > > > Sent: Sunday, November 6, 2022 8:23 PM
> > > > To: Kinney, Michael D ;
> > > devel@edk2.groups.io
> > > > Cc: Feng, Bob C ; Chen, Christine
> > > 
> > > > Subject: [edk2-devel] 回复: [Patch 1/1] BaseTools/Source/C: Use /Z7
> > > instead of /Zi for host tools
> > > >
> > > > Mike:
> > > >   I suggest to remove /Zi and /DEBUG option for BaseTools C tool
> > > generation,
> > > > because only tool developer may require the debug version C tool.
> > > >
> > > > Thanks
> > > > Liming
> > > > > -邮件原件-
> > > > > 发件人: Michael D Kinney 
> > > > > 发送时间: 2022年11月6日 4:36
> > > > > 收件人: devel@edk2.groups.io
> > > > > 抄送: Bob Feng ; Liming Gao
> > > > > ; Yuwei Chen 
> > > > > 主题: [Patch 1/1] BaseTools/Source/C: Use /Z7 instead of /Zi for host
> > > > tools
> > > > >
> > > > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4139
> > > > >
> > > > > Update ms.common and *.mak files to use /Z7 instead of /Zi to embed
> > > > > symbol information in obj files for host tools built with VS 
> > > > > compilers.
> > > > > This prevents vcxxx.pdb files from being generated in the root of
> > > > > the local edk2 repository or in BaseTools directories.
> > > > >
> > > > > Cc: Bob Feng 
> > > > > Cc: Liming Gao 
> > > > > Cc: Yuwei Chen 
> > > > > Signed-off-by: Michael D Kinney 
> > > > > ---
> > > > >  BaseTools/Source/C/Makefiles/ms.common | 5
> > > ++---
> > > > >  BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak | 4 ++--
> > > > >  BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrMS.mak  | 6
> +++---
> > > > >  BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgDDK.mak | 4
> ++--
> > > > >  BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgMS.mak  | 7
> > > +++
> > > > >  5 files changed, 12 insertions(+), 14 deletions(-)
> > > > >
> > > > > diff --git a/BaseTools/Source/C/Makefiles/ms.common
> > > > > b/BaseTools/Source/C/Makefiles/ms.common
> > > > > index b2dbcf376c04..8391f10d5dd2 100644
> > > > > --- a/BaseTools/Source/C/Makefiles/ms.common
> > > > > +++ b/BaseTools/Source/C/Makefiles/ms.common
> > > > > @@ -57,6 +57,5 @@ LINKER = $(LD)
> > > > >
> > > > >  INC = $(INC) -I . -I $(SOURCE_PATH)\Include -I $(ARCH_INCLUDE) -I
> > > > > $(SOURCE_PATH)\Common
> > > > >
> > > > > -CFLAGS = $(CFLAGS) /nologo /Zi /c /O2 /MT /W4 /WX /D
> > > > > _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
> > > > > -CPPFLAGS = $(CPPFLAGS) /EHsc /nologo /Zi /c /O2 /MT /D
> > > > > _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
> > > > > -
> > > > > +CFLAGS = $(CFLAGS) /nologo /Z7 /c /O2 /MT /W4 /WX /D
> > > > > _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
> > > > > +CPPFLAGS = $(CPPFLAGS) /EHsc /nologo /Z7 /c /O2 /MT /D
> > > > > _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
> > > > > diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak
> > > > > b/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak
> > > > > index 71b7c6b0b141..cde91a47159e 100644
> > > > > --- a/BaseTools/Source/C/VfrCompi

回复: [edk2-devel] [Patch V2 3/7] UnitTestFrameworkPkg: Add googletest submodule and GoogleTestLib

2022-11-07 Thread gaoliming via groups.io
Mike:
  For new submodule, I think it is also required to be mentioned in License
Details section in Edk2\ReadMe.rst

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Michael D
> Kinney
> 发送时间: 2022年11月5日 4:25
> 收件人: devel@edk2.groups.io
> 抄送: Michael Kubacki ; Sean Brogan
> 
> 主题: [edk2-devel] [Patch V2 3/7] UnitTestFrameworkPkg: Add googletest
> submodule and GoogleTestLib
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4134
> 
> Add submodule for googletest and add GoogleTestLib that is
> required for GoogleTest based unit tests. Add GoogleTest
> documentation to Readme.md along with a port of the sample
> unit test to the GoogleTest style.
> 
> Cc: Michael Kubacki 
> Cc: Sean Brogan 
> Signed-off-by: Michael D Kinney 
> Reviewed-by: Michael Kubacki 
> ---
>  .gitmodules   |   3 +
>  .../Include/Library/GoogleTestLib.h   |  14 +
>  .../Library/GoogleTestLib/GoogleTestLib.inf   |  36 +++
>  .../Library/GoogleTestLib/GoogleTestLib.uni   |  14 +
>  .../Library/GoogleTestLib/googletest  |   1 +
>  UnitTestFrameworkPkg/ReadMe.md| 255
> +++--
>  .../SampleGoogleTest/SampleGoogleTest.cpp | 263
> ++
>  .../SampleGoogleTest/SampleGoogleTestHost.inf |  35 +++
>  .../Test/UnitTestFrameworkPkgHostTest.dsc |   4 +-
>  .../UnitTestFrameworkPkg.ci.yaml  |   4 +-
>  UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec |   8 +
>  .../UnitTestFrameworkPkgHost.dsc.inc  |   4 +-
>  12 files changed, 610 insertions(+), 31 deletions(-)
>  create mode 100644
> UnitTestFrameworkPkg/Include/Library/GoogleTestLib.h
>  create mode 100644
> UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf
>  create mode 100644
> UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.uni
>  create mode 16
> UnitTestFrameworkPkg/Library/GoogleTestLib/googletest
>  create mode 100644
> UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoogleTest/SampleG
> oogleTest.cpp
>  create mode 100644
> UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoogleTest/SampleG
> oogleTestHost.inf
> 
> diff --git a/.gitmodules b/.gitmodules
> index b845c9ee3ff0..8011a88d9d25 100644
> --- a/.gitmodules
> +++ b/.gitmodules
> @@ -20,3 +20,6 @@
>  [submodule "RedfishPkg/Library/JsonLib/jansson"]
>   path = RedfishPkg/Library/JsonLib/jansson
>   url = https://github.com/akheron/jansson
> +[submodule "UnitTestFrameworkPkg/Library/GoogleTestLib/googletest"]
> + path = UnitTestFrameworkPkg/Library/GoogleTestLib/googletest
> + url = https://github.com/google/googletest.git
> diff --git a/UnitTestFrameworkPkg/Include/Library/GoogleTestLib.h
> b/UnitTestFrameworkPkg/Include/Library/GoogleTestLib.h
> new file mode 100644
> index ..ebec766d4cf7
> --- /dev/null
> +++ b/UnitTestFrameworkPkg/Include/Library/GoogleTestLib.h
> @@ -0,0 +1,14 @@
> +/** @file
> +  GoogleTestLib class with APIs from the googletest project
> +
> +  Copyright (c) 2022, Intel Corporation. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef GOOGLE_TEST_LIB_H_
> +#define GOOGLE_TEST_LIB_H_
> +
> +#include 
> +
> +#endif
> diff --git a/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf
> b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf
> new file mode 100644
> index ..68db75d7023f
> --- /dev/null
> +++ b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf
> @@ -0,0 +1,36 @@
> +## @file
> +#  This module provides GoogleTest Library implementation.
> +#
> +#  Copyright (c) 2022, Intel Corporation. All rights reserved.
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION = 0x00010005
> +  BASE_NAME   = GoogleTestLib
> +  MODULE_UNI_FILE = GoogleTestLib.uni
> +  FILE_GUID   = A90E4751-AD30-43CC-980B-01E356B49ADF
> +  MODULE_TYPE = BASE
> +  VERSION_STRING  = 0.1
> +  LIBRARY_CLASS   = GoogleTestLib|HOST_APPLICATION
> +
> +#
> +#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
> +#
> +
> +[Sources]
> +  googletest/googletest/src/gtest-all.cc
> +
> +[Packages]
> +  UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> +
> +[BuildOptions]
> +  MSFT:*_*_*_CC_FLAGS == /c /EHsc /Zi
> +  MSFT:NOOPT_*_*_CC_FLAGS =  /Od
> +
> +  GCC:*_*_*_CC_FLAGS == -g -c
> +
> +  GCC:NOOPT_*_*_CC_FLAGS =  -O0
> +  GCC:*_*_IA32_CC_FLAGS  =  -m32
> +  GCC:*_*_X64_CC_FLAGS   =  -m64
> diff --git a/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.uni
> b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.uni
> new file mode 100644
> index ..14c862a23744
> --- /dev/null
> +++ b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.uni
> @@ -0,0 +1,14 @@
> +// /** @file
> +// This module provides GoogleTest Library implementation.
> +//
> +// This module provides GoogleTest Library implementation.
> +//
> +// Copyright (c) 2022, Intel Corporation. All rights reserved.
> +//
> +// SPDX