Re: [edk2-devel] [PATCH 1/1] ShellPkg/SmbiosView: Update display of PCIe system slot ID

2023-08-29 Thread Gao, Zhichao
Already add me push tag. Once it pass the CI, it would be merged.

Thanks,
Zhichao

> -Original Message-
> From: Nhi Pham 
> Sent: Tuesday, August 29, 2023 10:36 AM
> To: Gao, Zhichao ; Nhi Pham
> ; devel@edk2.groups.io
> Subject: Re: [PATCH 1/1] ShellPkg/SmbiosView: Update display of PCIe
> system slot ID
> 
> Thanks Zhichao, I updated the commit message and also created a PR at
> https://github.com/tianocore/edk2/pull/4767
> 
> Please help check.
> 
> Regards,
> 
> -Nhi
> 
> On 8/21/2023 2:01 PM, Gao, Zhichao wrote:
> > Better to update the commit message with specific SMBIOS version.
> > Others looks good to me.
> >
> > Thanks,
> > Zhichao
> >
> >> -Original Message-
> >> From: Nhi Pham 
> >> Sent: Friday, August 18, 2023 2:54 PM
> >> To: devel@edk2.groups.io
> >> Cc: Nhi Pham ; Gao, Zhichao
> >> 
> >> Subject: [PATCH 1/1] ShellPkg/SmbiosView: Update display of PCIe
> >> system slot ID
> >>
> >> This updates the system slot ID up to SlotTypePCIExpressGen6andBeyond
> >> (0xC4) to cover modern PCIe Gen.
> >>
> >> Cc: Zhichao Gao 
> >> Signed-off-by: Nhi Pham 
> >> ---
> >>   ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> >> | 2
> >> +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git
> >>
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> >>
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> >> index f55d5f953c04..b6968cb36acb 100644
> >> ---
> >>
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> >> +++
> >>
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> >> @@ -3105,7 +3105,7 @@ DisplaySystemSlotId (
> >> break;
> >>
> >>
> >>
> >>   default:
> >>
> >> -  if (((SlotType >= 0x0E) && (SlotType <= 0x12)) || ((SlotType >= 
> >> 0xA6)
> &&
> >> (SlotType <= 0xB6))) {
> >>
> >> +  if (((SlotType >= 0x0E) && (SlotType <= 0x12)) || ((SlotType
> >> + >= 0xA6) &&
> >> (SlotType <= 0xC4))) {
> >>
> >>   ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
> >> (STR_SMBIOSVIEW_PRINTINFO_VALUE_PRESENT), gShellDebug1HiiHandle,
> >> SlotId);
> >>
> >> } else {
> >>
> >>   ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
> >> (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_SLOT_ID),
> >> gShellDebug1HiiHandle);
> >>
> >> --
> >> 2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108114): https://edk2.groups.io/g/devel/message/108114
Mute This Topic: https://groups.io/mt/100816049/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] SecurityPkg/Tpm2DeviceLibTcg2: Make mTcg2Protocol static

2023-08-29 Thread Yao, Jiewen
Merged https://github.com/tianocore/edk2/pull/4770

> -Original Message-
> From: Michael Kubacki 
> Sent: Wednesday, August 30, 2023 7:14 AM
> To: devel@edk2.groups.io; Yao, Jiewen ; Wang, Jian J
> 
> Subject: Re: [edk2-devel] [PATCH v1 1/1] SecurityPkg/Tpm2DeviceLibTcg2: Make
> mTcg2Protocol static
> 
> Hello,
> 
> Can you please help review this change when you get a chance?
> 
> Thanks,
> Michael
> 
> On 8/15/2023 11:50 AM, Michael Kubacki wrote:
> > From: Michael Kubacki 
> >
> > The global variable has a common name that can conflict with other
> > TCG modules. For example, Tcg2Dxe has a similarly named global that
> > is of type EFI_TCG2_PROTOCOL instead of EFI_TCG2_PROTOCOL*.
> >
> > Cc: Jiewen Yao 
> > Cc: Jian J Wang 
> > Signed-off-by: Michael Kubacki 
> > ---
> >   SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c
> b/SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c
> > index 3c8cf4fa117a..c792b1d67b06 100644
> > --- a/SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c
> > +++ b/SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c
> > @@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> >   #include 
> >   #include 
> >
> > -EFI_TCG2_PROTOCOL  *mTcg2Protocol = NULL;
> > +STATIC  EFI_TCG2_PROTOCOL  *mTcg2Protocol = NULL;
> >
> >   /**
> > This service enables the sending of commands to the TPM2.


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




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Socket completion functions are not called on Linux Compilation

2023-08-29 Thread Jayaprakash, N


Reviewed-by: Jayaprakash N  

Regards,
JP
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Jayaprakash, N
Sent: Monday, August 28, 2023 4:01 PM
To: devel@edk2.groups.io
Cc: Jayaprakash, N ; Rebecca Cran ; 
Kinney, Michael D ; Kloper, Dimitry 

Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Socket completion 
functions are not called on Linux Compilation

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

>From the bug description:
Analysis and root cause


After some investigation and debugging I have figured out the following:

The following function is implemented in file  edk2/StdLib/EfiSocketLib/Tcp4.c

VOID
EslTcp4ListenComplete (
  IN EFI_EVENT Event,
  IN ESL_PORT * pPort
);

The function is used in EslTcp4Listen() as a callback for connection 
notification event, it is created by the following code:

Status = gBS->CreateEvent ( EVT_NOTIFY_SIGNAL,
TPL_SOCKETS,
(EFI_EVENT_NOTIFY)EslTcp4ListenComplete,
pPort,
&pTcp4->ListenToken.CompletionToken.Event );

And this is actually introduces a bug: the CreateEvent() third parameter is of 
type EFI_EVENT_NOTIFY which is defined as

typedef
VOID
(EFIAPI *EFI_EVENT_NOTIFY) (
   IN EFI_EVENT Event,
   IN VOID *Context
);

That EFIAPI tag is important since it defines an ABI that is used by compiler 
in order to call the callback function. Note that EslTcp4ListenComplete() is 
not marked as EFIAPI.

Thus, on Linux, where gcc defaults to SYSV ABI, there will be mismatch between 
arguments passed to EslTcp4ListenComplete() by the event dispatcher. It expects 
function with WIN64 ABI, while its code compiled with default SYSV ABI. It will 
look in wrong registers for arguments.

Specifically pPort pointer references an wrong memory location. Luckily
EslTcp4ListenComplete() performs sanity check of the pPort structure and 
discovers that it is invalid. This causes discarding of all incoming 
connections.

Proposed fix
---

The fix is trivial - mark EslTcp4ListenComplete() as EFIAPI. This is a little 
more complicated, since there are additional callback functions that suffer 
from the same problem. In addition fixing those causes some compiler warnings 
that shall be addressed. Attached patch fixes the problem for me.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Dimitry Kloper 
---
 StdLib/EfiSocketLib/Ip4.c| 11 +++
 StdLib/EfiSocketLib/Socket.c |  5 +++--  StdLib/EfiSocketLib/Socket.h | 12 
++--
 StdLib/EfiSocketLib/Tcp4.c   | 35 ---
 StdLib/EfiSocketLib/Tcp6.c   | 35 ---
 StdLib/EfiSocketLib/Udp4.c   | 10 ++
 StdLib/EfiSocketLib/Udp6.c   | 10 ++
 7 files changed, 68 insertions(+), 50 deletions(-)

diff --git a/StdLib/EfiSocketLib/Ip4.c b/StdLib/EfiSocketLib/Ip4.c index 
4b8f05b..8d25537 100644
--- a/StdLib/EfiSocketLib/Ip4.c
+++ b/StdLib/EfiSocketLib/Ip4.c
@@ -588,16 +588,17 @@ EslIp4RemoteAddressSet (
   @param [in] pIo   The address of an ::ESL_IO_MGMT structure
 
 **/
-VOID
+VOID EFIAPI
 EslIp4RxComplete (
   IN EFI_EVENT Event,
-  IN ESL_IO_MGMT * pIo
+  IN VOID *context
   )
 {
   size_t LengthInBytes;
   ESL_PACKET * pPacket;
   EFI_IP4_RECEIVE_DATA * pRxData;
   EFI_STATUS Status;
+  ESL_IO_MGMT * pIo = (ESL_IO_MGMT *)context;
 
   DBG_ENTER ( );
 
@@ -1117,10 +1118,10 @@ EslIp4TxBuffer (
   @param [in] pIo   The address of an ::ESL_IO_MGMT structure
 
 **/
-VOID
+VOID EFIAPI
 EslIp4TxComplete (
   IN EFI_EVENT Event,
-  IN ESL_IO_MGMT * pIo
+  IN VOID *context
   )
 {
   UINT32 LengthInBytes;
@@ -1128,6 +1129,7 @@ EslIp4TxComplete (
   ESL_PACKET * pPacket;
   ESL_SOCKET * pSocket;
   EFI_STATUS Status;
+  ESL_IO_MGMT * pIo = (ESL_IO_MGMT*)context;
 
   DBG_ENTER ( );
 
@@ -1341,6 +1343,7 @@ CONST ESL_PROTOCOL_API cEslIp4Api = {
   OFFSET_OF ( ESL_PORT, Context.Ip4.ModeData.ConfigData ),
   OFFSET_OF ( ESL_LAYER, pIp4List ),
   OFFSET_OF ( struct sockaddr_in, sin_zero ),
+
   sizeof ( struct sockaddr_in ),
   AF_INET,
   sizeof (((ESL_PACKET *)0 )->Op.Ip4Rx ), diff --git 
a/StdLib/EfiSocketLib/Socket.c b/StdLib/EfiSocketLib/Socket.c index 
59b8efa..ee15b62 100644
--- a/StdLib/EfiSocketLib/Socket.c
+++ b/StdLib/EfiSocketLib/Socket.c
@@ -3970,14 +3970,15 @@ EslSocketPortClose (
   @param[in]  Event The close completion event
   @param[in]  pPort Address of an ::ESL_PORT structure.
 **/
-VOID
+VOID EFIAPI
 EslSocketPortCloseComplete (
   IN EFI_EVENT Event,
-  IN ESL_PORT * pPort
+  IN VOID *context
   )
 {
   ESL_IO_MGMT * pIo;
   EFI_STATUS Status;
+  ESL_PORT * pPort = (ESL_PORT*) context;
 
   DBG_ENTER ( );
   VERIFY_AT_TPL ( TPL_SOCKETS );
diff --git a/StdLib/EfiSocketLib/Socket.h b/StdLib/EfiSocketLib/Socket.h index 
d7d55e6..81d3b2c 100644
--- a/StdLib/EfiSocketLib/Socket.h
+++ b/StdLib/EfiSocketLib/Socket.h
@@ -591,9 +591,9

Re: [edk2-devel] [PATCH 0/2] MdeModulePkg: small improvements to UsbNetwork

2023-08-29 Thread RichardHo [何明忠] via groups . io
Hi Rebecca,

We have tried the patch. It works on my device.
I think it could be add it into UsbNetwork source. Do you think?

Thanks,
Richard
-Original Message-
From: Mike Maslenkin 
Sent: 2023年8月26日 9:58 AM
To: devel@edk2.groups.io
Cc: Richard Ho (何明忠) ; rebe...@bsdio.com; Mike Maslenkin 

Subject: [EXTERNAL] [PATCH 0/2] MdeModulePkg: small improvements to UsbNetwork


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

Please review small improvements to UsbNetwork

Here is corresponding PR https://github.com/tianocore/edk2/pull/4762

Cc: Richard Ho 
Cc: Rebecca Cran 
Signed-off-by: Mike Maslenkin 

-The information contained in this message may be confidential and proprietary 
to American Megatrends (AMI). This communication is intended to be read only by 
the individual or entity to whom it is addressed or by their designee. If the 
reader of this message is not the intended recipient, you are on notice that 
any distribution of this message, in any form, is strictly prohibited. Please 
promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and 
then delete or destroy all copies of the transmission.


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




Re: [edk2-devel] [PATCH v2 6/6] RedfishClientPkg: spelling fixes

2023-08-29 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Tuesday, August 29, 2023 4:01 PM
> To: devel@edk2.groups.io
> Cc: abner.ch...@amd.com; Nickle Wang ;
> ig...@ami.com; Mike Maslenkin 
> Subject: [PATCH v2 6/6] RedfishClientPkg: spelling fixes
> 
> External email: Use caution opening links or attachments
> 
> 
> Signed-off-by: Mike Maslenkin 
> ---
>  RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c   | 4 ++--
>  .../ComputerSystemCollectionDxe.c   | 6 +++---
>  .../Features/MemoryCollectionDxe/MemoryCollectionDxe.c  | 6 +++---
>  3 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> index a1738de46fdf..a969557ddfdb 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> @@ -831,7 +831,7 @@ HandleResource (
>DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));
> 
>Status = EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);
> 
>if (EFI_ERROR (Status)) {
> 
> -DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n",
> __func__, Uri, Status));
> 
> +DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n",
> __func__, Uri, Status));
> 
>}
> 
> 
> 
>//
> 
> @@ -840,7 +840,7 @@ HandleResource (
>DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
> 
>Status = EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);
> 
>if (EFI_ERROR (Status)) {
> 
> -DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n",
> __func__, Uri, Status));
> 
> +DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n",
> __func__, Uri, Status));
> 
>}
> 
> 
> 
>return Status;
> 
> diff --git
> a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCo
> llectionDxe.c
> b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCo
> llectionDxe.c
> index 8f2054e1e161..1e362d49cbb6 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCo
> llectionDxe.c
> +++
> b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCo
> llectionDxe.c
> @@ -109,7 +109,7 @@ HandleResource (
>DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));
> 
>Status = EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);
> 
>if (EFI_ERROR (Status)) {
> 
> -DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n",
> __func__, Uri, Status));
> 
> +DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n",
> __func__, Uri, Status));
> 
>}
> 
> 
> 
>//
> 
> @@ -118,7 +118,7 @@ HandleResource (
>DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
> 
>Status = EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);
> 
>if (EFI_ERROR (Status)) {
> 
> -DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n",
> __func__, Uri, Status));
> 
> +DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n",
> __func__, Uri, Status));
> 
>}
> 
> 
> 
>return Status;
> 
> @@ -228,7 +228,7 @@ CreateCollectionResource (
> 
> 
>Status = EdkIIRedfishResourceConfigProvisionging (&SchemaInfo, Private-
> >CollectionUri, Private->InformationExchange, TRUE);
> 
>if (EFI_ERROR (Status)) {
> 
> -DEBUG ((DEBUG_ERROR, "%a, failed to create resoruce for: %s: %r\n",
> __func__, Private->CollectionUri, Status));
> 
> +DEBUG ((DEBUG_ERROR, "%a, failed to create resource for: %s: %r\n",
> __func__, Private->CollectionUri, Status));
> 
>}
> 
> 
> 
>return Status;
> 
> diff --git
> a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
> b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
> index b94ff2e86572..1b755cde0130 100644
> --- a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
> +++ b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
> @@ -109,7 +109,7 @@ HandleResource (
>DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));
> 
>Status = EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);
> 
>if (EFI_ERROR (Status)) {
> 
> -DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n",
> __func__, Uri, Status));
> 
> +DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n",
> __func__, Uri, Status));
> 
>}
> 
> 
> 
>//
> 
> @@ -118,7 +118,7 @@ HandleResource (
>DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
> 
>Status = EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);
> 
>if (EFI_ERROR (Status)) {
> 
> -DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n",
> __func__, Uri, Status));
> 
> +DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n",

Re: [edk2-devel] [PATCH v2 5/6] RedfishClientPkg: fix misprints in Readme.md

2023-08-29 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Tuesday, August 29, 2023 4:01 PM
> To: devel@edk2.groups.io
> Cc: abner.ch...@amd.com; Nickle Wang ;
> ig...@ami.com; Mike Maslenkin 
> Subject: [PATCH v2 5/6] RedfishClientPkg: fix misprints in Readme.md
> 
> External email: Use caution opening links or attachments
> 
> 
> Signed-off-by: Mike Maslenkin 
> ---
>  RedfishClientPkg/Readme.md | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md
> index 18a27633cf45..0aec0580aa5c 100644
> --- a/RedfishClientPkg/Readme.md
> +++ b/RedfishClientPkg/Readme.md
> @@ -40,7 +40,7 @@ Below are the block diagrams of UEFI Redfish Client EDK2
> Implementation.
>  ![UEFI Redfish Client
> Implementation](https://nam11.safelinks.protection.outlook.com/?url=https%3A
> %2F%2Fgithub.com%2Fchangab%2Fedk2-staging%2Fblob%2Fedk2-redfish-
> client%2FRedfishClientPkg%2FDocuments%2FMedia%2FRedfishClientDriverStack
> .svg%3Fraw%3Dtrue&data=05%7C01%7Cnicklew%40nvidia.com%7Ceee05325db
> a24945583f08dba8662453%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0
> %7C638288928897098811%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C
> &sdata=DlhlqaDQub6Cd9TD7M2sP9hchqAHAigsjy7Z%2FfohSXs%3D&reserved=0)
> 
> 
> 
>  ## EFI EDK2 Redfish Client Framework
> 
> -The functionality of each block in the diagrams are described in belwo 
> sections,
> 
> +The functionality of each block in the diagrams are described in below 
> sections,
> 
> 
> 
>  ### EDK2 Redfish Foundation ***[[1]](#[0])***
> 
>  EDK2 Redfish Redfish Foundation provides the facilities of communicating with
> 
> @@ -68,7 +68,7 @@ project.
> 
> 
>  ### EDK2 Redfish JSON Schema to C Structure Convertor ***[[3]](#[0])***
> 
>  This is the script auto-generated EDK2 drivers and libraries that provide the
> 
> -Redfish schema naming based JSON to C structure and vise versa converters. C
> 
> +Redfish schema naming based JSON to C structure and vice versa converters. C
> 
>  structure is another representation of Redfish properties other than JSON and
> 
>  CSDL(XML). The higher layer Redfish client application can deal with C 
> structure
> 
>  instead of using JSON library to manipulate Redfish properties. The script
> 
> @@ -85,7 +85,7 @@ sits between **JSON Schema to C Structure converters**
> and **EFI Platform
>  Configuration to Redfish Protocol**. The Redfish feature driver gets and sets
> 
>  the platform configuration and incorporates it with Redfish JSON schema C
> 
>  structure to manipulate Redfish JSON resources. Then applies the settings 
> from
> 
> -Redfish service to platform configurations, or vise versa to update platform
> 
> +Redfish service to platform configurations, or vice versa to update platform
> 
>  configurations to Redfish service. Both EDK2 Redfish Non-Collection and
> 
>  Collection Feature drivers are script auto-generated base on Redfish schema
> 
>  naming. The EDK2 Redfish Non-Collection feature driver manages the resource 
> of
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108109): https://edk2.groups.io/g/devel/message/108109
Mute This Topic: https://groups.io/mt/101027007/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 4/6] RedfishClientPkg: fix memory leak during EFI variables write.

2023-08-29 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Tuesday, August 29, 2023 4:01 PM
> To: devel@edk2.groups.io
> Cc: abner.ch...@amd.com; Nickle Wang ;
> ig...@ami.com; Mike Maslenkin 
> Subject: [PATCH v2 4/6] RedfishClientPkg: fix memory leak during EFI variables
> write.
> 
> External email: Use caution opening links or attachments
> 
> 
> Signed-off-by: Mike Maslenkin 
> ---
>  .../RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c   | 6 +-
>  RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c| 6 +-
>  2 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git
> a/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c
> b/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c
> index 86684cc72e1e..6a72afed8715 100644
> --- a/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c
> +++ b/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c
> @@ -424,7 +424,11 @@ SaveConfigLangMapList (
>  gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid,
> VARIABLE_ATTRIBUTE_NV_BS, 0, NULL);
> 
>}
> 
> 
> 
> -  return gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid,
> VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
> 
> +  Status = gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid,
> VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
> 
> +
> 
> +  FreePool (VarData);
> 
> +
> 
> +  return Status;
> 
>  }
> 
> 
> 
>  /**
> 
> diff --git a/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c
> b/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c
> index 7ac6e885dea6..a892ced984c8 100644
> --- a/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c
> +++ b/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c
> @@ -411,7 +411,11 @@ SaveETagList (
>  gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid,
> VARIABLE_ATTRIBUTE_NV_BS, 0, NULL);
> 
>}
> 
> 
> 
> -  return gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid,
> VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
> 
> +  Status = gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid,
> VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
> 
> +
> 
> +  FreePool (VarData);
> 
> +
> 
> +  return Status;
> 
>  }
> 
> 
> 
>  /**
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108108): https://edk2.groups.io/g/devel/message/108108
Mute This Topic: https://groups.io/mt/101027006/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 3/6] RedfishClientPkg: fix leak of allocated Etag data

2023-08-29 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Tuesday, August 29, 2023 4:01 PM
> To: devel@edk2.groups.io
> Cc: abner.ch...@amd.com; Nickle Wang ;
> ig...@ami.com; Mike Maslenkin 
> Subject: [PATCH v2 3/6] RedfishClientPkg: fix leak of allocated Etag data
> 
> External email: Use caution opening links or attachments
> 
> 
> Signed-off-by: Mike Maslenkin 
> ---
>  RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c   | 4 
>  .../Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c| 4 
>  RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c   | 4 
>  3 files changed, 12 insertions(+)
> 
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> index f5562fb49cab..32dca964aa0a 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> @@ -220,6 +220,10 @@ RedfishResourceConsumeResource (
>  Private->Json = NULL;
> 
>}
> 
> 
> 
> +  if (Etag != NULL) {
> 
> +FreePool (Etag);
> 
> +  }
> 
> +
> 
>return Status;
> 
>  }
> 
> 
> 
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.c
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.c
> index 91968dbe488f..5c2a4eadf2f4 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.c
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.c
> @@ -164,6 +164,10 @@ RedfishResourceConsumeResource (
>  Private->Json = NULL;
> 
>}
> 
> 
> 
> +  if (Etag != NULL) {
> 
> +FreePool (Etag);
> 
> +  }
> 
> +
> 
>return Status;
> 
>  }
> 
> 
> 
> diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> index c55a6848c74e..f34f3266f1ee 100644
> --- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> +++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> @@ -164,6 +164,10 @@ RedfishResourceConsumeResource (
>  Private->Json = NULL;
> 
>}
> 
> 
> 
> +  if (Etag != NULL) {
> 
> +FreePool (Etag);
> 
> +  }
> 
> +
> 
>return Status;
> 
>  }
> 
> 
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108107): https://edk2.groups.io/g/devel/message/108107
Mute This Topic: https://groups.io/mt/101027005/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 2/6] RedfishClientPkg: fix access to uninitialized variable

2023-08-29 Thread Nickle Wang via groups.io
Thanks for fixing this issue, Mike.


Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Tuesday, August 29, 2023 4:01 PM
> To: devel@edk2.groups.io
> Cc: abner.ch...@amd.com; Nickle Wang ;
> ig...@ami.com; Mike Maslenkin 
> Subject: [PATCH v2 2/6] RedfishClientPkg: fix access to uninitialized variable
> 
> External email: Use caution opening links or attachments
> 
> 
> This patch fixes access to uninitialized variable, causing ASSERT from 
> FreePool at
> least.
> 
> Before this patch RedfishSettingsResponse was initialized by GetResourceByUri
> under 'if (JsonValue != NULL)' condition.
> But freed under 'if (Private->Payload != NULL)' condition.
> Thus uninitialized pointers caused ASSERT on attempt to free memory.
> 
> Signed-off-by: Mike Maslenkin 
> ---
>  RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> index e7ac8779581c..f5562fb49cab 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> @@ -128,6 +128,8 @@ RedfishResourceConsumeResource (
>  return Status;
> 
>}
> 
> 
> 
> +  ZeroMem (&RedfishSettingsResponse, sizeof (REDFISH_RESPONSE));
> 
> +
> 
>ExpectedResponse   = &Response;
> 
>RedfishSettingsUri = NULL;
> 
>JsonValue  = RedfishJsonInPayload (Response.Payload);
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108106): https://edk2.groups.io/g/devel/message/108106
Mute This Topic: https://groups.io/mt/101027004/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 1/6] RedfishClientPkg: fix crash on access to uninialized list variable.

2023-08-29 Thread Nickle Wang via groups.io
Reviewed-by: Nickle Wang 



@abner.ch...@amd.com, I am thinking that we may 
need to provide allocation function for CS structure so caller does not need to 
handle linked-list initialization like this one, or other stuff requies 
understanding to CS structure implementation.



Regards,

Nickle



> -Original Message-

> From: Mike Maslenkin 

> Sent: Tuesday, August 29, 2023 4:01 PM

> To: devel@edk2.groups.io

> Cc: abner.ch...@amd.com; Nickle Wang ;

> ig...@ami.com; Mike Maslenkin 

> Subject: [PATCH v2 1/6] RedfishClientPkg: fix crash on access to uninialized 
> list

> variable.

>

> External email: Use caution opening links or attachments

>

>

> Signed-off-by: Mike Maslenkin 
> mailto:mike.maslen...@gmail.com>>

> ---

>  RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c | 2 ++

>  1 file changed, 2 insertions(+)

>

> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> index b9c799e07684..a1738de46fdf 100644

> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> @@ -97,6 +97,8 @@ RedfishConsumeResourceCommon (

>if (BiosCs->Attributes == NULL) {

>

>  BiosCs->Attributes = AllocateZeroPool (sizeof

> (RedfishBios_V1_0_9_Attributes_CS));

>

>  ASSERT (BiosCs->Attributes != NULL);

>

> +// initialize list

>

> +BiosCs->Attributes->Prop.ForwardLink = &BiosCs->Attributes->Prop;

>

>}

>

>

>

>//

>

> --

> 2.32.0 (Apple Git-132)




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108105): https://edk2.groups.io/g/devel/message/108105
Mute This Topic: https://groups.io/mt/101027003/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, August 29, 2023 #cal-reminder

2023-08-29 Thread Group Notification
*Reminder: TianoCore Bug Triage - APAC / NAMO*

*When:*
Tuesday, August 29, 2023
6:30pm to 7:30pm
(UTC-07: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=2007253 )

*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 (#108104): https://edk2.groups.io/g/devel/message/108104
Mute This Topic: https://groups.io/mt/101023449/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 v1 1/1] SecurityPkg/Tpm2DeviceLibTcg2: Make mTcg2Protocol static

2023-08-29 Thread Yao, Jiewen
Reviewed-by: Jiewen Yao 

> -Original Message-
> From: Michael Kubacki 
> Sent: Wednesday, August 30, 2023 7:14 AM
> To: devel@edk2.groups.io; Yao, Jiewen ; Wang, Jian J
> 
> Subject: Re: [edk2-devel] [PATCH v1 1/1] SecurityPkg/Tpm2DeviceLibTcg2: Make
> mTcg2Protocol static
> 
> Hello,
> 
> Can you please help review this change when you get a chance?
> 
> Thanks,
> Michael
> 
> On 8/15/2023 11:50 AM, Michael Kubacki wrote:
> > From: Michael Kubacki 
> >
> > The global variable has a common name that can conflict with other
> > TCG modules. For example, Tcg2Dxe has a similarly named global that
> > is of type EFI_TCG2_PROTOCOL instead of EFI_TCG2_PROTOCOL*.
> >
> > Cc: Jiewen Yao 
> > Cc: Jian J Wang 
> > Signed-off-by: Michael Kubacki 
> > ---
> >   SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c
> b/SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c
> > index 3c8cf4fa117a..c792b1d67b06 100644
> > --- a/SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c
> > +++ b/SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c
> > @@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> >   #include 
> >   #include 
> >
> > -EFI_TCG2_PROTOCOL  *mTcg2Protocol = NULL;
> > +STATIC  EFI_TCG2_PROTOCOL  *mTcg2Protocol = NULL;
> >
> >   /**
> > This service enables the sending of commands to the TPM2.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108103): https://edk2.groups.io/g/devel/message/108103
Mute This Topic: https://groups.io/mt/100760659/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/7] Add DebugMacroCheck

2023-08-29 Thread Michael Kubacki

Hi all,

Now that the stable tag is out, I would appreciate reviews for this series.

Thanks,
Michael

On 8/14/2023 4:48 PM, Michael Kubacki wrote:

From: Michael Kubacki 

Adds a new script and build plugin called DebugMacroCheck.

The script verifies that the number of print specifiers match the
number of arguments in DEBUG() calls.

Overview:

- Build plugin: BuildPlugin/DebugMacroCheckBuildPlugin.py
   - Runs on any build target that is not NO-TARGET
- Standalone script: DebugMacroCheck.py
   - Run `DebugMacroCheck.py --help` to see command line options
- Unit tests:
   - Tests/test_DebugMacroCheck.py
   - Can be run with:
 `python -m unittest discover -s ./.pytool/Plugin/DebugMacroCheck/tests -v`
   - Also visible in VS Code Test Explorer

Background:

The tool has been constantly run against edk2 derived code for about
a year now. During that time, its found over 20 issues in edk2, over
50 issues in various vendor code, and numerous other issues specific
to Project Mu.

See the following series for a batch of issues previously fixed in
edk2 discovered by the tool:

   https://edk2.groups.io/g/devel/message/93104

I've received interest from vendors to place it in edk2 to
immediately find issues in the upstream and make it easier for edk2
consumers to directly acquire it. That led to this patch series.

This would run in edk2 as a build plugin. All issues in the edk2
codebase have been resolved so this would find new issues before
they are merged into the codebase.

The script is meant to be portable so it can be run as a build plugin
or dropped as a standalone script into other environments alongside
the unit tests.

Series Overview:

- Fixes outstanding issues in RedfishPkg
- Adds the `regex` PIP module to pip-requirements.txt
- Adds exceptions for debug macro usage in ArmVirtPkg,
   DynamicTablesPkg, and SecurityPkg
- Disables the plugin in OvmfPkg per maintainer's previous
   preferences
- Adds the plugin

The plugin (this series) is running with passing CI results as shown
in this PR:
   https://github.com/tianocore/edk2/pull/4736

Cc: Abner Chang 
Cc: Alexei Fedorov 
Cc: Ard Biesheuvel 
Cc: Gerd Hoffmann 
Cc: Igor Kulchytskyy 
Cc: Jian J Wang 
Cc: Jiewen Yao 
Cc: Jordan Justen 
Cc: Leif Lindholm 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Nickle Wang 
Cc: Pierre Gondois 
Cc: Sami Mujawar 
Cc: Sean Brogan 

Michael Kubacki (7):
   RedfishPkg/PlatformHostInterfaceBmcUsbNicLib: Fix DEBUG macro args
   pip-requirements.txt: Add regex
   SecurityPkg.ci.yaml: Add debug macro exception
   ArmVirtPkg.ci.yaml: Add debug macro exception
   DynamicTablesPkg.ci.yaml: Add debug macro exception
   OvmfPkg/PlatformCI: Disable DebugMacroCheck
   .pytool/Plugin: Add DebugMacroCheck

  
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c
 |   8 +-
  .pytool/Plugin/DebugMacroCheck/BuildPlugin/DebugMacroCheckBuildPlugin.py  
   | 127 +++
  .pytool/Plugin/DebugMacroCheck/BuildPlugin/DebugMacroCheck_plug_in.yaml   
   |  11 +
  .pytool/Plugin/DebugMacroCheck/DebugMacroCheck.py 
   | 859 
  .pytool/Plugin/DebugMacroCheck/Readme.md  
   | 253 ++
  .pytool/Plugin/DebugMacroCheck/tests/DebugMacroDataSet.py 
   | 674 +++
  .pytool/Plugin/DebugMacroCheck/tests/MacroTest.py 
   | 131 +++
  .pytool/Plugin/DebugMacroCheck/tests/__init__.py  
   |   0
  .pytool/Plugin/DebugMacroCheck/tests/test_DebugMacroCheck.py  
   | 201 +
  ArmVirtPkg/ArmVirtPkg.ci.yaml 
   |   8 +
  DynamicTablesPkg/DynamicTablesPkg.ci.yaml 
   |   8 +
  OvmfPkg/PlatformCI/PlatformBuildLib.py
   |   1 +
  SecurityPkg/SecurityPkg.ci.yaml   
   |   9 +
  pip-requirements.txt  
   |   2 +-
  14 files changed, 2287 insertions(+), 5 deletions(-)
  create mode 100644 
.pytool/Plugin/DebugMacroCheck/BuildPlugin/DebugMacroCheckBuildPlugin.py
  create mode 100644 
.pytool/Plugin/DebugMacroCheck/BuildPlugin/DebugMacroCheck_plug_in.yaml
  create mode 100644 .pytool/Plugin/DebugMacroCheck/DebugMacroCheck.py
  create mode 100644 .pytool/Plugin/DebugMacroCheck/Readme.md
  create mode 100644 .pytool/Plugin/DebugMacroCheck/tests/DebugMacroDataSet.py
  create mode 100644 .pytool/Plugin/DebugMacroCheck/tests/MacroTest.py
  create mode 100644 .pytool/Plugin/DebugMacroCheck/tests/__init__.py
  create mode 100644 
.pytool/Plugin/DebugMacroCheck/tests/test_DebugMacroCheck.py




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

Re: [edk2-devel] [PATCH v1 1/1] SecurityPkg/Tpm2DeviceLibTcg2: Make mTcg2Protocol static

2023-08-29 Thread Michael Kubacki

Hello,

Can you please help review this change when you get a chance?

Thanks,
Michael

On 8/15/2023 11:50 AM, Michael Kubacki wrote:

From: Michael Kubacki 

The global variable has a common name that can conflict with other
TCG modules. For example, Tcg2Dxe has a similarly named global that
is of type EFI_TCG2_PROTOCOL instead of EFI_TCG2_PROTOCOL*.

Cc: Jiewen Yao 
Cc: Jian J Wang 
Signed-off-by: Michael Kubacki 
---
  SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c 
b/SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c
index 3c8cf4fa117a..c792b1d67b06 100644
--- a/SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c
+++ b/SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c
@@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
  #include 
  #include 
  
-EFI_TCG2_PROTOCOL  *mTcg2Protocol = NULL;

+STATIC  EFI_TCG2_PROTOCOL  *mTcg2Protocol = NULL;
  
  /**

This service enables the sending of commands to the TPM2.



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108101): https://edk2.groups.io/g/devel/message/108101
Mute This Topic: https://groups.io/mt/100760659/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 20/25] OvmfPkg: Enable Choosing Memory Protection Profile via QemuCfg

2023-08-29 Thread Taylor Beebe



On 8/29/23 4:17 AM, Gerd Hoffmann wrote:

   Hi,


-  SetDxeMemoryProtectionSettings (&DxeSettings, 
DxeMemoryProtectionSettingsPcd);
-  SetMmMemoryProtectionSettings (&MmSettings, MmMemoryProtectionSettingsPcd);
+  Status = QemuFwCfgParseString (DXE_MEMORY_PROTECTION_PROFILE_FWCFG_FILE, 
&StringSize, String);
+  if (!EFI_ERROR (Status)) {
+DEBUG ((DEBUG_INFO, "Setting DXE Memory Protection Profile: %a\n", 
String));
+if (AsciiStriCmp (String, "debug") == 0) {
+  DxeSettings = 
DxeMemoryProtectionProfiles[DxeMemoryProtectionSettingsDebug].Settings;

I'd suggest to just loop over DxeMemoryProtectionProfiles and compare
String with .Name, so we don't have to touch this in case we add or
remove profiles.


Sounds good -- will update in v3


+DxeSettings = 
DxeMemoryProtectionProfiles[DxeMemoryProtectionSettingsDebug].Settings;

I'd prefer to use DxeMemoryProtectionSettingsPcd by default.


The PCDs are still removed in this patch series. The PCD profile is 
included in the earlier patches of this series to ensure the memory 
protections are consistent as each patch transitions the references to 
use the library interface. I opted to to remove the PCDs for a couple of 
reasons:
1. The PCDs are the legacy interface, and keeping legacy interfaces 
around is sometimes necessary for compatibility but not in this case. 
Keeping the PCDs would disrupt maintainability, clarity, and 
extensibility of memory protections. I am also not confident the legacy 
interface would ever be removed in the future.


2. Removing the PCDs will cause a build failure for platforms which 
reference them. This outcome is desirable in this case because action 
needs to be taken to ensure the platform protection meets expectations 
with this new system. If the PCDs were kept, platform creators may try 
updating the PCDs and be confused when the changes are not reflected in 
the state of the system because the PCD profile is not in use. This 
nuance helps identify a confusing interface.




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108098): https://edk2.groups.io/g/devel/message/108098
Mute This Topic: https://groups.io/mt/100830924/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 19/25] MdeModulePkg: Add Additional Profiles to SetMemoryProtectionsLib

2023-08-29 Thread Taylor Beebe



On 8/29/23 3:46 AM, Gerd Hoffmann wrote:



--- a/MdeModulePkg/Include/Library/SetMemoryProtectionsLib.h
+++ b/MdeModulePkg/Include/Library/SetMemoryProtectionsLib.h
@@ -17,6 +17,10 @@ typedef struct {
  } DXE_MEMORY_PROTECTION_PROFILES;
  
  typedef enum {

+  DxeMemoryProtectionSettingsDebug = 0,
+  DxeMemoryProtectionSettingsRelease,
+  DxeMemoryProtectionSettingsReleaseNoPageGuards,
+  DxeMemoryProtectionSettingsOff,
DxeMemoryProtectionSettingsPcd,
DxeMemoryProtectionSettingsMax
  } DXE_MEMORY_PROTECTION_PROFILE_INDEX;

Ordering mismatch for "pcd" and "off".

I'd suggest to use C99 initializers, i.e.

DxeMemoryProtectionProfiles[] = {
[ DxeMemoryProtectionSettingsDebug ] = {
.Name = "Debug",

to avoid that.

take care,
   Gerd



Thanks! Will fix in v3



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108097): https://edk2.groups.io/g/devel/message/108097
Mute This Topic: https://groups.io/mt/100830918/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] ArmPkg/ExceptionSupport: Support backtrace through an exception

2023-08-29 Thread Laszlo Ersek
On 8/29/23 15:29, Ard Biesheuvel wrote:
> Laszlo reports that the efi_gdb.py script fails to produce a full
> backtrace when attaching it to an ARM firmware build that has halted on
> an unhandled exception.
> 
> The reason is that the asm code that processes the exception was not
> implemented with this in mind, and therefore lacks any handling of it.
> 
> So let's add this: create a dummy frame record suitable for chasing the
> frame pointer, and add the CFI metadata to describe where the return
> value can be found on the stack.
> 
> When using a GCC5 build, this produces a stack trace such as
> 
>   (gdb) bt
>   #0  0x7fd4537c in CpuDeadLoop () at 
> /home/ardb/build/edk2/MdePkg/Library/BaseLib/CpuDeadLoop.c:30
>   #1  0x7fd454f8 in DebugAssert (
>   FileName=FileName@entry=0x7fd4a8a8  
> "/home/ardb/build/edk2/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c",
>   LineNumber=LineNumber@entry=343, 
> Description=Description@entry=0x7fd4a896  
> "((BOOLEAN)(0==1))")
>   at 
> /home/ardb/build/edk2/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c:235
>   #2  0x7fd479ec in DefaultExceptionHandler (ExceptionType= out>, SystemContext=...)
>   at 
> /home/ardb/build/edk2/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c:343
>   #3  0x7fd48eb8 in ExceptionHandlersEnd ()
>   #4  0x7fcde944 in QemuLoadKernelImage (ImageHandle= pointer>) at 
> /home/ardb/build/edk2/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c:201
>   #5  TryRunningQemuKernel () at 
> /home/ardb/build/edk2/ArmVirtPkg/Library/PlatformBootManagerLib/QemuKernel.c:46
>   #6  PlatformBootManagerAfterConsole () at 
> /home/ardb/build/edk2/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c:1139
>   #7  BdsEntry (This=) at 
> /home/ardb/build/edk2/MdeModulePkg/Universal/BdsDxe/BdsEntry.c:931
>   #8  0x7ffd0018 in ?? ()
>   Backtrace stopped: previous frame inner to this frame (corrupt stack?)
> 
> when QemuLoadKernelImage() has been tweaked to trigger an exception, as
> is shown by GDB when walking the call stack:
> 
> |0x7fcde938   b.ne0x7fcdf134   // 
> b.any
> |0x7fcde93c   mov x0, #0x40   
> // #64
> |0x7fcde940   bl  0x7fcd7aec 
> |  > 0x7fcde944   brk #0x4d2
> |0x7fcde948   bl  0x7fce4354 
> 
> |0x7fcde94c   tbz x0, #63, 0x7fcde954 
> 
> |0x7fcde950   bl  0x7fcd844c 
> 
> |0x7fcde954   bl  0x7fcd990c 
>  
> Unfortunately, CLANGDWARF does not seem entirely happy with this
> arrangement: it identifies the call frame where the exception
> originated, but does not show any frames above that. (This could be
> related to the fact that the exception code uses a separate exception
> stack for handling synchronous exceptions)

First of all, thanks for writing this patch so incredibly quickly. :)

Second, something must be off with my gdb.

Before your patch, I kept experimenting with manually resetting FP, SP,
and LR to the values printed in the register dump, using gdb "set"
commands. Strangely, that did result in complete pre-exception stack
traces, but *only sometimes*. Most of the time gdb complains about
"corrupted stack". And I just can't figure out what distinguishes the
broken from the functional "bt" commands -- I did walk the allegedly
corrupt stack manually, and there is nothing corrupt in the FP and LR
parts of the stack frames. They all chain nicely and point to valid
instructions, respectively. I don't know what it is that gdb doesn't like.

Third, when I test your patch, I seem to experience precisely what you
describe under CLANGDWARF -- it shows the faulting frame (the frame just
before the exception), but nothing before it! And I'm not building with
clang :(

Thanks,
Laszlo

> 
> Signed-off-by: Ard Biesheuvel 
> ---
>  ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S | 18 
> +-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S 
> b/ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S
> index cd9437b6aab8..345b566932bb 100644
> --- a/ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S
> +++ b/ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S
> @@ -259,6 +259,8 @@ ASM_PFX(ExceptionHandlersEnd):
>  
>  
>  ASM_PFX(CommonExceptionEntry):
> +  .cfi_sections .debug_frame
> +  .cfi_startproc
>  
>EL1_OR_EL2_OR_EL3(x1)
>  1:mrs  x2, elr_el1   // Exception Link Register
> @@ -280,6 +282,13 @@ ASM_PFX(CommonExceptionEntry):
>  
>  4:mrs  x4, fpsr  // Floating point Status Register  32bit
>  
> +  // Create a dummy frame record using the ELR as the return address
> +  stp  x29, x2, [sp, #-16]!
> +  .cfi_def_cfa_offset (GP_CONTEXT_SIZE + FP_CONTEXT_SIZE + SYS_CONTEXT_SIZE 
> + 16)
> +  .cfi_rel_offset x29, 0
> +  .cfi_rel_offset x30, 8
> +  mov  x29, sp
> +
> 

[edk2-devel] [PATCH v3 2/2] ShellPkg: Add ProcessorUpgradeSocket definitions from SMBIOS 3.7.0

2023-08-29 Thread Eduardo Cuevas Farfan
This patch adds below definitions from SMBIOS 3.7.0 into QueryTable.c
- ProcessorUpgradeSocketAM5
- ProcessorUpgradeSocketSP5
- ProcessorUpgradeSocketSP6
- ProcessorUpgradeSocketBGA883
- ProcessorUpgradeSocketBGA1190
- ProcessorUpgradeSocketBGA4129
- ProcessorUpgradeSocketLGA4710
- ProcessorUpgradeSocketLGA7529

Signed-off-by: Eduardo Cuevas Farfan 
---
 .../SmbiosView/QueryTable.c   | 34 ++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git 
a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
index 29b5a2900150..82bb7a41f0e6 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
@@ -2,7 +2,7 @@
   Build a table, each item is (Key, Info) pair.
   And give a interface of query a string out of a table.
 
-  Copyright (c) 2005 - 2021, Intel Corporation. All rights reserved.
+  Copyright (c) 2005 - 2023, Intel Corporation. All rights reserved.
   (C) Copyright 2016-2019 Hewlett Packard Enterprise Development LP
   Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -638,6 +638,38 @@ TABLE_ITEM  ProcessorUpgradeTable[] = {
   {
 0x48,
 L"Socket BGA5773"
+  },
+  {
+0x49,
+L"Socket AM5"
+  },
+  {
+0x4A,
+L"Socket SP5"
+  },
+  {
+0x4B,
+L"Socket SP6"
+  },
+  {
+0x4C,
+L"Socket BGA883"
+  },
+  {
+0x4D,
+L"Socket BGA1190"
+  },
+  {
+0x4E,
+L"Socket BGA4129"
+  },
+  {
+0x4F,
+L"Socket LGA4710"
+  },
+  {
+0x50,
+L"Socket LGA7529"
   }
 };
 
-- 
2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108095): https://edk2.groups.io/g/devel/message/108095
Mute This Topic: https://groups.io/mt/101032076/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/2] MdePkg: Add ProcessorUpgradeSocket definitions from SMBIOS 3.7.0

2023-08-29 Thread Eduardo Cuevas Farfan
This patch adds below definitions from SMBIOS 3.7.0 into Smbios.h
- ProcessorUpgradeSocketAM5
- ProcessorUpgradeSocketSP5
- ProcessorUpgradeSocketSP6
- ProcessorUpgradeSocketBGA883
- ProcessorUpgradeSocketBGA1190
- ProcessorUpgradeSocketBGA4129
- ProcessorUpgradeSocketLGA4710
- ProcessorUpgradeSocketLGA7529

Signed-off-by: Eduardo Cuevas Farfan 
---
 MdePkg/Include/IndustryStandard/SmBios.h | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/SmBios.h 
b/MdePkg/Include/IndustryStandard/SmBios.h
index 89985bb4186b..40bdc9a937c0 100644
--- a/MdePkg/Include/IndustryStandard/SmBios.h
+++ b/MdePkg/Include/IndustryStandard/SmBios.h
@@ -1,7 +1,7 @@
 /** @file
-  Industry Standard Definitions of SMBIOS Table Specification v3.6.0.
+  Industry Standard Definitions of SMBIOS Table Specification v3.7.0.
 
-Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2023, Intel Corporation. All rights reserved.
 (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
 (C) Copyright 2015 - 2019 Hewlett Packard Enterprise Development LP
 Copyright (c) 2022, AMD Incorporated. All rights reserved.
@@ -863,7 +863,15 @@ typedef enum {
   ProcessorUpgradeSocketLGA1211   = 0x45,
   ProcessorUpgradeSocketLGA2422   = 0x46,
   ProcessorUpgradeSocketLGA5773   = 0x47,
-  ProcessorUpgradeSocketBGA5773   = 0x48
+  ProcessorUpgradeSocketBGA5773   = 0x48,
+  ProcessorUpgradeSocketAM5   = 0x49,
+  ProcessorUpgradeSocketSP5   = 0x4A,
+  ProcessorUpgradeSocketSP6   = 0x4B,
+  ProcessorUpgradeSocketBGA883= 0x4C,
+  ProcessorUpgradeSocketBGA1190   = 0x4D,
+  ProcessorUpgradeSocketBGA4129   = 0x4E,
+  ProcessorUpgradeSocketLGA4710   = 0x4F,
+  ProcessorUpgradeSocketLGA7529   = 0x50
 } PROCESSOR_UPGRADE;
 
 ///
-- 
2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108094): https://edk2.groups.io/g/devel/message/108094
Mute This Topic: https://groups.io/mt/101032070/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/2] Add ProcessorUpgradeSocket definitions from SMBIOS 3.7.0

2023-08-29 Thread Eduardo Cuevas Farfan
Add ProcessorUpgradeSocket definitions from SMBIOS 3.7.0 to edk2 sources

Eduardo Cuevas Farfan (2):
  MdePkg: Add ProcessorUpgradeSocket definitions from SMBIOS 3.7.0
  ShellPkg: Add ProcessorUpgradeSocket definitions from SMBIOS 3.7.0

 MdePkg/Include/IndustryStandard/SmBios.h  | 14 ++--
 .../SmbiosView/QueryTable.c   | 34 ++-
 2 files changed, 44 insertions(+), 4 deletions(-)

-- 
2.26.2.windows.1



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




[edk2-devel] [PATCH 1/1] ArmPkg/ExceptionSupport: Support backtrace through an exception

2023-08-29 Thread Ard Biesheuvel
Laszlo reports that the efi_gdb.py script fails to produce a full
backtrace when attaching it to an ARM firmware build that has halted on
an unhandled exception.

The reason is that the asm code that processes the exception was not
implemented with this in mind, and therefore lacks any handling of it.

So let's add this: create a dummy frame record suitable for chasing the
frame pointer, and add the CFI metadata to describe where the return
value can be found on the stack.

When using a GCC5 build, this produces a stack trace such as

  (gdb) bt
  #0  0x7fd4537c in CpuDeadLoop () at 
/home/ardb/build/edk2/MdePkg/Library/BaseLib/CpuDeadLoop.c:30
  #1  0x7fd454f8 in DebugAssert (
  FileName=FileName@entry=0x7fd4a8a8  
"/home/ardb/build/edk2/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c",
  LineNumber=LineNumber@entry=343, Description=Description@entry=0x7fd4a896 
 "((BOOLEAN)(0==1))")
  at 
/home/ardb/build/edk2/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c:235
  #2  0x7fd479ec in DefaultExceptionHandler (ExceptionType=, SystemContext=...)
  at 
/home/ardb/build/edk2/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c:343
  #3  0x7fd48eb8 in ExceptionHandlersEnd ()
  #4  0x7fcde944 in QemuLoadKernelImage (ImageHandle=) at 
/home/ardb/build/edk2/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c:201
  #5  TryRunningQemuKernel () at 
/home/ardb/build/edk2/ArmVirtPkg/Library/PlatformBootManagerLib/QemuKernel.c:46
  #6  PlatformBootManagerAfterConsole () at 
/home/ardb/build/edk2/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c:1139
  #7  BdsEntry (This=) at 
/home/ardb/build/edk2/MdeModulePkg/Universal/BdsDxe/BdsEntry.c:931
  #8  0x7ffd0018 in ?? ()
  Backtrace stopped: previous frame inner to this frame (corrupt stack?)

when QemuLoadKernelImage() has been tweaked to trigger an exception, as
is shown by GDB when walking the call stack:

|0x7fcde938   b.ne0x7fcdf134   // 
b.any
|0x7fcde93c   mov x0, #0x40   // 
#64
|0x7fcde940   bl  0x7fcd7aec 
|  > 0x7fcde944   brk #0x4d2
|0x7fcde948   bl  0x7fce4354 
|0x7fcde94c   tbz x0, #63, 0x7fcde954 
|0x7fcde950   bl  0x7fcd844c 

|0x7fcde954   bl  0x7fcd990c 

---
 ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S | 18 
+-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S 
b/ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S
index cd9437b6aab8..345b566932bb 100644
--- a/ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S
+++ b/ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S
@@ -259,6 +259,8 @@ ASM_PFX(ExceptionHandlersEnd):
 
 
 ASM_PFX(CommonExceptionEntry):
+  .cfi_sections .debug_frame
+  .cfi_startproc
 
   EL1_OR_EL2_OR_EL3(x1)
 1:mrs  x2, elr_el1   // Exception Link Register
@@ -280,6 +282,13 @@ ASM_PFX(CommonExceptionEntry):
 
 4:mrs  x4, fpsr  // Floating point Status Register  32bit
 
+  // Create a dummy frame record using the ELR as the return address
+  stp  x29, x2, [sp, #-16]!
+  .cfi_def_cfa_offset (GP_CONTEXT_SIZE + FP_CONTEXT_SIZE + SYS_CONTEXT_SIZE + 
16)
+  .cfi_rel_offset x29, 0
+  .cfi_rel_offset x30, 8
+  mov  x29, sp
+
   // Save the SYS regs
   stp  x2,  x3,  [x28, #-SYS_CONTEXT_SIZE]!
   stp  x4,  x5,  [x28, #0x10]
@@ -305,7 +314,7 @@ ASM_PFX(CommonExceptionEntry):
 
   // x0 still holds the exception type.
   // Set x1 to point to the top of our struct on the Stack
-  mov  x1, sp
+  add  x1, sp, #16
 
 // CommonCExceptionHandler (
 //   IN EFI_EXCEPTION_TYPE   ExceptionType,   R0
@@ -318,6 +327,9 @@ ASM_PFX(CommonExceptionEntry):
   // We do not try to recover.
   bl   ASM_PFX(CommonCExceptionHandler) // Call exception handler
 
+  // Pop dummy frame record
+  add  sp, sp, #16
+
   // Pop as many GP regs as we can before entering the critical section below
   ldp  x2,  x3,  [sp, #0x10]
   ldp  x4,  x5,  [sp, #0x20]
@@ -378,13 +390,17 @@ ASM_PFX(CommonExceptionEntry):
 
   // pop remaining GP regs and return from exception.
   ldr  x30, [sp, #0xf0 - 0xe0]
+  .cfi_restore 30
   ldp  x28, x29, [sp], #GP_CONTEXT_SIZE - 0xe0
+  .cfi_restore 29
 
   // Adjust SP to be where we started from when we came into the handler.
   // The handler can not change the SP.
   add  sp, sp, #FP_CONTEXT_SIZE + SYS_CONTEXT_SIZE
+  .cfi_def_cfa_offset 0
 
   eret
+  .cfi_endproc
 
 ASM_FUNC(RegisterEl0Stack)
   msr sp_el0, x0
-- 
2.42.0.rc2.253.gd59a3bf2b4-goog



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

Re: [edk2-devel] [RFC PATCH 1/1] BaseTools: drop tautological warning overrides for CLANGDWARF

2023-08-29 Thread Leif Lindholm
Thanks all - merged as 14bf2cb411ca.

On Wed, Aug 23, 2023 at 11:21:02 -0600, Rebecca Cran wrote:
> Reviewed-by: Rebecca Cran 
> 
> On Wed, Aug 23, 2023, at 9:15 AM, Leif Lindholm wrote:
> > The CLANGDWARF progfile sets both -Wno-tautological-compare and
> > -Wno-tautological-constant-out-of-range-compare, but this prevents
> > compile-time detection of certain errors.
> > Drop these flags.
> >
> > Signed-off-by: Leif Lindholm 
> > Cc: Rebecca Cran 
> > Cc: Liming Gao 
> > Cc: Bob Feng 
> > Cc: Yuwei Chen 
> > Cc: Ard Biesheuvel 
> > ---
> >
> > Does anyone remember why these were added?
> > I'm not running into any issues across armvirtqemu, qemusbsa, ovmfx64, 
> > ovmfriscv64.
> >
> > /
> > Leif
> >
> >  BaseTools/Conf/tools_def.template | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/BaseTools/Conf/tools_def.template 
> > b/BaseTools/Conf/tools_def.template
> > index 1bf62362b611..5bd5283655ea 100755
> > --- a/BaseTools/Conf/tools_def.template
> > +++ b/BaseTools/Conf/tools_def.template
> > @@ -1859,7 +1859,7 @@ DEFINE CLANGDWARF_X64_DLINK2_FLAGS= 
> > -Wl,--defsym=PECOFF_HEADER_SIZE=0x22
> >  DEFINE CLANGDWARF_IA32_TARGET = -target i686-pc-linux-gnu
> >  DEFINE CLANGDWARF_X64_TARGET  = -target x86_64-pc-linux-gnu
> > 
> > -DEFINE CLANGDWARF_WARNING_OVERRIDES= -Wno-parentheses-equality 
> > -Wno-tautological-compare 
> > -Wno-tautological-constant-out-of-range-compare -Wno-empty-body 
> > -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-option 
> > -Wno-unused-but-set-variable -Wno-unused-const-variable 
> > -Wno-unaligned-access -Wno-unneeded-internal-declaration
> > +DEFINE CLANGDWARF_WARNING_OVERRIDES= -Wno-parentheses-equality 
> > -Wno-empty-body -Wno-unused-const-variable -Wno-varargs 
> > -Wno-unknown-warning-option -Wno-unused-but-set-variable 
> > -Wno-unused-const-variable -Wno-unaligned-access 
> > -Wno-unneeded-internal-declaration
> >  DEFINE CLANGDWARF_ALL_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) 
> > DEF(CLANGDWARF_WARNING_OVERRIDES) -fno-stack-protector -mms-bitfields 
> > -Wno-address -Wno-shift-negative-value -Wno-unknown-pragmas 
> > -Wno-incompatible-library-redeclaration -fno-asynchronous-unwind-tables 
> > -mno-sse -mno-mmx -msoft-float -mno-implicit-float  
> > -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang 
> > -funsigned-char -fno-ms-extensions -Wno-null-dereference
> > 
> >  ###
> > -- 
> > 2.39.2
> >
> >
> >
> > 


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




Re: [edk2-devel] [PATCH v6 0/9] SecurityPkg/MdePkg: Update RngLib GUID identification

2023-08-29 Thread PierreGondois

Hello,
Just a ping in case this was forgotten.

The patches were already reviewed by Sami and Liming (thanks for this),
the approval of a SecurityPkg Maintainer would be ideal,

Regards,
Pierre

On 8/11/23 16:33, PierreGondois via groups.io wrote:

From: Pierre Gondois 

v6:
- Added Tested/Reviewed-by
- [8/9] SecurityPkg/RngDxe: Use GetRngGuid() when probing RngLib
   - Remove unused gEfiRngAlgorithmArmRndr definition in

v5:
- Let an implementation of BaseRngLibTimer in MdePkg to give some
   time to platform owners to use the MdeModulePkg implementation. [4]
- New patch:
   - [2/8] MdePkg: Add deprecated warning to BaseRngLibTimer

v4:
- New patches:
   - [1/8] MdePkg: Move BaseRngLibTimerLib to MdeModulePkg
   - [5/8] MdeModulePkg/Rng: Add GUID to describe unsafe Rng algorithms
- This patch-set now requires to be accepted along an edk-platforms patch
   moving the BaseRngLibTimerLib to MdeModulePkg

v3:
- As the unsafe algorithm GUID will not be added to the UEFI
   specification, rename:
   - gEfiRngAlgorithmUnSafe to gEdkiiRngAlgorithmUnSafe
   - EFI_RNG_ALGORITHM_UNSAFE to EDKII_RNG_ALGORITHM_UNSAFE

v2:
[1/8] MdePkg/ArmTrngLib: Remove ASSERTs in Null implementation
- Dropped
[2/8] MdePkg/MdePkg.dec: Move PcdCpuRngSupportedAlgorithm to MdePkg
- Change gEfiMdePkgTokenSpaceGuid.PcdCpuRngSupportedAlgorithm
   token number
- Rename to SecurityPkg/SecurityPkg.dec: Move
   PcdCpuRngSupportedAlgorithm to MdePkg
[5/8] MdePkg/Rng: Add GetRngGuid() to RngLib
- Remove gEfiRngAlgorithmUnSafe from inf file
- Split Guids definitions in arch specific sections
[6/8] SecurityPkg/RngDxe: Use GetRngGuid() when probing RngLib
- Remove RngFindDefaultAlgo() and change logic accordingly.
[7/8] SecurityPkg/RngDxe: Select safe default Rng algorithm
- Dropped due to changes in [6/8]

This patch also requires the following patch on top of the serie:
- https://edk2.groups.io/g/devel/message/106546

This patchset follows the 'code first' approach and relates to [1].
This patchset follows the thread at [3] that aims to solve [2].
[1] and [2] are bound and this patchset aims to solve both.

In this patchset:
a-
The RngDxe can rely on the RngLib. However the RngLib has no
interface allowing to describe which Rng algorithm is implemented.
The RngDxe must advertise the algorithm that are available through
the RngGetInfo() callback.
Add a GetRngGuid() for interface to the RngLib.

b-
The Arm Architecture states the RNDR that the DRBG algorithm should
be compliant with NIST SP800-90A, while not mandating a particular
algorithm, so as to be inclusive of different geographies.
The RngLib can rely on this Arm RNDR instruction. In order to
accurately describe the implementation using the RNDR instruction,
add a EFI_RNG_ALGORITHM_ARM_RNDR GUID [1].

c-
For the same reason as a/b, add a GUID describing unsafe RNG
algorithms, allowing to accurately describe the BaseRngLibTimerLib.

d-
Use a/b/c mechanisms/GUIDs to select a safe Rng algorithm in the
Arm implementation of the RngDxe.

[1] BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4441
[2] BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4151
[3] https://edk2.groups.io/g/devel/message/100806
[4] BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4504

Pierre Gondois (9):
   MdeModulePkg: Duplicate BaseRngLibTimerLib to MdeModulePkg
   MdePkg: Add deprecated warning to BaseRngLibTimer
   SecurityPkg/SecurityPkg.dec: Move PcdCpuRngSupportedAlgorithm to
 MdePkg
   MdePkg/DxeRngLib: Request raw algorithm instead of default
   MdePkg/Rng: Add GUID to describe Arm Rndr Rng algorithms
   MdeModulePkg/Rng: Add GUID to describe unsafe Rng algorithms
   MdePkg/Rng: Add GetRngGuid() to RngLib
   SecurityPkg/RngDxe: Use GetRngGuid() when probing RngLib
   SecurityPkg/RngDxe: Simplify Rng algorithm selection for Arm

  ArmVirtPkg/ArmVirt.dsc.inc|  2 +-
  EmulatorPkg/EmulatorPkg.dsc   |  2 +-
  MdeModulePkg/Include/Guid/RngAlgorithm.h  | 23 
  .../BaseRngLibTimerLib/BaseRngLibTimerLib.inf |  6 +-
  .../BaseRngLibTimerLib/BaseRngLibTimerLib.uni | 15 +
  .../Library/BaseRngLibTimerLib/RngLibTimer.c  | 28 ++
  MdeModulePkg/MdeModulePkg.dec |  3 +
  MdeModulePkg/MdeModulePkg.dsc |  1 +
  MdePkg/Include/Library/RngLib.h   | 17 ++
  MdePkg/Include/Protocol/Rng.h | 10 
  MdePkg/Library/BaseRngLib/AArch64/Rndr.c  | 42 ++
  MdePkg/Library/BaseRngLib/BaseRngLib.inf  | 10 
  MdePkg/Library/BaseRngLib/Rand/RdRand.c   | 26 +
  .../Library/BaseRngLibNull/BaseRngLibNull.c   | 22 
  .../BaseRngLibTimerLib/BaseRngLibTimerLib.inf |  1 +
  .../Library/BaseRngLibTimerLib/RngLibTimer.c  | 45 +++
  MdePkg/Library/DxeRngLib/DxeRngLib.c  | 36 +++-
  MdePkg/MdePkg.dec |  6 ++
  NetworkPkg/NetworkPkg.dsc |  4 +-
  OvmfPkg/AmdSev/AmdSevX64.dsc  |  2 +-
  OvmfPk

Re: [edk2-devel] [PATCH v2 20/25] OvmfPkg: Enable Choosing Memory Protection Profile via QemuCfg

2023-08-29 Thread Gerd Hoffmann
  Hi,

> -  SetDxeMemoryProtectionSettings (&DxeSettings, 
> DxeMemoryProtectionSettingsPcd);
> -  SetMmMemoryProtectionSettings (&MmSettings, MmMemoryProtectionSettingsPcd);
> +  Status = QemuFwCfgParseString (DXE_MEMORY_PROTECTION_PROFILE_FWCFG_FILE, 
> &StringSize, String);
> +  if (!EFI_ERROR (Status)) {
> +DEBUG ((DEBUG_INFO, "Setting DXE Memory Protection Profile: %a\n", 
> String));
> +if (AsciiStriCmp (String, "debug") == 0) {
> +  DxeSettings = 
> DxeMemoryProtectionProfiles[DxeMemoryProtectionSettingsDebug].Settings;

I'd suggest to just loop over DxeMemoryProtectionProfiles and compare
String with .Name, so we don't have to touch this in case we add or
remove profiles.

> +DxeSettings = 
> DxeMemoryProtectionProfiles[DxeMemoryProtectionSettingsDebug].Settings;

I'd prefer to use DxeMemoryProtectionSettingsPcd by default.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108089): https://edk2.groups.io/g/devel/message/108089
Mute This Topic: https://groups.io/mt/100830924/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 19/25] MdeModulePkg: Add Additional Profiles to SetMemoryProtectionsLib

2023-08-29 Thread Gerd Hoffmann
>  
>  // PROFILE CONFIGURATIONS //
>  
>  
>  DXE_MEMORY_PROTECTION_PROFILES  
> DxeMemoryProtectionProfiles[DxeMemoryProtectionSettingsMax] = {
> +  {
> +.Name= L"Debug",
> +.Description = L"Development profile ideal for debug scenarios",
> +.Settings= DXE_MEMORY_PROTECTION_SETTINGS_DEBUG
> +  },
> +  {
> +.Name= L"Release",
> +.Description = L"Release profile recommended for production scenarios",
> +.Settings= DXE_MEMORY_PROTECTION_SETTINGS_PROD_MODE
> +  },
> +  {
> +.Name= L"ReleaseNoPageGuards",
> +.Description = L"Release profile without page guards recommended for 
> performance sensitive production scenarios",
> +.Settings= DXE_MEMORY_PROTECTION_SETTINGS_PROD_MODE_NO_PAGE_GUARDS
> +  },
>{
>  .Name= L"Pcd",
>  .Description = L"Memory protection settings from PCDs",
>  .Settings= DXE_MEMORY_PROTECTION_SETTINGS_PCD
>},
> +  {
> +.Name= L"Off",
> +.Description = L"Disables all memory protection settings",
> +.Settings= DXE_MEMORY_PROTECTION_SETTINGS_OFF
> +  }
>  };

> --- a/MdeModulePkg/Include/Library/SetMemoryProtectionsLib.h
> +++ b/MdeModulePkg/Include/Library/SetMemoryProtectionsLib.h
> @@ -17,6 +17,10 @@ typedef struct {
>  } DXE_MEMORY_PROTECTION_PROFILES;
>  
>  typedef enum {
> +  DxeMemoryProtectionSettingsDebug = 0,
> +  DxeMemoryProtectionSettingsRelease,
> +  DxeMemoryProtectionSettingsReleaseNoPageGuards,
> +  DxeMemoryProtectionSettingsOff,
>DxeMemoryProtectionSettingsPcd,
>DxeMemoryProtectionSettingsMax
>  } DXE_MEMORY_PROTECTION_PROFILE_INDEX;

Ordering mismatch for "pcd" and "off".

I'd suggest to use C99 initializers, i.e.

DxeMemoryProtectionProfiles[] = {
[ DxeMemoryProtectionSettingsDebug ] = {
.Name = "Debug",

to avoid that.

take care,
  Gerd



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




Re: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresenceLib for Clear Graphics Screen To unblock and Display TPM messages

2023-08-29 Thread Poosapalli, Karunakar via groups.io
Thanks for sharing your inputs Jiewen.

Dear TCG Experts,

Can you please share your feedback on below proposals


Thanks & Regards
Karunakar Poosapalli
Firmware Principal Engineer, Client BIOS
Customer BIOS | Dell Core BIOS
CPG Software Engineering | Dell Technologies
Mobile +91 9951902957
karunakar_poosapa...@dell.com



Internal Use - Confidential
From: Yao, Jiewen 
Sent: Thursday, August 17, 2023 8:30 AM
To: Poosapalli, Karunakar; Gao, Liming; devel@edk2.groups.io
Subject: RE: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresenceLib for 
Clear Graphics Screen To unblock and Display TPM messages


[EXTERNAL EMAIL]
Hi Karunakar
Thanks for the patient.

I think my concern is universal, no matter it is after user input the key or 
not.
The clear-screen behavior is a *change*. And it may break the compatibility.

Unless all BIOS consumer in EDKII community agree the behavior, the risk is 
always there.


To move forward, I would like to hear the feedback from other OEM/ODM/IBV, who 
is consuming DxeTcg2PhysicalPresenceLib.

Thank you
Yao, Jiewen



From: Poosapalli, Karunakar 
mailto:karunakarpoosapa...@dell.com>>
Sent: Thursday, August 17, 2023 1:28 AM
To: Yao, Jiewen mailto:jiewen@intel.com>>; Gao, 
Liming mailto:gaolim...@byosoft.com.cn>>; 
devel@edk2.groups.io
Subject: RE: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresenceLib for 
Clear Graphics Screen To unblock and Display TPM messages

Hi @Yao, Jiewen,

Could you please share your thoughts. Please let me know if you have any 
queries or concerns.

Thanks & Regards
Karunakar Poosapalli
Firmware Principal Engineer, Client BIOS
Customer BIOS | Dell Core BIOS
CPG Software Engineering | Dell Technologies
Mobile +91 9951902957
karunakar_poosapa...@dell.com



Internal Use - Confidential
From: Poosapalli, Karunakar
Sent: Wednesday, August 9, 2023 9:59 AM
To: Yao, Jiewen; Gao, Liming; devel@edk2.groups.io
Subject: RE: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresenceLib for 
Clear Graphics Screen To unblock and Display TPM messages

Hi @Yao, Jiewen,

The proposed solution to clear screen will be called only when user has to 
provide the input key. This call will not execute in other conditions.
When there is a pending request in Tcg2, system will wait until user press 
input key. If there is no proper UI to customer, they feel it's system hang and 
go for customer support.
Even BIOS vendors also won't come to what is happening at customer box without 
any user information.
This is generic issue and not specific to any platform.

Thanks for sharing your thoughts.

Thanks & Regards
Karunakar Poosapalli
Firmware Principal Engineer, Client BIOS
Customer BIOS | Dell Core BIOS
CPG Software Engineering | Dell Technologies
Mobile +91 9951902957
karunakar_poosapa...@dell.com



Internal Use - Confidential
From: Yao, Jiewen mailto:jiewen@intel.com>>
Sent: Wednesday, August 9, 2023 4:44 AM
To: Poosapalli, Karunakar; Gao, Liming; 
devel@edk2.groups.io
Cc: Yao, Jiewen
Subject: RE: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresenceLib for 
Clear Graphics Screen To unblock and Display TPM messages


[EXTERNAL EMAIL]
My concern is that you unconditionally clear the screen. What if someone did 
want to show something on the screen?

This seems an incompatible change. That is why I think it should be a platform 
policy.

Another way is that you may consider to duplicate the library for your platform 
and clear it for your platform.

Thank you
Yao, Jiewen


From: Poosapalli, Karunakar 
mailto:karunakarpoosapa...@dell.com>>
Sent: Wednesday, August 9, 2023 2:13 AM
To: Yao, Jiewen mailto:jiewen@intel.com>>; Gao, 
Liming mailto:gaolim...@byosoft.com.cn>>; 
devel@edk2.groups.io; Poosapalli, Karunakar 
mailto:karunakarpoosapa...@dell.com>>
Subject: RE: [edk2-devel] [PATCH] SecurityPkg: DxeTcg2PhysicalPresenceLib for 
Clear Graphics Screen To unblock and Display TPM messages

Hi @Yao, Jiewen,

Thanks for your review and feedback.
When there is a pending Tcg request, the control will be in Tcg2 library and it 
will not reach to BDS until user press the input key.
As there is no information the screen because of screen is blocked by some 
other messages/Logo.
So user won't able to press the key without any user information and control 
will not reach to BDS phase.

As TCG user confirmation is the highest priority and it blocks the POST until 
the user presses the input key. Before TCG messages Print on the console, there 
should be logic added to clear the graphics screen

Please let me know your thoughts.

Thanks & Regards
Karunakar Poosapalli
Firmware Principal Engineer, Client BIOS
Customer BIOS | Dell Core BIOS
CPG Software Engineeri

Re: [edk2-devel] [PATCH] Platform/Intel: Enhance the BOARD_ID without PCH_TYPE support

2023-08-29 Thread Yuwei Chen
Reviewed-by: Yuwei Chen 

> -Original Message-
> From: Srinivasan, ManickamX 
> Sent: Wednesday, August 23, 2023 3:29 PM
> To: devel@edk2.groups.io
> Cc: Srinivasan, ManickamX ; Feng, Bob C
> ; Gao, Liming ; Chen,
> Christine ; T V, Krishnamoorthy
> 
> Subject: [PATCH] Platform/Intel: Enhance the BOARD_ID without PCH_TYPE
> support
> 
> The length of the Board ID is being updated based on the BOARD_ID string. If
> the PCH_TYPE is empty space/single quotes(''), removing the empty
> space/single quotes('') and concatenating the TARGET_PLATFORM_SHORT
> and BUILD flag strings.
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Yuwei Chen 
> Cc: T V Krishnamoorthy 
> Signed-off-by: ManickamX Srinivasan 
> ---
>  Platform/Intel/Tools/GenBiosId/GenBiosId.py | 8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/Platform/Intel/Tools/GenBiosId/GenBiosId.py
> b/Platform/Intel/Tools/GenBiosId/GenBiosId.py
> index f823fdcad..fa3689867 100644
> --- a/Platform/Intel/Tools/GenBiosId/GenBiosId.py
> +++ b/Platform/Intel/Tools/GenBiosId/GenBiosId.py
> @@ -142,7 +142,13 @@ def ParserInputFile(InputDict, NoTimestamp):
>  EdkLogger("GenBiosId", FORMAT_INVALID,
> ExtraData=_ConfigItemInvalid % Item)
>  _ConfigItem[Item]['Value'] = InputDict[Item]
>  if len(_ConfigItem[Item]['Value']) != _ConfigItem[Item]['Length']:
> -EdkLogger("GenBiosId", FORMAT_INVALID,
> ExtraData=_ConfigLenInvalid % Item)
> +# The length of the Board ID is being updated based on the
> BOARD_ID string
> +#If the PCH_TYPE is empty space/single quotes(''), removing the
> empty space/single quotes('') and concatenating the
> TARGET_PLATFORM_SHORT and BUILD flag strings
> +if(_ConfigItem["BOARD_ID"]['Value'][3:5] == "\'\'"):
> +
> _ConfigItem["BOARD_ID"]['Value']=_ConfigItem["BOARD_ID"]['Value'][0:3]+_
> ConfigItem["BOARD_ID"]['Value'][5:len(_ConfigItem["BOARD_ID"]['Value'])]
> +
> _ConfigItem["BOARD_ID"]['Length']=len(_ConfigItem["BOARD_ID"]['Value'])
> +else:
> +EdkLogger("GenBiosId", FORMAT_INVALID,
> + ExtraData=_ConfigLenInvalid % Item)
>  for Item in _ConfigItem:
>  if not _ConfigItem[Item]['Value']:
>  EdkLogger("GenBiosId", FORMAT_UNKNOWN_ERROR,
> ExtraData="Item %s is missing" % Item)
> --
> 2.30.2.windows.1



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




Re: [edk2-devel] [PATCH] Platform/Intel: Enhance the BOARD_ID without PCH_TYPE support

2023-08-29 Thread Bob Feng
Reviewed-by: Bob Feng  

-Original Message-
From: Srinivasan, ManickamX  
Sent: Wednesday, August 23, 2023 3:29 PM
To: devel@edk2.groups.io
Cc: Srinivasan, ManickamX ; Feng, Bob C 
; Gao, Liming ; Chen, Christine 
; T V, Krishnamoorthy 
Subject: [PATCH] Platform/Intel: Enhance the BOARD_ID without PCH_TYPE support

The length of the Board ID is being updated based on the BOARD_ID string. If 
the PCH_TYPE is empty space/single quotes(''), removing the empty space/single 
quotes('') and concatenating the TARGET_PLATFORM_SHORT and BUILD flag strings.

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Cc: T V Krishnamoorthy 
Signed-off-by: ManickamX Srinivasan 
---
 Platform/Intel/Tools/GenBiosId/GenBiosId.py | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Platform/Intel/Tools/GenBiosId/GenBiosId.py 
b/Platform/Intel/Tools/GenBiosId/GenBiosId.py
index f823fdcad..fa3689867 100644
--- a/Platform/Intel/Tools/GenBiosId/GenBiosId.py
+++ b/Platform/Intel/Tools/GenBiosId/GenBiosId.py
@@ -142,7 +142,13 @@ def ParserInputFile(InputDict, NoTimestamp):
 EdkLogger("GenBiosId", FORMAT_INVALID, 
ExtraData=_ConfigItemInvalid % Item)
 _ConfigItem[Item]['Value'] = InputDict[Item]
 if len(_ConfigItem[Item]['Value']) != _ConfigItem[Item]['Length']:
-EdkLogger("GenBiosId", FORMAT_INVALID, ExtraData=_ConfigLenInvalid 
% Item)
+# The length of the Board ID is being updated based on the 
BOARD_ID string
+#If the PCH_TYPE is empty space/single quotes(''), removing the 
empty space/single quotes('') and concatenating the TARGET_PLATFORM_SHORT and 
BUILD flag strings
+if(_ConfigItem["BOARD_ID"]['Value'][3:5] == "\'\'"):
+
_ConfigItem["BOARD_ID"]['Value']=_ConfigItem["BOARD_ID"]['Value'][0:3]+_ConfigItem["BOARD_ID"]['Value'][5:len(_ConfigItem["BOARD_ID"]['Value'])]
+
_ConfigItem["BOARD_ID"]['Length']=len(_ConfigItem["BOARD_ID"]['Value'])
+else:
+EdkLogger("GenBiosId", FORMAT_INVALID, 
+ ExtraData=_ConfigLenInvalid % Item)
 for Item in _ConfigItem:
 if not _ConfigItem[Item]['Value']:
 EdkLogger("GenBiosId", FORMAT_UNKNOWN_ERROR, ExtraData="Item %s is 
missing" % Item)
--
2.30.2.windows.1



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




[edk2-devel] [PATCH v2 6/6] RedfishClientPkg: spelling fixes

2023-08-29 Thread Mike Maslenkin
Signed-off-by: Mike Maslenkin 
---
 RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c   | 4 ++--
 .../ComputerSystemCollectionDxe.c   | 6 +++---
 .../Features/MemoryCollectionDxe/MemoryCollectionDxe.c  | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
index a1738de46fdf..a969557ddfdb 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
@@ -831,7 +831,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));
   Status = EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n", 
__func__, Uri, Status));
+DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n", 
__func__, Uri, Status));
   }
 
   //
@@ -840,7 +840,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
   Status = EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n", 
__func__, Uri, Status));
+DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n", 
__func__, Uri, Status));
   }
 
   return Status;
diff --git 
a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
 
b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
index 8f2054e1e161..1e362d49cbb6 100644
--- 
a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
+++ 
b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
@@ -109,7 +109,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));
   Status = EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n", 
__func__, Uri, Status));
+DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n", 
__func__, Uri, Status));
   }
 
   //
@@ -118,7 +118,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
   Status = EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n", 
__func__, Uri, Status));
+DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n", 
__func__, Uri, Status));
   }
 
   return Status;
@@ -228,7 +228,7 @@ CreateCollectionResource (
 
   Status = EdkIIRedfishResourceConfigProvisionging (&SchemaInfo, 
Private->CollectionUri, Private->InformationExchange, TRUE);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, failed to create resoruce for: %s: %r\n", 
__func__, Private->CollectionUri, Status));
+DEBUG ((DEBUG_ERROR, "%a, failed to create resource for: %s: %r\n", 
__func__, Private->CollectionUri, Status));
   }
 
   return Status;
diff --git 
a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c 
b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
index b94ff2e86572..1b755cde0130 100644
--- a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
+++ b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
@@ -109,7 +109,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));
   Status = EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n", 
__func__, Uri, Status));
+DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n", 
__func__, Uri, Status));
   }
 
   //
@@ -118,7 +118,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
   Status = EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n", 
__func__, Uri, Status));
+DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n", 
__func__, Uri, Status));
   }
 
   return Status;
@@ -228,7 +228,7 @@ CreateCollectionResource (
 
   Status = EdkIIRedfishResourceConfigProvisionging (&SchemaInfo, 
Private->CollectionUri, Private->InformationExchange, TRUE);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, failed to create resoruce for: %s: %r\n", 
__func__, Private->CollectionUri, Status));
+DEBUG ((DEBUG_ERROR, "%a, failed to create resource for: %s: %r\n", 
__func__, Private->CollectionUri, Status));
   }
 
   return Status;
-- 
2.32.0 (Apple Git-132)



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

[edk2-devel] [PATCH v2 5/6] RedfishClientPkg: fix misprints in Readme.md

2023-08-29 Thread Mike Maslenkin
Signed-off-by: Mike Maslenkin 
---
 RedfishClientPkg/Readme.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md
index 18a27633cf45..0aec0580aa5c 100644
--- a/RedfishClientPkg/Readme.md
+++ b/RedfishClientPkg/Readme.md
@@ -40,7 +40,7 @@ Below are the block diagrams of UEFI Redfish Client EDK2 
Implementation.
 ![UEFI Redfish Client 
Implementation](https://github.com/changab/edk2-staging/blob/edk2-redfish-client/RedfishClientPkg/Documents/Media/RedfishClientDriverStack.svg?raw=true)
 
 ## EFI EDK2 Redfish Client Framework
-The functionality of each block in the diagrams are described in belwo 
sections,
+The functionality of each block in the diagrams are described in below 
sections,
 
 ### EDK2 Redfish Foundation ***[[1]](#[0])***
 EDK2 Redfish Redfish Foundation provides the facilities of communicating with
@@ -68,7 +68,7 @@ project.
 
 ### EDK2 Redfish JSON Schema to C Structure Convertor ***[[3]](#[0])***
 This is the script auto-generated EDK2 drivers and libraries that provide the
-Redfish schema naming based JSON to C structure and vise versa converters. C
+Redfish schema naming based JSON to C structure and vice versa converters. C
 structure is another representation of Redfish properties other than JSON and
 CSDL(XML). The higher layer Redfish client application can deal with C 
structure
 instead of using JSON library to manipulate Redfish properties. The script
@@ -85,7 +85,7 @@ sits between **JSON Schema to C Structure converters** and 
**EFI Platform
 Configuration to Redfish Protocol**. The Redfish feature driver gets and sets
 the platform configuration and incorporates it with Redfish JSON schema C
 structure to manipulate Redfish JSON resources. Then applies the settings from
-Redfish service to platform configurations, or vise versa to update platform
+Redfish service to platform configurations, or vice versa to update platform
 configurations to Redfish service. Both EDK2 Redfish Non-Collection and
 Collection Feature drivers are script auto-generated base on Redfish schema
 naming. The EDK2 Redfish Non-Collection feature driver manages the resource of
-- 
2.32.0 (Apple Git-132)



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




[edk2-devel] [PATCH v2 4/6] RedfishClientPkg: fix memory leak during EFI variables write.

2023-08-29 Thread Mike Maslenkin
Signed-off-by: Mike Maslenkin 
---
 .../RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c   | 6 +-
 RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c| 6 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c 
b/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c
index 86684cc72e1e..6a72afed8715 100644
--- a/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c
+++ b/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c
@@ -424,7 +424,11 @@ SaveConfigLangMapList (
 gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, 
VARIABLE_ATTRIBUTE_NV_BS, 0, NULL);
   }
 
-  return gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, 
VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
+  Status = gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, 
VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
+
+  FreePool (VarData);
+
+  return Status;
 }
 
 /**
diff --git a/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c 
b/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c
index 7ac6e885dea6..a892ced984c8 100644
--- a/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c
+++ b/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c
@@ -411,7 +411,11 @@ SaveETagList (
 gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, 
VARIABLE_ATTRIBUTE_NV_BS, 0, NULL);
   }
 
-  return gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, 
VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
+  Status = gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, 
VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
+
+  FreePool (VarData);
+
+  return Status;
 }
 
 /**
-- 
2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108082): https://edk2.groups.io/g/devel/message/108082
Mute This Topic: https://groups.io/mt/101027006/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/6] RedfishClientPkg: fix crash on access to uninialized list variable.

2023-08-29 Thread Mike Maslenkin
Signed-off-by: Mike Maslenkin 
---
 RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
index b9c799e07684..a1738de46fdf 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
@@ -97,6 +97,8 @@ RedfishConsumeResourceCommon (
   if (BiosCs->Attributes == NULL) {
 BiosCs->Attributes = AllocateZeroPool (sizeof 
(RedfishBios_V1_0_9_Attributes_CS));
 ASSERT (BiosCs->Attributes != NULL);
+// initialize list
+BiosCs->Attributes->Prop.ForwardLink = &BiosCs->Attributes->Prop;
   }
 
   //
-- 
2.32.0 (Apple Git-132)



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




[edk2-devel] [PATCH v2 3/6] RedfishClientPkg: fix leak of allocated Etag data

2023-08-29 Thread Mike Maslenkin
Signed-off-by: Mike Maslenkin 
---
 RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c   | 4 
 .../Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c| 4 
 RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c   | 4 
 3 files changed, 12 insertions(+)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index f5562fb49cab..32dca964aa0a 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -220,6 +220,10 @@ RedfishResourceConsumeResource (
 Private->Json = NULL;
   }
 
+  if (Etag != NULL) {
+FreePool (Etag);
+  }
+
   return Status;
 }
 
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
index 91968dbe488f..5c2a4eadf2f4 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
@@ -164,6 +164,10 @@ RedfishResourceConsumeResource (
 Private->Json = NULL;
   }
 
+  if (Etag != NULL) {
+FreePool (Etag);
+  }
+
   return Status;
 }
 
diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c 
b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
index c55a6848c74e..f34f3266f1ee 100644
--- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
+++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
@@ -164,6 +164,10 @@ RedfishResourceConsumeResource (
 Private->Json = NULL;
   }
 
+  if (Etag != NULL) {
+FreePool (Etag);
+  }
+
   return Status;
 }
 
-- 
2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108081): https://edk2.groups.io/g/devel/message/108081
Mute This Topic: https://groups.io/mt/101027005/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/6] RedfishClientPkg: fix access to uninitialized variable

2023-08-29 Thread Mike Maslenkin
This patch fixes access to uninitialized variable, causing ASSERT from
FreePool at least.

Before this patch RedfishSettingsResponse was initialized by
GetResourceByUri under 'if (JsonValue != NULL)' condition.
But freed under 'if (Private->Payload != NULL)' condition.
Thus uninitialized pointers caused ASSERT on attempt to free memory.

Signed-off-by: Mike Maslenkin 
---
 RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index e7ac8779581c..f5562fb49cab 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -128,6 +128,8 @@ RedfishResourceConsumeResource (
 return Status;
   }
 
+  ZeroMem (&RedfishSettingsResponse, sizeof (REDFISH_RESPONSE));
+
   ExpectedResponse   = &Response;
   RedfishSettingsUri = NULL;
   JsonValue  = RedfishJsonInPayload (Response.Payload);
-- 
2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108080): https://edk2.groups.io/g/devel/message/108080
Mute This Topic: https://groups.io/mt/101027004/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/6] RedfishClientPkg: fix issues with local variables.

2023-08-29 Thread Mike Maslenkin
This patchset contains fixes that resolve crashes while working with
uninitialized variables and a number of fixes for leaked memory.

Diff from v1:
 fixed uncrustify check fail for patch 3
 added patch 6.

Corresponding PR
https://github.com/tianocore/edk2-redfish-client/pull/46

Cc: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Signed-off-by: Mike Maslenkin 



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




Re: [edk2-devel] [PATCH 0/5] RedfishClientPkg: fix issues with local variables.

2023-08-29 Thread Nickle Wang via groups.io
Hi Mike,

Yes, if you don't mind, please send v2 patch set for community review.

Thanks,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Tuesday, August 29, 2023 7:19 AM
> To: devel@edk2.groups.io; Nickle Wang 
> Cc: abner.ch...@amd.com; ig...@ami.com
> Subject: Re: [edk2-devel] [PATCH 0/5] RedfishClientPkg: fix issues with local
> variables.
>
> External email: Use caution opening links or attachments
>
>
> Hi Nickle,
>
> I incorporated changes required for uncrustify check.
> Also I added additional patch with trivial spelling fixes. Do I need to 
> resend v.2 to
> the list?
>
> Regards,
> Mike.
>
> On Mon, Aug 28, 2023 at 12:03 PM Nickle Wang via groups.io
>  wrote:
> >
> > Hi Mike,
> >
> > > I didn't find any codyng-style issues in uncrustify output.
> >
> > I fetch your branch and run uncrustify tool to fix error in vs code editor. 
> > I push
> the fix to your branch at this commit for your reference:
> https://github.co/
> m%2Fghbaccount%2Fedk2-redfish-
> client%2Fcommit%2Ff22209f7bd5946168326a3197006d92856247d35&data=05
> %7C01%7Cnicklew%40nvidia.com%7Cd987118958794ea8bc9608dba81d308e%7
> C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638288615556969633%7
> CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6
> Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=S2IV%2B5NbPjC40SJ1
> o0SUJLlDzeCoyiqGAHLYH%2Fg%2F0%2FA%3D&reserved=0 The uncrustify check
> on PR is now passed successfully. My commit breaks patch check as expected,
> please incorporate my changes with yours and do a force push to this PR again.
> >
> > For the way of fixing uncrustify error, I am using the instructions
> > here:
> > https://gith/
> > ub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FEDK-II-Code-Formatti
> > ng%23recommended-usage-visual-studio-vs-code-
> plugin&data=05%7C01%7Cnic
> >
> klew%40nvidia.com%7Cd987118958794ea8bc9608dba81d308e%7C43083d1572
> 7340c
> >
> 1b7db39efd9ccc17a%7C0%7C0%7C638288615556969633%7CUnknown%7CTWF
> pbGZsb3d
> >
> 8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D
> %7C
> >
> 3000%7C%7C%7C&sdata=qVkcSqm9RB8TciZqDBWuwkrPQsoMXLlS9ObWeVMk%
> 2BEg%3D&r
> > eserved=0
> >
> > Thanks,
> > Nickle
> >
> > > -Original Message-
> > > From: Mike Maslenkin 
> > > Sent: Sunday, August 27, 2023 6:57 PM
> > > To: devel@edk2.groups.io
> > > Cc: abner.ch...@amd.com; Nickle Wang ;
> > > ig...@ami.com; Mike Maslenkin 
> > > Subject: [PATCH 0/5] RedfishClientPkg: fix issues with local variables.
> > >
> > > External email: Use caution opening links or attachments
> > >
> > >
> > > This patchset contains fixes that resolve crashes while working with
> > > uninitialized variables and a number of fixes for of leaked memory.
> > > Note: looks like uncrustify check is broken at
> > > tianocore/edk2-redfish-client repo, the corresponding PR failed:
> > > https://gi/
> > >
> thub.co%2F&data=05%7C01%7Cnicklew%40nvidia.com%7Cd987118958794ea8b
> c9
> > >
> 608dba81d308e%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C63828
> 8615
> > >
> 556969633%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2
> luMz
> > >
> IiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=37M4Ew20
> MNry1
> > > 8V6m1K%2FfKTazjM1ZORlVyvZgtroeRU%3D&reserved=0
> > > m%2Ftianocore%2Fedk2-redfish-
> > >
> client%2Fpull%2F46&data=05%7C01%7Cnicklew%40nvidia.com%7C7cf336153fb
> > >
> f4e2e821008dba6ec62e0%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0
> > >
> %7C638287306436105158%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
> > >
> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C
> > >
> &sdata=VUxJA017msZzRYd%2FAxi0KeZvLi2s0QI6uKgHsOuDdws%3D&reserved=0
> > >
> > > I didn't find any codyng-style issues in uncrustify output.
> > >
> > > Cc: Abner Chang 
> > > Cc: Nickle Wang 
> > > Cc: Igor Kulchytskyy 
> > > Signed-off-by: Mike Maslenkin 
> >
> >
> >
> > 
> >
> >


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