Re: [edk2-devel] [PATCH] MdeModulePkg/SMM: Support to unregister SMI handler inside SMI handler

2024-03-06 Thread Zhiguang Liu
Hi Laszlo,

We talked about how to unregister SMI handler inside other SMI handler.
And the conclusion was there is no such usage so we don't need support it.
However, I find some platform does need to unregister SMI handler inside other 
SMI handler.

The design you introduced below is great to meet the needs.
If you don't have time to implement and have no concern, I can implement your 
design and send the patch out.

Thanks
Zhiguang

> -Original Message-
> From: Laszlo Ersek 
> Sent: Thursday, January 25, 2024 6:48 PM
> To: devel@edk2.groups.io; Liu, Zhiguang 
> Cc: Liming Gao ; Wu, Jiaxin
> ; Ni, Ray ; Ard Biesheuvel
> ; Sami Mujawar 
> Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/SMM: Support to
> unregister SMI handler inside SMI handler
> 
> On 1/24/24 05:03, Zhiguang Liu wrote:
> > To support unregister SMI handler inside SMI handler itself, get next
> > node before SMI handler is executed, since LIST_ENTRY that Link points
> > to may be freed if unregister SMI handler in SMI handler itself.
> >
> > Cc: Liming Gao 
> > Cc: Jiaxin Wu 
> > Cc: Ray Ni 
> > Signed-off-by: Zhiguang Liu 
> > ---
> >  MdeModulePkg/Core/PiSmmCore/Smi.c | 8 +++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/MdeModulePkg/Core/PiSmmCore/Smi.c
> > b/MdeModulePkg/Core/PiSmmCore/Smi.c
> > index 2985f989c3..a75e52b1ae 100644
> > --- a/MdeModulePkg/Core/PiSmmCore/Smi.c
> > +++ b/MdeModulePkg/Core/PiSmmCore/Smi.c
> > @@ -134,8 +134,14 @@ SmiManage (
> >
> >Head = >SmiHandlers;
> >
> > -  for (Link = Head->ForwardLink; Link != Head; Link =
> > Link->ForwardLink) {
> > +  for (Link = Head->ForwardLink; Link != Head;) {
> >  SmiHandler = CR (Link, SMI_HANDLER, Link, SMI_HANDLER_SIGNATURE);
> > +//
> > +// To support unregiser SMI handler inside SMI handler itself,
> > +// get next node before handler is executed, since LIST_ENTRY that
> > +// Link points to may be freed if unregister SMI handler.
> > +//
> > +Link = Link->ForwardLink;
> >
> >  Status = SmiHandler->Handler (
> > (EFI_HANDLE)SmiHandler,
> 
> I've had a further thought here.
> 
> (1) This patch may enable an SMI handler to unregister *itself*, that is,
> through the following call chain
> 
>   SmiManage()
> SmiHandler->Handler()
>   SmiHandlerUnRegister()
> 
> but it still does not ensure *general iterator safety*.
> 
> Assume that an SMM driver registers two handlers, handler A and handler B.
> Assume the DispatchHandles for these are stored in global variables in the
> driver. Then, assume that "handler A" (for whatever reason, under some
> circumstances) unregisters "handler B".
> 
> That could still lead to a use-after-free in the SmiManage() loop; is that 
> right?
> 
> If that driver scenario is plausible, then something like the following would 
> be
> needed:
> 
> - a global variable of enum type in "MdeModulePkg/Core/PiSmmCore/Smi.c",
> with three possible values (NotManaging=0, Managing=1, CleanupNeeded=2).
> 
> - a new "BOOLEAN Deleted" field in SMI_HANDLER
> 
> - all loops in "Smi.c" iterating over SMI_HANDLERs would have to skip handlers
> that have been marked as Deleted
> 
> - in SmiManage(), set the state to Managing (=1) before the loop. After the
> loop, check if the state is CleanupNeeded (=2); if so, add an extra pass for
> actually deleting SMI_HANDLERs from the list that have been marked Deleted.
> Finally (regardless of the state being Managing (=1) or CleanupNeeded (=2)),
> reset the state to NotManaging (=0).
> 
> - in SmiHandlerUnRegister(), if the state is NotManaging (=0), delete the
> handler immediately. Otherwise (i.e., when the state is Managing
> (=1) or CleanupNeeded (=2)), set the state to CleanupNeeded (=2), and only
> mark the handler as Deleted.
> 
> The idea is to inform SmiHandlerUnRegister() whether it's running or not
> running on the stack of SmiManage(), and to postpone SMI_HANDLER
> deletion until after the loop finishes in the former case.
> 
> I'm not sure if real life SmiHandlerUnRegister() usage is worth this
> complication, however.
> 
> (2) Independently: does the same issue exist for the StMM core? I seem to be
> discovering the same problem in MmiManage()
> [StandaloneMmPkg/Core/Mmi.c].
> 
> So, whatever patch we add to the SMM_CORE, should likely be reflected to
> MM_CORE_STANDALONE too. Adding Ard and Sami to the CC list.
> 
> Thanks
> Laszlo



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




Re: [edk2-devel] [edk2-redfish-client][PATCH 2/2] RedfishClientPkg: Remove unused header files.

2024-03-06 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abner Chang 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Nickle
> Wang via groups.io
> Sent: Wednesday, March 6, 2024 10:11 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> 
> Subject: [edk2-devel] [edk2-redfish-client][PATCH 2/2] RedfishClientPkg:
> Remove unused header files.
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> stdarg.h and stdio.h are not used in RedfishClientPkg.
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> ---
>  RedfishClientPkg/PrivateInclude/Crt/stdarg.h | 14 --
>  RedfishClientPkg/PrivateInclude/Crt/stdio.h  | 14 --
>  2 files changed, 28 deletions(-)
>  delete mode 100644 RedfishClientPkg/PrivateInclude/Crt/stdarg.h
>  delete mode 100644 RedfishClientPkg/PrivateInclude/Crt/stdio.h
>
> diff --git a/RedfishClientPkg/PrivateInclude/Crt/stdarg.h
> b/RedfishClientPkg/PrivateInclude/Crt/stdarg.h
> deleted file mode 100644
> index 5f458c0a4..0
> --- a/RedfishClientPkg/PrivateInclude/Crt/stdarg.h
> +++ /dev/null
> @@ -1,14 +0,0 @@
> -/** @file
> -  Include file to support building the third-party jansson library.
> -
> - (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> -
> -SPDX-License-Identifier: BSD-2-Clause-Patent
> -
> -**/
> -#ifndef REDFISH_CLIENT_CRT_STDARG_H_
> -#define REDFISH_CLIENT_CRT_STDARG_H_
> -
> -#include 
> -
> -#endif
> diff --git a/RedfishClientPkg/PrivateInclude/Crt/stdio.h
> b/RedfishClientPkg/PrivateInclude/Crt/stdio.h
> deleted file mode 100644
> index 30a0afae6..0
> --- a/RedfishClientPkg/PrivateInclude/Crt/stdio.h
> +++ /dev/null
> @@ -1,14 +0,0 @@
> -/** @file
> -  Include file to support building the third-party jansson library.
> -
> - (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> -
> -SPDX-License-Identifier: BSD-2-Clause-Patent
> -
> -**/
> -#ifndef REDFISH_CLIENT_CRT_STDIO_H_
> -#define REDFISH_CLIENT_CRT_STDIO_H_
> -
> -#include 
> -
> -#endif
> --
> 2.34.1
>
>
>
> 
>



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




Re: [edk2-devel] Topics for March TianoCore Community Meeting

2024-03-06 Thread Michael D Kinney
Meeting canceled this month.

No agenda topics received.

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Michael
> D Kinney
> Sent: Tuesday, March 5, 2024 11:08 PM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D 
> Subject: [edk2-devel] Topics for March TianoCore Community Meeting
> 
> Please let me know if you have any topics for the TianoCore Community
> Meeting this month.
> 
> Mike
> 
> 
> 
> 
> 



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




[edk2-devel] Cancelled Event: TianoCore Community Meeting - APAC/NAMO - Thursday, March 7, 2024 #cal-cancelled

2024-03-06 Thread Group Notification
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Groups.io Inc//Groups.io Calendar//EN
METHOD:CANCEL
REFRESH-INTERVAL;VALUE=DURATION:PT1H
X-PUBLISHED-TTL:PT1H
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
LAST-MODIFIED:20231222T233358Z
TZURL:https://www.tzurl.org/zoneinfo-outlook/America/Los_Angeles
X-LIC-LOCATION:America/Los_Angeles
BEGIN:DAYLIGHT
TZNAME:PDT
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
DTSTART:19700308T02
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:PST
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
DTSTART:19701101T02
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
X-GIOIDS:Event:2159762 
UID:ybft.1625609771060160028.z...@groups.io
DTSTAMP:20240307T044203Z
ORGANIZER;CN=Miki Demeter;SENT-BY="mailto:devel@edk2.groups.io":mailto:de
 v...@edk2.groups.io
DTSTART:20240308T033000Z
DTEND:20240308T043000Z
SUMMARY:TianoCore Community Meeting - APAC/NAMO
DESCRIPTION:_
 ___\n\nMicrosoft Teams meeting\n\n*Join on your computer 
 or mobile app*\n\nClick here to join the meeting ( https://teams.microsof
 t.com/l/meetup-join/19%3ameeting_Y2M1NDE3ODYtN2M3Yy00MDMxLTk3OWYtMTlkNjhl
 NWFlMjA2%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 )\n\nMeeting ID: 283 318 374 436\nPasscode: 633zLo\n\nDownload Teams (
  https://www.microsoft.com/en-us/microsoft-teams/download-app ) | Join on
  the web ( https://www.microsoft.com/microsoft-teams/join-a-meeting )\n\n
 *Join with a video conferencing device*\n\nte...@conf.intel.com\n\nVideo 
 Conference ID: 119 493 012 8\n\nAlternate VTC instructions ( https://conf
 .intel.com/teams/?conf=1194930128=teams=conf.intel.com=test_ca
 ll )\n\nLearn More ( https://aka.ms/JoinTeamsMeeting ) | Meeting options 
 ( https://teams.microsoft.com/meetingOptions/?organizerId=6e4ce4c4-1242-4
 31b-9a51-92cd01a5df3c=46c98d88-e344-4ed4-8496-4ed7712e255d
 dId=19_meeting_Y2M1NDE3ODYtN2M3Yy00MDMxLTk3OWYtMTlkNjhlNWFlMjA2@thread.v2
 =0=en-US )\n\n
 
LOCATION:https://teams.microsoft.com/l/meetup-join/19%3ameeting_Y2M1NDE3O
 DYtN2M3Yy00MDMxLTk3OWYtMTlkNjhlNWFlMjA2%40thread.v2/0?context=%7b%22Tid%2
 2%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-
 1242-431b-9a51-92cd01a5df3c%22%7d
SEQUENCE:1
STATUS:CANCELLED
END:VEVENT
END:VCALENDAR


invite.ics
Description: application/ics


Re: [edk2-devel] [edk2-redfish-client][PATCH v3 2/2] RedfishClientPkg/Edk2RedfishResourceConfigLib: support config2 protocol

2024-03-06 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Thursday, March 7, 2024 11:24 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> ; Nick Ramirez 
> Subject: [edk2-redfish-client][PATCH v3 2/2]
> RedfishClientPkg/Edk2RedfishResourceConfigLib: support config2 protocol
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> -Support Redfish resource config2 protocol in Edk2RedfishResourceConfigLib.
> This library will try Redfish resource config2 protocol first. And if
> there is no matching protocol found, Redfish resource config protocol will
> be used.
> -Because EdkIIRedfishResourceConfigLib is updated to support Redfish
> resource config2 protocol, update corresponding functions in feature
> drivers.
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nick Ramirez 
> ---
>  .../EdkIIRedfishResourceConfigLib.inf |   4 +-
>  .../Library/EdkIIRedfishResourceConfigLib.h   |  33 +-
>  .../EdkIIRedfishResourceConfigInternal.h  |  44 ++
>  .../Features/Bios/v1_0_9/Common/BiosCommon.c  |  14 +-
>  .../BootOptionCollectionDxe.c |  14 +-
>  .../ComputerSystemCollectionDxe.c |  16 +-
>  .../MemoryCollectionDxe/MemoryCollectionDxe.c |  16 +-
>  .../EdkIIRedfishResourceConfigLib.c   | 391 ++
>  8 files changed, 415 insertions(+), 117 deletions(-)
>  create mode 100644
> RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourc
> eConfigInternal.h
>
> diff --git
> a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishReso
> urceConfigLib.inf
> b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishReso
> urceConfigLib.inf
> index 2d10445f0..998a05c80 100644
> ---
> a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishReso
> urceConfigLib.inf
> +++
> b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishReso
> urceConfigLib.inf
> @@ -22,6 +22,7 @@
>  #
>
>  [Sources]
> +  EdkIIRedfishResourceConfigInternal.h
>EdkIIRedfishResourceConfigLib.c
>
>  [Packages]
> @@ -42,8 +43,9 @@
>RedfishHttpLib
>
>  [Protocols]
> -  gEdkIIRedfishResourceConfigProtocolGuid   ## CONSUMES ##
> +  gEdkIIRedfishResourceConfigProtocolGuid ## CONSUMES ##
>gEdkIIRedfishFeatureInterchangeDataProtocolGuid ## CONSUMES ##
> +  gEdkIIRedfishResourceConfig2ProtocolGuid## CONSUEMS ##
>
>  [Pcd]
>gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize
> diff --git a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
> b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
> index 3aa953cec..57c7f2b80 100644
> --- a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
> +++ b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
> @@ -16,6 +16,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>
>  /**
> @@ -23,6 +24,7 @@
>
>@param[in]   Schema  Redfish schema information.
>@param[in]   Uri Target URI to create resource.
> +  @param[in]   JsonTextThe JSON data in ASCII string format. 
> This is
> optional.
>@param[in]   InformationExchange Pointer to
> RESOURCE_INFORMATION_EXCHANGE.
>@param[in]   HttpPostModeTRUE if resource does not exist, HTTP POST
> method is used.
> FALSE if the resource exist but some of 
> properties are
> missing,
> @@ -33,9 +35,11 @@
>
>  **/
>  EFI_STATUS
> +EFIAPI
>  EdkIIRedfishResourceConfigProvisioning (
>IN REDFISH_SCHEMA_INFO*Schema,
>IN EFI_STRING Uri,
> +  IN CHAR8  *JsonText OPTIONAL,
>IN RESOURCE_INFORMATION_EXCHANGE  *InformationExchange,
>IN BOOLEANHttpPostMode
>);
> @@ -45,15 +49,18 @@ EdkIIRedfishResourceConfigProvisioning (
>
>@param[in]   Schema  Redfish schema information.
>@param[in]   Uri The target URI to consume.
> +  @param[in]   JsonTextThe JSON data in ASCII string format. 
> This is
> optional.
>
>@retval EFI_SUCCESS  Value is returned successfully.
>@retval Others   Some error happened.
>
>  **/
>  EFI_STATUS
> +EFIAPI
>  EdkIIRedfishResourceConfigConsume (
>IN REDFISH_SCHEMA_INFO  *Schema,
> -  IN EFI_STRING   Uri
> +  IN EFI_STRING   Uri,
> +  IN CHAR8*JsonText OPTIONAL
>);
>
>  /**
> @@ -61,21 +68,25 @@ EdkIIRedfishResourceConfigConsume (
>
>@param[in]   Schema  Redfish schema information.
>@param[in]   Uri The target URI to consume.
> +  @param[in]   JsonTextThe JSON data in ASCII string format. 
> This is
> optional.
>
>@retval EFI_SUCCESS  

Re: [edk2-devel] [edk2-redfish-client][PATCH v3 1/2] RedfishClientPkg: introduce Redfish resource config2 protocol.

2024-03-06 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Thursday, March 7, 2024 11:24 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> ; Nick Ramirez 
> Subject: [edk2-redfish-client][PATCH v3 1/2] RedfishClientPkg: introduce
> Redfish resource config2 protocol.
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Introduce EDKII Redfish Resource Config2 Protocol. Comparing to
> Redfish Resource Config Protocol, this protocol adds new parameter
> called "JsonText". This allows Redfish caller driver to pass JSON
> context to callee. Callee save the effort of getting same data from
> Redfish service again. This is useful when Redfish service supports
> "expand" query parameter. "Version" is added to this protocol too so
> we don't create new protocol to add new parameter in the future.
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nick Ramirez 
> ---
>  RedfishClientPkg/RedfishClientPkg.dec |   2 +
>  .../EdkIIRedfishResourceConfig2Protocol.h | 158 ++
>  2 files changed, 160 insertions(+)
>  create mode 100644
> RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
>
> diff --git a/RedfishClientPkg/RedfishClientPkg.dec
> b/RedfishClientPkg/RedfishClientPkg.dec
> index aa018d714..f894f30ab 100644
> --- a/RedfishClientPkg/RedfishClientPkg.dec
> +++ b/RedfishClientPkg/RedfishClientPkg.dec
> @@ -48,6 +48,8 @@
>gEdkIIRedfishResourceAddendumProtocolGuid = { 0xda36b12b, 0xaad4,
> 0x4e90, { 0xba, 0xcb, 0xe3, 0xb5, 0x3b, 0x08, 0xbc, 0x54 } }
>## Include/Protocol/EdkIIRedfishOverrideProtocol.h
>gEdkiiRedfishOverrideProtocolGuid = { 0xb55bef20, 0xf7c8, 0x4ae9,
> { 0xa7, 0xca, 0x8b, 0xba, 0x9f, 0x7b, 0xbf, 0x9c } }
> +  ## Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
> +  gEdkIIRedfishResourceConfig2ProtocolGuid  = { 0xe9bef87f, 0xbff4,
> 0x4872, { 0xa9, 0xa4, 0x16, 0x59, 0xbe, 0xd9, 0x1c, 0xf4 } }
>
>  [Guids]
>## Include/Guid/RedfishClientPkgTokenSpace.h
> diff --git
> a/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
> b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
> new file mode 100644
> index 0..a0613048b
> --- /dev/null
> +++
> b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
> @@ -0,0 +1,158 @@
> +/** @file
> +  This file defines the EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL
> interface.
> +
> +  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef EDKII_REDFISH_RESOURCE_CONFIG2_H_
> +#define EDKII_REDFISH_RESOURCE_CONFIG2_H_
> +
> +#include 
> +
> +typedef struct _EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL
> EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL;
> +
> +/**
> +  Provision redfish resource by given URI.
> +
> +  @param[in]   ThisPointer to
> EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
> +  @param[in]   Uri Target URI to create resource.
> +  @param[in]   JsonTextThe additional JSON data in ASCII string 
> format
> passed to callee.
> +   The usage is defined between the Redfish 
> feature driver and
> subordinate
> +   Redfish resource feature driver.
> +  @param[in]   HttpPostModeTRUE if resource does not exist, HTTP POST
> method is used.
> +   FALSE if the resource exist but some of 
> properties are
> missing,
> +   HTTP PUT method is used.
> +
> +  @retval EFI_SUCCESS  Value is returned successfully.
> +  @retval Others   Some error happened.
> +
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_PROVISIONING)(
> +  IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL  *This,
> +  IN EFI_STRING   Uri,
> +  IN CHAR8*JsonText OPTIONAL,
> +  IN BOOLEAN  HttpPostMode
> +  );
> +
> +/**
> +  Consume resource from given URI.
> +
> +  @param[in]   ThisPointer to
> EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
> +  @param[in]   Uri The target URI to consume.
> +  @param[in]   JsonTextThe additional JSON data in ASCII string 
> format
> passed to callee.
> +   The usage is defined between the Redfish 
> feature driver and
> subordinate
> +   Redfish resource feature driver.
> +
> +  @retval EFI_SUCCESS  Value is returned successfully.
> +  @retval Others   Some error happened.
> +
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI 

[edk2-devel] Event: TianoCore Community Meeting - APAC/NAMO - Thursday, March 7, 2024 #cal-reminder

2024-03-06 Thread Group Notification
*Reminder: TianoCore Community Meeting - APAC/NAMO*

*When:*
Thursday, March 7, 2024
7:30pm to 8:30pm
(UTC-08:00) America/Los Angeles

*Where:*
https://teams.microsoft.com/l/meetup-join/19%3ameeting_Y2M1NDE3ODYtN2M3Yy00MDMxLTk3OWYtMTlkNjhlNWFlMjA2%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:* Miki Demeter

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

*Description:*



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_Y2M1NDE3ODYtN2M3Yy00MDMxLTk3OWYtMTlkNjhlNWFlMjA2%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
 )

Meeting ID: 283 318 374 436
Passcode: 633zLo

Download Teams ( https://www.microsoft.com/en-us/microsoft-teams/download-app ) 
| Join on the web ( https://www.microsoft.com/microsoft-teams/join-a-meeting )

*Join with a video conferencing device*

te...@conf.intel.com

Video Conference ID: 119 493 012 8

Alternate VTC instructions ( 
https://conf.intel.com/teams/?conf=1194930128=teams=conf.intel.com=test_call
 )

Learn More ( https://aka.ms/JoinTeamsMeeting ) | Meeting options ( 
https://teams.microsoft.com/meetingOptions/?organizerId=6e4ce4c4-1242-431b-9a51-92cd01a5df3c=46c98d88-e344-4ed4-8496-4ed7712e255d=19_meeting_Y2M1NDE3ODYtN2M3Yy00MDMxLTk3OWYtMTlkNjhlNWFlMjA2@thread.v2=0=en-US
 )




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




[edk2-devel] [edk2-redfish-client][PATCH v3 2/2] RedfishClientPkg/Edk2RedfishResourceConfigLib: support config2 protocol

2024-03-06 Thread Nickle Wang via groups.io
-Support Redfish resource config2 protocol in Edk2RedfishResourceConfigLib.
This library will try Redfish resource config2 protocol first. And if
there is no matching protocol found, Redfish resource config protocol will
be used.
-Because EdkIIRedfishResourceConfigLib is updated to support Redfish
resource config2 protocol, update corresponding functions in feature
drivers.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../EdkIIRedfishResourceConfigLib.inf |   4 +-
 .../Library/EdkIIRedfishResourceConfigLib.h   |  33 +-
 .../EdkIIRedfishResourceConfigInternal.h  |  44 ++
 .../Features/Bios/v1_0_9/Common/BiosCommon.c  |  14 +-
 .../BootOptionCollectionDxe.c |  14 +-
 .../ComputerSystemCollectionDxe.c |  16 +-
 .../MemoryCollectionDxe/MemoryCollectionDxe.c |  16 +-
 .../EdkIIRedfishResourceConfigLib.c   | 391 ++
 8 files changed, 415 insertions(+), 117 deletions(-)
 create mode 100644 
RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigInternal.h

diff --git 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
index 2d10445f0..998a05c80 100644
--- 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
+++ 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
@@ -22,6 +22,7 @@
 #
 
 [Sources]
+  EdkIIRedfishResourceConfigInternal.h
   EdkIIRedfishResourceConfigLib.c
 
 [Packages]
@@ -42,8 +43,9 @@
   RedfishHttpLib
 
 [Protocols]
-  gEdkIIRedfishResourceConfigProtocolGuid   ## CONSUMES ##
+  gEdkIIRedfishResourceConfigProtocolGuid ## CONSUMES ##
   gEdkIIRedfishFeatureInterchangeDataProtocolGuid ## CONSUMES ##
+  gEdkIIRedfishResourceConfig2ProtocolGuid## CONSUEMS ##
 
 [Pcd]
   gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize
diff --git a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h 
b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
index 3aa953cec..57c7f2b80 100644
--- a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
+++ b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 /**
@@ -23,6 +24,7 @@
 
   @param[in]   Schema  Redfish schema information.
   @param[in]   Uri Target URI to create resource.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
   @param[in]   InformationExchange Pointer to RESOURCE_INFORMATION_EXCHANGE.
   @param[in]   HttpPostModeTRUE if resource does not exist, HTTP POST 
method is used.
FALSE if the resource exist but some of 
properties are missing,
@@ -33,9 +35,11 @@
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigProvisioning (
   IN REDFISH_SCHEMA_INFO*Schema,
   IN EFI_STRING Uri,
+  IN CHAR8  *JsonText OPTIONAL,
   IN RESOURCE_INFORMATION_EXCHANGE  *InformationExchange,
   IN BOOLEANHttpPostMode
   );
@@ -45,15 +49,18 @@ EdkIIRedfishResourceConfigProvisioning (
 
   @param[in]   Schema  Redfish schema information.
   @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
 
   @retval EFI_SUCCESS  Value is returned successfully.
   @retval Others   Some error happened.
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigConsume (
   IN REDFISH_SCHEMA_INFO  *Schema,
-  IN EFI_STRING   Uri
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
   );
 
 /**
@@ -61,21 +68,25 @@ EdkIIRedfishResourceConfigConsume (
 
   @param[in]   Schema  Redfish schema information.
   @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
 
   @retval EFI_SUCCESS  Value is returned successfully.
   @retval Others   Some error happened.
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigUpdate (
   IN REDFISH_SCHEMA_INFO  *Schema,
-  IN EFI_STRING   Uri
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
   );
 
 /**
   Check resource on given URI.
 
   @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
 
   @retval EFI_SUCCESS  Value is returned successfully.
   @retval EFI_UNSUPPORTED  This resource is not owned by feature 
driver.
@@ -84,9 +95,11 @@ 

[edk2-devel] [edk2-redfish-client][PATCH v3 1/2] RedfishClientPkg: introduce Redfish resource config2 protocol.

2024-03-06 Thread Nickle Wang via groups.io
Introduce EDKII Redfish Resource Config2 Protocol. Comparing to
Redfish Resource Config Protocol, this protocol adds new parameter
called "JsonText". This allows Redfish caller driver to pass JSON
context to callee. Callee save the effort of getting same data from
Redfish service again. This is useful when Redfish service supports
"expand" query parameter. "Version" is added to this protocol too so
we don't create new protocol to add new parameter in the future.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 RedfishClientPkg/RedfishClientPkg.dec |   2 +
 .../EdkIIRedfishResourceConfig2Protocol.h | 158 ++
 2 files changed, 160 insertions(+)
 create mode 100644 
RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h

diff --git a/RedfishClientPkg/RedfishClientPkg.dec 
b/RedfishClientPkg/RedfishClientPkg.dec
index aa018d714..f894f30ab 100644
--- a/RedfishClientPkg/RedfishClientPkg.dec
+++ b/RedfishClientPkg/RedfishClientPkg.dec
@@ -48,6 +48,8 @@
   gEdkIIRedfishResourceAddendumProtocolGuid = { 0xda36b12b, 0xaad4, 0x4e90, { 
0xba, 0xcb, 0xe3, 0xb5, 0x3b, 0x08, 0xbc, 0x54 } }
   ## Include/Protocol/EdkIIRedfishOverrideProtocol.h
   gEdkiiRedfishOverrideProtocolGuid = { 0xb55bef20, 0xf7c8, 0x4ae9, { 
0xa7, 0xca, 0x8b, 0xba, 0x9f, 0x7b, 0xbf, 0x9c } }
+  ## Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
+  gEdkIIRedfishResourceConfig2ProtocolGuid  = { 0xe9bef87f, 0xbff4, 0x4872, { 
0xa9, 0xa4, 0x16, 0x59, 0xbe, 0xd9, 0x1c, 0xf4 } }
 
 [Guids]
   ## Include/Guid/RedfishClientPkgTokenSpace.h
diff --git 
a/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h 
b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
new file mode 100644
index 0..a0613048b
--- /dev/null
+++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
@@ -0,0 +1,158 @@
+/** @file
+  This file defines the EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL interface.
+
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EDKII_REDFISH_RESOURCE_CONFIG2_H_
+#define EDKII_REDFISH_RESOURCE_CONFIG2_H_
+
+#include 
+
+typedef struct _EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL;
+
+/**
+  Provision redfish resource by given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri Target URI to create resource.
+  @param[in]   JsonTextThe additional JSON data in ASCII string 
format passed to callee.
+   The usage is defined between the Redfish 
feature driver and subordinate
+   Redfish resource feature driver.
+  @param[in]   HttpPostModeTRUE if resource does not exist, HTTP POST 
method is used.
+   FALSE if the resource exist but some of 
properties are missing,
+   HTTP PUT method is used.
+
+  @retval EFI_SUCCESS  Value is returned successfully.
+  @retval Others   Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_PROVISIONING)(
+  IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL  *This,
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL,
+  IN BOOLEAN  HttpPostMode
+  );
+
+/**
+  Consume resource from given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe additional JSON data in ASCII string 
format passed to callee.
+   The usage is defined between the Redfish 
feature driver and subordinate
+   Redfish resource feature driver.
+
+  @retval EFI_SUCCESS  Value is returned successfully.
+  @retval Others   Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_CONSUME)(
+  IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL  *This,
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
+  );
+
+/**
+  Update resource to given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe additional JSON data in ASCII string 
format passed to callee.
+   The usage is defined between the Redfish 
feature driver and subordinate
+   Redfish resource feature driver.
+
+  @retval EFI_SUCCESS

[edk2-devel] [edk2-redfish-client][PATCH v3 0/2] introduce Redfish Resource Config2 protocol.

2024-03-06 Thread Nickle Wang via groups.io
v3: merge 2/3 and 3/3 in v2 together so we don't break the build.

v2: address review comment about the description of "JsonText" parameter.

Introduce EDKII Redfish Resource Config2 Protocol so that caller can 
pass Redfish data to callee when caller uses "expand" query parameter
to get multiple Redfish resources all together. Then, callee does not 
get Redfish resource from Redfish service again and save the communication
effort between BIOS and Redfish service.

EdkIIRedfishConfigLib is updated to select Redfish Resource Config2 
Protocol as first priority. If there is no Config2 protocol supported,
library will use config protocol automatically.

Pull request is created: 
https://github.com/tianocore/edk2-redfish-client/pull/80

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 

Nickle Wang (2):
  RedfishClientPkg: introduce Redfish resource config2 protocol.
  RedfishClientPkg/Edk2RedfishResourceConfigLib: support config2
protocol

 RedfishClientPkg/RedfishClientPkg.dec |   2 +
 .../EdkIIRedfishResourceConfigLib.inf |   4 +-
 .../Library/EdkIIRedfishResourceConfigLib.h   |  33 +-
 .../EdkIIRedfishResourceConfig2Protocol.h | 158 +++
 .../EdkIIRedfishResourceConfigInternal.h  |  44 ++
 .../Features/Bios/v1_0_9/Common/BiosCommon.c  |  14 +-
 .../BootOptionCollectionDxe.c |  14 +-
 .../ComputerSystemCollectionDxe.c |  16 +-
 .../MemoryCollectionDxe/MemoryCollectionDxe.c |  16 +-
 .../EdkIIRedfishResourceConfigLib.c   | 391 ++
 10 files changed, 575 insertions(+), 117 deletions(-)
 create mode 100644 
RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
 create mode 100644 
RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigInternal.h

-- 
2.34.1



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




Re: [edk2-devel] GuestPhysAddrSize questions

2024-03-06 Thread Paolo Bonzini
On Mon, Mar 4, 2024 at 6:24 PM Tom Lendacky  wrote:
>
> On 3/4/24 07:09, Gerd Hoffmann wrote:
> >Hi,
> >
> >>> 23:16 GuestPhysAddrSize Maximum guest physical address size in bits.
> >>> This number applies only to guests using 
> >>> nested
> >>> paging. When this field is zero, refer to the
> >>> PhysAddrSize field for the maximum guest
> >>> physical address size. See “Secure Virtual
> >>> Machine” in APM Volume 2.
> >
> >> I believe the main purpose of GuestPhysAddrSize was for software use (for
> >> nested virtualization) and that the hardware itself has always returned 
> >> zero
> >> for that value. So you should be able to use that field. Adding @Paolo for
> >> his thoughts.
> >
> > Reviewers mentioned this is meant for nested guests, i.e. (if I
> > understand this correctly) the l0 hypervisor can use that to tell
> > the l1 hypervisor what the l2 guest phys-bits should be.
> >
> > Is this nested virtualization use documented somewhere?  Tried to
> > search for GuestPhysAddrSize or Fn8000_0008_EAX in APM Volume 2,
> > found nothing.
>
> Right, and I don't think you'll see anything added to the APM that will
> state how it can be used by software. The APM is an architectural
> definition and won't talk about hypervisors and using nested paging, etc.

I don't think that's a problem. The problem is that the definition in
the APM is ambiguous and can mean one of three things:

1) it can be a suggested value for PhysAddrSize (bits 7:0) of guests
that use nested paging. This would imply that in a nested page guest,
with GuestPhysAddrSize=48, setting bits 51:48 would cause a
#PF(reserved) exception.

2) it can be equivalent to LinAddrSize (bits 15:8) but for nested page
tables. This would imply that, with GuestPhysAddrSize=48, VMRUN would
fail if hCR4.LA57=1.

3) it can be what I propose above: the architecture defined a
situation that can only happen when using nested paging (on AMD:
host_CR4.LA57=0, PhysAddrSize=52), and GuestPhysAddrSize is an
architectural way to explain the situation to guests.

The message above suggests that the intended meaning is (1). That is
because "the l0 hypervisor can use that to tell the l1 hypervisor what
the l2 guest phys-bits should be" is exactly the same as "the
processor can use that to tell the hypervisor what the guest phys-bits
should be" (just shifted one level down).

However, there are no processors that implement (1) or (2), so my
suggestion is to clarify that the intended meaning is (3). Do you
agree that the above proposal is a plausible interpretation of what is
already in the APM, but clearer? And do you think there is a way for
the clarification to make it into the APM?

Paolo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116465): https://edk2.groups.io/g/devel/message/116465
Mute This Topic: https://groups.io/mt/104510523/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 07/10] EmulatorPkg: auto-generate SEC ProcessLibraryConstructorList() decl

2024-03-06 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Laszlo
> Ersek
> Sent: Wednesday, March 6, 2024 1:10 PM
> To: edk2-devel-groups-io 
> Cc: Andrew Fish ; Ni, Ray 
> Subject: Re: [edk2-devel] [PATCH v2 07/10] EmulatorPkg: auto-generate
> SEC ProcessLibraryConstructorList() decl
> 
> Can I please get a quick R-b for this patch -- it's urgent because of
> .
> 
> Thank you,
> Laszlo
> 
> On 3/5/24 12:38, Laszlo Ersek wrote:
> > Rely on AutoGen for declaring ProcessLibraryConstructorList().
> >
> > Build-tested with:
> >
> >   build -a X64 -b DEBUG -m EmulatorPkg/Sec/Sec.inf \
> > -p EmulatorPkg/EmulatorPkg.dsc -t GCC5
> >
> > Cc: Andrew Fish 
> > Cc: Ray Ni 
> > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=990
> > Signed-off-by: Laszlo Ersek 
> > ---
> >  EmulatorPkg/Sec/Sec.inf | 2 +-
> >  EmulatorPkg/Sec/Sec.h   | 9 -
> >  2 files changed, 1 insertion(+), 10 deletions(-)
> >
> > diff --git a/EmulatorPkg/Sec/Sec.inf b/EmulatorPkg/Sec/Sec.inf
> > index 2f9e3d4780cc..7476094f1305 100644
> > --- a/EmulatorPkg/Sec/Sec.inf
> > +++ b/EmulatorPkg/Sec/Sec.inf
> > @@ -11,7 +11,7 @@
> >  ##
> >
> >  [Defines]
> > -  INF_VERSION= 0x00010005
> > +  INF_VERSION= 1.30
> >BASE_NAME  = EmuSec
> >FILE_GUID  = BCAF98C9-22B0-3B4F-9CBD-
> C8A6B4DBCEE9
> >MODULE_TYPE= SEC
> > diff --git a/EmulatorPkg/Sec/Sec.h b/EmulatorPkg/Sec/Sec.h
> > index 29272a29ffa5..94689eb41d35 100644
> > --- a/EmulatorPkg/Sec/Sec.h
> > +++ b/EmulatorPkg/Sec/Sec.h
> > @@ -20,15 +20,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >  #include 
> >
> > -//
> > -// I think this should be defined in a MdePkg include file?
> > -//
> > -VOID
> > -EFIAPI
> > -ProcessLibraryConstructorList (
> > -  VOID
> > -  );
> > -
> >  EFI_STATUS
> >  EFIAPI
> >  SecTemporaryRamSupport (
> >
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [edk2-platforms PATCH v2 2/4] SimicsOpenBoardPkg: auto-gen & fix SEC ProcessLibraryConstructorList() decl

2024-03-06 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 


> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Laszlo
> Ersek
> Sent: Wednesday, March 6, 2024 1:10 PM
> To: edk2-devel-groups-io 
> Cc: Desimone, Nathaniel L ; Chaganty,
> Rangasai V 
> Subject: Re: [edk2-devel] [edk2-platforms PATCH v2 2/4]
> SimicsOpenBoardPkg: auto-gen & fix SEC ProcessLibraryConstructorList()
> decl
> 
> Can I please get a quick R-b for this patch -- it's urgent because of
> .
> 
> Thank you,
> Laszlo
> 
> On 3/5/24 13:01, Laszlo Ersek wrote:
> >  declares a bogus
> > ProcessLibraryConstructorList() for SimicsOpenBoardPkg's SEC module.
> Rely
> > on AutoGen for (properly) declaring ProcessLibraryConstructorList().
> > Update the call.
> >
> > Build-tested with:
> >
> > - appending the following directories to PACKAGES_PATH:
> >
> >   Drivers
> >   Features/Intel
> >   Features/Intel/Debugging
> >   Features/Intel/Network
> >   Features/Intel/OutOfBandManagement
> >   Features/Intel/PowerManagement
> >   Features/Intel/SystemInformation
> >   Features/Intel/UserInterface
> >   Platform/Intel
> >   Silicon/Intel
> >
> > - commenting out "SimicsIch10BinPkg/UndiBinary/UndiDxe.inf" in
> >   "Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc"
> and
> >   "Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf"
> >
> > - running the command
> >
> >   build -a IA32 -a X64 -b DEBUG \
> > -m Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf \
> > -p
> Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc \
> > -t GCC5
> >
> > Cc: Nate DeSimone 
> > Cc: Sai Chaganty 
> > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=990
> > Signed-off-by: Laszlo Ersek 
> > ---
> >  Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf | 2 +-
> >  Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.c   | 3 +--
> >  2 files changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf
> b/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf
> > index af1c0f2b55d1..fcf34c0def4e 100644
> > --- a/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf
> > +++ b/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf
> > @@ -8,7 +8,7 @@
> >  ##
> >
> >  [Defines]
> > -  INF_VERSION= 0x00010005
> > +  INF_VERSION= 1.30
> >BASE_NAME  = SecMain
> >FILE_GUID  = e67f156f-54c5-47f3-a35d-
> 07c045881e14
> >MODULE_TYPE= SEC
> > diff --git a/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.c
> b/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.c
> > index 39e879e9223e..09d43c6bf63b 100644
> > --- a/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.c
> > +++ b/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.c
> > @@ -9,7 +9,6 @@
> >
> >  #include 
> >
> > -#include 
> >  #include 
> >  #include 
> >  #include 
> > @@ -738,7 +737,7 @@ SecCoreStartupWithStack (
> >  Table[Index] = 0;
> >}
> >
> > -  ProcessLibraryConstructorList (NULL, NULL);
> > +  ProcessLibraryConstructorList ();
> >
> >DEBUG ((EFI_D_INFO,
> >  "SecCoreStartupWithStack(0x%x, 0x%x)\n",
> >
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [PATCH] Maintainers.txt: remove Laszlo's entries

2024-03-06 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Laszlo
> Ersek
> Sent: Wednesday, March 6, 2024 1:06 PM
> To: edk2-devel-groups-io 
> Cc: Andrew Fish ; Ard Biesheuvel
> ; Gerd Hoffmann ; Yao,
> Jiewen ; Leif Lindholm
> ; Kinney, Michael D
> ; Kumar, Rahul R ;
> Ni, Ray ; Sami Mujawar 
> Subject: [edk2-devel] [PATCH] Maintainers.txt: remove Laszlo's entries
> 
> Red Hat and I have mutually and amicably agreed to separate. Remove my
> entries from "Maintainers.txt".
> 
> Cc: Andrew Fish 
> Cc: Ard Biesheuvel 
> Cc: Gerd Hoffmann 
> Cc: Jiewen Yao 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Cc: Rahul Kumar 
> Cc: Ray Ni 
> Cc: Sami Mujawar 
> Signed-off-by: Laszlo Ersek 
> ---
> 
> Notes:
> I'd like to merge this patch very soon, but not before merging the
> following series:
> 
> * [PATCH v2 00/10]
>   clean up ProcessLibraryConstructorList() declarations in SEC
> modules
> 
>   msgid <20240305113843.68812-1-ler...@redhat.com>
>   https://edk2.groups.io/g/devel/message/116367
> 
> * [edk2-platforms PATCH v2 0/4]
>   clean up ProcessLibraryConstructorList() declarations in SEC
> modules
> 
>   msgid <20240305120126.70259-1-ler...@redhat.com>
>   https://edk2.groups.io/g/devel/message/116378
> 
>  Maintainers.txt | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 9038f9eb3005..799f27f914ce 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -151,7 +151,6 @@ ArmVirtPkg
>  F: ArmVirtPkg/
>  W: https://github.com/tianocore/tianocore.github.io/wiki/ArmVirtPkg
>  M: Ard Biesheuvel  [ardbiesheuvel]
> -M: Laszlo Ersek  [lersek]
>  R: Leif Lindholm  [leiflindholm]
>  R: Sami Mujawar  [samimujawar]
>  R: Gerd Hoffmann  [kraxel]
> @@ -462,7 +461,6 @@ F: OvmfPkg/
>  W: http://www.tianocore.org/ovmf/
>  M: Ard Biesheuvel  [ardbiesheuvel]
>  M: Jiewen Yao  [jyao1]
> -M: Laszlo Ersek  [lersek]
>  R: Gerd Hoffmann  [kraxel]
>  S: Maintained
> 
> @@ -622,7 +620,6 @@ UefiCpuPkg
>  F: UefiCpuPkg/
>  W: https://github.com/tianocore/tianocore.github.io/wiki/UefiCpuPkg
>  M: Ray Ni  [niruiyu]
> -M: Laszlo Ersek  [lersek]
>  R: Rahul Kumar  [rahul1-kumar]
>  R: Gerd Hoffmann  [kraxel]
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116462): https://edk2.groups.io/g/devel/message/116462
Mute This Topic: https://groups.io/mt/104775206/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 01/10] pip-requirements.txt: require edk2-basetools version 0.1.51

2024-03-06 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: Laszlo Ersek 
> Sent: Wednesday, March 6, 2024 1:09 PM
> To: edk2-devel-groups-io 
> Cc: Feng, Bob C ; Joey Vagedes
> ; Liming Gao ;
> Kinney, Michael D ; Rebecca Cran
> ; Sean Brogan ; Chen,
> Christine 
> Subject: Re: [edk2-devel] [PATCH v2 01/10] pip-requirements.txt:
> require edk2-basetools version 0.1.51
> 
> Can I please get a quick R-b for this patch -- it's urgent because of
> .
> 
> Thank you,
> Laszlo
> 
> On 3/5/24 12:38, Laszlo Ersek wrote:
> > The edk2-basetools commit that corresponds to edk2 commit
> bac9c74080cf
> > ("BaseTools/AutoGen: declare ProcessLibraryConstructorList() for SEC
> > modules", 2024-02-29) is 5b7161de22ee ("BaseTools/AutoGen: declare
> > ProcessLibraryConstructorList() for SEC modules", 2024-03-04); it is
> part
> > of tag v0.1.51.
> >
> > Subsequent patches in this series put that feature to use. Require
> release
> > 0.1.51 of edk2-basetools in "pip-requirements.txt", so that the next
> > patches work with in-tree and out-of-tree (e.g., CI) BaseTools.
> >
> > Furthermore, require version 0.20.0 of edk2-pytool-library. This is a
> > dependency of edk2-basetools v0.1.50 (commit 08e5bbe755d2, "Add
> > pyproject.toml and fix setup.py deprecation warnings", 2024-02-13)
> and
> > v0.1.51 too (commit f3e15d654479, "Add pyproject.toml and fix
> setup.py
> > deprecation warnings", 2024-02-16).
> >
> > Cc: Bob Feng 
> > Cc: Joey Vagedes 
> > Cc: Liming Gao 
> > Cc: Michael D Kinney 
> > Cc: Rebecca Cran 
> > Cc: Sean Brogan 
> > Cc: Yuwei Chen 
> > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=991
> > Signed-off-by: Laszlo Ersek 
> > ---
> >  pip-requirements.txt | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/pip-requirements.txt b/pip-requirements.txt
> > index 6420078822b5..2f4cd33cc620 100644
> > --- a/pip-requirements.txt
> > +++ b/pip-requirements.txt
> > @@ -12,9 +12,9 @@
> >  # https://www.python.org/dev/peps/pep-0440/#version-specifiers
> >  ##
> >
> > -edk2-pytool-library==0.19.9
> > +edk2-pytool-library==0.20.0
> >  edk2-pytool-extensions==0.26.4
> > -edk2-basetools==0.1.48
> > +edk2-basetools==0.1.51
> >  antlr4-python3-runtime==4.7.1
> >  lcov-cobertura==2.0.2
> >  regex==2023.12.25
> >
> >
> >
> > 
> >
> >



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116461): https://edk2.groups.io/g/devel/message/116461
Mute This Topic: https://groups.io/mt/104742519/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 01/10] pip-requirements.txt: require edk2-basetools version 0.1.51

2024-03-06 Thread Rebecca Cran

Reviewed-by: Rebecca Cran 


On 3/5/2024 4:38 AM, Laszlo Ersek wrote:

The edk2-basetools commit that corresponds to edk2 commit bac9c74080cf
("BaseTools/AutoGen: declare ProcessLibraryConstructorList() for SEC
modules", 2024-02-29) is 5b7161de22ee ("BaseTools/AutoGen: declare
ProcessLibraryConstructorList() for SEC modules", 2024-03-04); it is part
of tag v0.1.51.

Subsequent patches in this series put that feature to use. Require release
0.1.51 of edk2-basetools in "pip-requirements.txt", so that the next
patches work with in-tree and out-of-tree (e.g., CI) BaseTools.

Furthermore, require version 0.20.0 of edk2-pytool-library. This is a
dependency of edk2-basetools v0.1.50 (commit 08e5bbe755d2, "Add
pyproject.toml and fix setup.py deprecation warnings", 2024-02-13) and
v0.1.51 too (commit f3e15d654479, "Add pyproject.toml and fix setup.py
deprecation warnings", 2024-02-16).

Cc: Bob Feng 
Cc: Joey Vagedes 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Rebecca Cran 
Cc: Sean Brogan 
Cc: Yuwei Chen 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=991
Signed-off-by: Laszlo Ersek 
---
  pip-requirements.txt | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pip-requirements.txt b/pip-requirements.txt
index 6420078822b5..2f4cd33cc620 100644
--- a/pip-requirements.txt
+++ b/pip-requirements.txt
@@ -12,9 +12,9 @@
  # https://www.python.org/dev/peps/pep-0440/#version-specifiers
  ##
  
-edk2-pytool-library==0.19.9

+edk2-pytool-library==0.20.0
  edk2-pytool-extensions==0.26.4
-edk2-basetools==0.1.48
+edk2-basetools==0.1.51
  antlr4-python3-runtime==4.7.1
  lcov-cobertura==2.0.2
  regex==2023.12.25





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




Re: [edk2-devel] [edk2-platforms PATCH v2 2/4] SimicsOpenBoardPkg: auto-gen & fix SEC ProcessLibraryConstructorList() decl

2024-03-06 Thread Laszlo Ersek
Can I please get a quick R-b for this patch -- it's urgent because of
.

Thank you,
Laszlo

On 3/5/24 13:01, Laszlo Ersek wrote:
>  declares a bogus
> ProcessLibraryConstructorList() for SimicsOpenBoardPkg's SEC module. Rely
> on AutoGen for (properly) declaring ProcessLibraryConstructorList().
> Update the call.
> 
> Build-tested with:
> 
> - appending the following directories to PACKAGES_PATH:
> 
>   Drivers
>   Features/Intel
>   Features/Intel/Debugging
>   Features/Intel/Network
>   Features/Intel/OutOfBandManagement
>   Features/Intel/PowerManagement
>   Features/Intel/SystemInformation
>   Features/Intel/UserInterface
>   Platform/Intel
>   Silicon/Intel
> 
> - commenting out "SimicsIch10BinPkg/UndiBinary/UndiDxe.inf" in
>   "Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc" and
>   "Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf"
> 
> - running the command
> 
>   build -a IA32 -a X64 -b DEBUG \
> -m Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf \
> -p Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc \
> -t GCC5
> 
> Cc: Nate DeSimone 
> Cc: Sai Chaganty 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=990
> Signed-off-by: Laszlo Ersek 
> ---
>  Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf | 2 +-
>  Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.c   | 3 +--
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf 
> b/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf
> index af1c0f2b55d1..fcf34c0def4e 100644
> --- a/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf
> +++ b/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf
> @@ -8,7 +8,7 @@
>  ##
>  
>  [Defines]
> -  INF_VERSION= 0x00010005
> +  INF_VERSION= 1.30
>BASE_NAME  = SecMain
>FILE_GUID  = e67f156f-54c5-47f3-a35d-07c045881e14
>MODULE_TYPE= SEC
> diff --git a/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.c 
> b/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.c
> index 39e879e9223e..09d43c6bf63b 100644
> --- a/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.c
> +++ b/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.c
> @@ -9,7 +9,6 @@
>  
>  #include 
>  
> -#include 
>  #include 
>  #include 
>  #include 
> @@ -738,7 +737,7 @@ SecCoreStartupWithStack (
>  Table[Index] = 0;
>}
>  
> -  ProcessLibraryConstructorList (NULL, NULL);
> +  ProcessLibraryConstructorList ();
>  
>DEBUG ((EFI_D_INFO,
>  "SecCoreStartupWithStack(0x%x, 0x%x)\n",
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116459): https://edk2.groups.io/g/devel/message/116459
Mute This Topic: https://groups.io/mt/104742758/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 10/10] UefiPayloadPkg: auto-generate SEC ProcessLibraryConstructorList() decl

2024-03-06 Thread Laszlo Ersek
Can I please get a quick R-b for this patch -- it's urgent because of
.

Thank you,
Laszlo

On 3/5/24 12:38, Laszlo Ersek wrote:
> Rely on AutoGen for declaring ProcessLibraryConstructorList().
> 
> Build-tested with:
> 
>   python UefiPayloadPkg/UniversalPayloadBuild.py -a X64 -b DEBUG -t GCC5
> 
>   python UefiPayloadPkg/UniversalPayloadBuild.py -a X64 -b DEBUG -f \
> -t GCC5
> 
>   build -a X64 -b DEBUG -p UefiPayloadPkg/UefiPayloadPkg.dsc -t GCC5 \
> -D BUILD_ARCH=X64
> 
> Cc: Gua Guo 
> Cc: Guo Dong 
> Cc: James Lu 
> Cc: Sean Rhodes 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=990
> Signed-off-by: Laszlo Ersek 
> ---
>  UefiPayloadPkg/UefiPayloadEntry/FitUniversalPayloadEntry.inf |  2 +-
>  UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf |  2 +-
>  UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf|  2 +-
>  UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h   | 10 --
>  4 files changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/FitUniversalPayloadEntry.inf 
> b/UefiPayloadPkg/UefiPayloadEntry/FitUniversalPayloadEntry.inf
> index 01fb3aceb3e4..b87a0989eee3 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/FitUniversalPayloadEntry.inf
> +++ b/UefiPayloadPkg/UefiPayloadEntry/FitUniversalPayloadEntry.inf
> @@ -8,7 +8,7 @@
>  ##
>  
>  [Defines]
> -  INF_VERSION= 0x00010005
> +  INF_VERSION= 1.30
>BASE_NAME  = FitUniversalPayloadEntry
>FILE_GUID  = CED5A8A9-B6EA-4D5A-8689-577EE88566CF
>MODULE_TYPE= SEC
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf 
> b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
> index e2af8a4b7c1b..a3ff4b86eaf6 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
> @@ -9,7 +9,7 @@
>  ##
>  
>  [Defines]
> -  INF_VERSION= 0x00010005
> +  INF_VERSION= 1.30
>BASE_NAME  = PayloadEntry
>FILE_GUID  = 2119BBD7-9432-4f47-B5E2-5C4EA31B6BDC
>MODULE_TYPE= SEC
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf 
> b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
> index 5112cdc1e5df..a62da5c7059d 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
> @@ -8,7 +8,7 @@
>  ##
>  
>  [Defines]
> -  INF_VERSION= 0x00010005
> +  INF_VERSION= 1.30
>BASE_NAME  = UniversalPayloadEntry
>FILE_GUID  = D4F0F269-1209-4A66-8039-C4D5A700EA4E
>MODULE_TYPE= SEC
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h 
> b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
> index ad8a9fd22b66..80ccc5072c55 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
> @@ -51,16 +51,6 @@
>  #define E820_PMEM   7
>  #define E820_UNDEFINED  8
>  
> -/**
> -  Auto-generated function that calls the library constructors for all of the 
> module's
> -  dependent libraries.
> -**/
> -VOID
> -EFIAPI
> -ProcessLibraryConstructorList (
> -  VOID
> -  );
> -
>  /**
>Add a new HOB to the HOB List.
>  
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116458): https://edk2.groups.io/g/devel/message/116458
Mute This Topic: https://groups.io/mt/104742531/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 09/10] UefiCpuPkg: auto-generate SEC ProcessLibraryConstructorList() decl

2024-03-06 Thread Laszlo Ersek
Can I please get a quick R-b for this patch -- it's urgent because of
.

Thank you,
Laszlo

On 3/5/24 12:38, Laszlo Ersek wrote:
> Rely on AutoGen for declaring ProcessLibraryConstructorList().
> 
> Build-tested with:
> 
>   build -a X64 -b DEBUG -m UefiCpuPkg/SecCore/SecCore.inf \
> -p UefiCpuPkg/UefiCpuPkg.dsc -t GCC5
> 
>   build -a X64 -b DEBUG -m UefiCpuPkg/SecCore/SecCoreNative.inf \
> -p UefiCpuPkg/UefiCpuPkg.dsc -t GCC5
> 
> Cc: Catharine West 
> Cc: Gerd Hoffmann 
> Cc: Rahul Kumar 
> Cc: Ray Ni 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=990
> Signed-off-by: Laszlo Ersek 
> ---
>  UefiCpuPkg/SecCore/SecCore.inf   |  2 +-
>  UefiCpuPkg/SecCore/SecCoreNative.inf |  2 +-
>  UefiCpuPkg/SecCore/SecMain.h | 12 
>  3 files changed, 2 insertions(+), 14 deletions(-)
> 
> diff --git a/UefiCpuPkg/SecCore/SecCore.inf b/UefiCpuPkg/SecCore/SecCore.inf
> index cab69b8b97f3..4f732cccb7fc 100644
> --- a/UefiCpuPkg/SecCore/SecCore.inf
> +++ b/UefiCpuPkg/SecCore/SecCore.inf
> @@ -13,7 +13,7 @@
>  ##
>  
>  [Defines]
> -  INF_VERSION= 0x00010005
> +  INF_VERSION= 1.30
>BASE_NAME  = SecCore
>MODULE_UNI_FILE= SecCore.uni
>FILE_GUID  = 1BA0062E-C779-4582-8566-336AE8F78F09
> diff --git a/UefiCpuPkg/SecCore/SecCoreNative.inf 
> b/UefiCpuPkg/SecCore/SecCoreNative.inf
> index fa241cca94d4..454a3629e505 100644
> --- a/UefiCpuPkg/SecCore/SecCoreNative.inf
> +++ b/UefiCpuPkg/SecCore/SecCoreNative.inf
> @@ -13,7 +13,7 @@
>  ##
>  
>  [Defines]
> -  INF_VERSION= 0x00010005
> +  INF_VERSION= 1.30
>BASE_NAME  = SecCoreNative
>MODULE_UNI_FILE= SecCore.uni
>FILE_GUID  = 43CA74CA-7D29-49A0-B3B9-20F84015B27D
> diff --git a/UefiCpuPkg/SecCore/SecMain.h b/UefiCpuPkg/SecCore/SecMain.h
> index b50d96e45b33..81c561424e3b 100644
> --- a/UefiCpuPkg/SecCore/SecMain.h
> +++ b/UefiCpuPkg/SecCore/SecMain.h
> @@ -101,18 +101,6 @@ FindAndReportEntryPoints (
>OUT EFI_PEI_CORE_ENTRY_POINT*PeiCoreEntryPoint
>);
>  
> -/**
> -  Auto-generated function that calls the library constructors for all of the 
> module's
> -  dependent libraries.  This function must be called by the SEC Core once a 
> stack has
> -  been established.
> -
> -**/
> -VOID
> -EFIAPI
> -ProcessLibraryConstructorList (
> -  VOID
> -  );
> -
>  /**
>Implementation of the PlatformInformation service in 
> EFI_SEC_PLATFORM_INFORMATION_PPI.
>  
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116457): https://edk2.groups.io/g/devel/message/116457
Mute This Topic: https://groups.io/mt/104742529/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 08/10] IntelFsp2Pkg: auto-generate SEC ProcessLibraryConstructorList() decl

2024-03-06 Thread Laszlo Ersek
Can I please get a quick R-b for this patch -- it's urgent because of
.

Thank you,
Laszlo

On 3/5/24 12:38, Laszlo Ersek wrote:
> Rely on AutoGen for declaring ProcessLibraryConstructorList().
> 
> Build-tested with:
> 
>   build -a X64 -b DEBUG -m IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf \
> -p IntelFsp2Pkg/IntelFsp2Pkg.dsc -t GCC5
> 
>   build -a X64 -b DEBUG -m IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf \
> -p IntelFsp2Pkg/IntelFsp2Pkg.dsc -t GCC5
> 
> Cc: Ashraf Ali S 
> Cc: Chasel Chiu 
> Cc: Duggapu Chinni B 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Cc: Susovan Mohapatra 
> Cc: Ted Kuo 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=990
> Signed-off-by: Laszlo Ersek 
> ---
>  IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf |  2 +-
>  IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf   |  2 +-
>  IntelFsp2Pkg/FspSecCore/SecMain.h | 12 
>  3 files changed, 2 insertions(+), 14 deletions(-)
> 
> diff --git a/IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf 
> b/IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf
> index cb011f99f964..7d60e2283e26 100644
> --- a/IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf
> +++ b/IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf
> @@ -8,7 +8,7 @@
>  ##
>  
>  [Defines]
> -  INF_VERSION= 0x00010005
> +  INF_VERSION= 1.30
>BASE_NAME  = Fsp24SecCoreM
>FILE_GUID  = C5BC0719-4A23-4F6E-94DA-05FB6A0DFA9C
>MODULE_TYPE= SEC
> diff --git a/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf 
> b/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
> index 8029832235ec..d496f3957d1b 100644
> --- a/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
> +++ b/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
> @@ -8,7 +8,7 @@
>  ##
>  
>  [Defines]
> -  INF_VERSION= 0x00010005
> +  INF_VERSION= 1.30
>BASE_NAME  = FspSecCoreM
>FILE_GUID  = C2F9AE46-3437-4FEF-9CB1-9A568B282FEE
>MODULE_TYPE= SEC
> diff --git a/IntelFsp2Pkg/FspSecCore/SecMain.h 
> b/IntelFsp2Pkg/FspSecCore/SecMain.h
> index 023deb7e2bda..eb1458d19773 100644
> --- a/IntelFsp2Pkg/FspSecCore/SecMain.h
> +++ b/IntelFsp2Pkg/FspSecCore/SecMain.h
> @@ -110,18 +110,6 @@ SecStartup (
>IN UINT32  ApiIdx
>);
>  
> -/**
> -  Autogenerated function that calls the library constructors for all of the 
> module's
> -  dependent libraries.  This function must be called by the SEC Core once a 
> stack has
> -  been established.
> -
> -**/
> -VOID
> -EFIAPI
> -ProcessLibraryConstructorList (
> -  VOID
> -  );
> -
>  /**
>  
>Return value of esp.
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116456): https://edk2.groups.io/g/devel/message/116456
Mute This Topic: https://groups.io/mt/104742530/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 07/10] EmulatorPkg: auto-generate SEC ProcessLibraryConstructorList() decl

2024-03-06 Thread Laszlo Ersek
Can I please get a quick R-b for this patch -- it's urgent because of
.

Thank you,
Laszlo

On 3/5/24 12:38, Laszlo Ersek wrote:
> Rely on AutoGen for declaring ProcessLibraryConstructorList().
> 
> Build-tested with:
> 
>   build -a X64 -b DEBUG -m EmulatorPkg/Sec/Sec.inf \
> -p EmulatorPkg/EmulatorPkg.dsc -t GCC5
> 
> Cc: Andrew Fish 
> Cc: Ray Ni 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=990
> Signed-off-by: Laszlo Ersek 
> ---
>  EmulatorPkg/Sec/Sec.inf | 2 +-
>  EmulatorPkg/Sec/Sec.h   | 9 -
>  2 files changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/EmulatorPkg/Sec/Sec.inf b/EmulatorPkg/Sec/Sec.inf
> index 2f9e3d4780cc..7476094f1305 100644
> --- a/EmulatorPkg/Sec/Sec.inf
> +++ b/EmulatorPkg/Sec/Sec.inf
> @@ -11,7 +11,7 @@
>  ##
>  
>  [Defines]
> -  INF_VERSION= 0x00010005
> +  INF_VERSION= 1.30
>BASE_NAME  = EmuSec
>FILE_GUID  = BCAF98C9-22B0-3B4F-9CBD-C8A6B4DBCEE9
>MODULE_TYPE= SEC
> diff --git a/EmulatorPkg/Sec/Sec.h b/EmulatorPkg/Sec/Sec.h
> index 29272a29ffa5..94689eb41d35 100644
> --- a/EmulatorPkg/Sec/Sec.h
> +++ b/EmulatorPkg/Sec/Sec.h
> @@ -20,15 +20,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  
>  #include 
>  
> -//
> -// I think this should be defined in a MdePkg include file?
> -//
> -VOID
> -EFIAPI
> -ProcessLibraryConstructorList (
> -  VOID
> -  );
> -
>  EFI_STATUS
>  EFIAPI
>  SecTemporaryRamSupport (
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116455): https://edk2.groups.io/g/devel/message/116455
Mute This Topic: https://groups.io/mt/104742527/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 01/10] pip-requirements.txt: require edk2-basetools version 0.1.51

2024-03-06 Thread Laszlo Ersek
Can I please get a quick R-b for this patch -- it's urgent because of
.

Thank you,
Laszlo

On 3/5/24 12:38, Laszlo Ersek wrote:
> The edk2-basetools commit that corresponds to edk2 commit bac9c74080cf
> ("BaseTools/AutoGen: declare ProcessLibraryConstructorList() for SEC
> modules", 2024-02-29) is 5b7161de22ee ("BaseTools/AutoGen: declare
> ProcessLibraryConstructorList() for SEC modules", 2024-03-04); it is part
> of tag v0.1.51.
> 
> Subsequent patches in this series put that feature to use. Require release
> 0.1.51 of edk2-basetools in "pip-requirements.txt", so that the next
> patches work with in-tree and out-of-tree (e.g., CI) BaseTools.
> 
> Furthermore, require version 0.20.0 of edk2-pytool-library. This is a
> dependency of edk2-basetools v0.1.50 (commit 08e5bbe755d2, "Add
> pyproject.toml and fix setup.py deprecation warnings", 2024-02-13) and
> v0.1.51 too (commit f3e15d654479, "Add pyproject.toml and fix setup.py
> deprecation warnings", 2024-02-16).
> 
> Cc: Bob Feng 
> Cc: Joey Vagedes 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Cc: Rebecca Cran 
> Cc: Sean Brogan 
> Cc: Yuwei Chen 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=991
> Signed-off-by: Laszlo Ersek 
> ---
>  pip-requirements.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/pip-requirements.txt b/pip-requirements.txt
> index 6420078822b5..2f4cd33cc620 100644
> --- a/pip-requirements.txt
> +++ b/pip-requirements.txt
> @@ -12,9 +12,9 @@
>  # https://www.python.org/dev/peps/pep-0440/#version-specifiers
>  ##
>  
> -edk2-pytool-library==0.19.9
> +edk2-pytool-library==0.20.0
>  edk2-pytool-extensions==0.26.4
> -edk2-basetools==0.1.48
> +edk2-basetools==0.1.51
>  antlr4-python3-runtime==4.7.1
>  lcov-cobertura==2.0.2
>  regex==2023.12.25
> 
> 
> 
> 
> 
> 



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




[edk2-devel] [PATCH] Maintainers.txt: remove Laszlo's entries

2024-03-06 Thread Laszlo Ersek
Red Hat and I have mutually and amicably agreed to separate. Remove my
entries from "Maintainers.txt".

Cc: Andrew Fish 
Cc: Ard Biesheuvel 
Cc: Gerd Hoffmann 
Cc: Jiewen Yao 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Rahul Kumar 
Cc: Ray Ni 
Cc: Sami Mujawar 
Signed-off-by: Laszlo Ersek 
---

Notes:
I'd like to merge this patch very soon, but not before merging the
following series:

* [PATCH v2 00/10]
  clean up ProcessLibraryConstructorList() declarations in SEC modules

  msgid <20240305113843.68812-1-ler...@redhat.com>
  https://edk2.groups.io/g/devel/message/116367

* [edk2-platforms PATCH v2 0/4]
  clean up ProcessLibraryConstructorList() declarations in SEC modules

  msgid <20240305120126.70259-1-ler...@redhat.com>
  https://edk2.groups.io/g/devel/message/116378

 Maintainers.txt | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index 9038f9eb3005..799f27f914ce 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -151,7 +151,6 @@ ArmVirtPkg
 F: ArmVirtPkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/ArmVirtPkg
 M: Ard Biesheuvel  [ardbiesheuvel]
-M: Laszlo Ersek  [lersek]
 R: Leif Lindholm  [leiflindholm]
 R: Sami Mujawar  [samimujawar]
 R: Gerd Hoffmann  [kraxel]
@@ -462,7 +461,6 @@ F: OvmfPkg/
 W: http://www.tianocore.org/ovmf/
 M: Ard Biesheuvel  [ardbiesheuvel]
 M: Jiewen Yao  [jyao1]
-M: Laszlo Ersek  [lersek]
 R: Gerd Hoffmann  [kraxel]
 S: Maintained
 
@@ -622,7 +620,6 @@ UefiCpuPkg
 F: UefiCpuPkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/UefiCpuPkg
 M: Ray Ni  [niruiyu]
-M: Laszlo Ersek  [lersek]
 R: Rahul Kumar  [rahul1-kumar]
 R: Gerd Hoffmann  [kraxel]
 


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




Re: [edk2-devel][PATCH v2 0/3] Fix Runtime Granularity Issues

2024-03-06 Thread Oliver Smith-Denny

Hi Liming,

Friendly ping again, can you please review this? It fixes a UEFI
spec violation.

Thanks,
Oliver

On 2/26/2024 8:46 AM, Oliver Smith-Denny wrote:

Hi Liming,

Now that the stable tag is finished, can you review this MdeModulePkg 
patch?


Thanks,
Oliver

On 2/16/2024 5:27 PM, Oliver Smith-Denny wrote:

This patch series is the second version of
MdeModulePkg: DxeCore: Don't Guard Large Runtime Granularity 
Allocations​.

The subject line has been updated because this went from a one commit
patch with no cover letter to a multi-commit patch.

The commit messages cover the vast amount of detail here, but this
patchset fixes three issues:
- a UEFI spec violation for which memory types require runtime page
allocation granularity alignment
- An incompatibility of the heap guard system to guard these regions
that require runtime page allocation granularities greater than
the EFI_PAGE_SIZE.
- A CodeQL error that fails CI when updating the Page.c code

v2:
- Add commit to fix UEFI spec violation
- Add commit to fix newly flagged CodeQL error
- Update guard commit message, comments, and static assert to use
the correct types

Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
Cc: Liming Gao 

Oliver Smith-Denny (3):
   MdeModulePkg: DxeCore: Fix CodeQL Error in FreePages
   MdeModulePkg: DxeCore: Correct Runtime Granularity Memory Type
   MdeModulePkg: DxeCore: Do Not Apply Guards to Unsupported Types

  MdeModulePkg/MdeModulePkg.dec | 10 +
  MdeModulePkg/Core/Dxe/Mem/HeapGuard.h | 14 +
  MdeModulePkg/Core/Dxe/Mem/Page.c  | 22 +---
  MdeModulePkg/Core/Dxe/Mem/Pool.c  | 15 +++--
  MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c |  4 ++--
  MdeModulePkg/Core/Pei/Memory/MemoryServices.c |  2 +-
  6 files changed, 59 insertions(+), 8 deletions(-)









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




[edk2-devel] Event: TianoCore Community Meeting EMEA/NAMO - Thursday, March 7, 2024 #cal-reminder

2024-03-06 Thread Group Notification
*Reminder: TianoCore Community Meeting EMEA/NAMO*

*When:*
Thursday, March 7, 2024
8:00am to 9:00am
(UTC-08:00) America/Los Angeles

*Where:*
Microsoft Teams meeting Join on your computer or mobile app Click here to join 
the meeting Meeting ID: 226 323 011 029 Passcode: hMRCj6 Download Teams | Join 
on the web Join with a video conferencing device te...@conf.intel.com Video 
Conference ID: 112 716 814 3 Alternate VTC instructions Learn More | Meeting 
options

*Organizer:* Miki Demeter

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

*Description:*



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_MTAyZGJhNjMtYzQ4Mi00MTUxLWFlMWMtOGU0MWNlZDk4NjY5%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
 )

Meeting ID: 226 323 011 029
Passcode: hMRCj6

Download Teams ( https://www.microsoft.com/en-us/microsoft-teams/download-app ) 
| Join on the web ( https://www.microsoft.com/microsoft-teams/join-a-meeting )

*Join with a video conferencing device*

te...@conf.intel.com

Video Conference ID: 112 716 814 3

Alternate VTC instructions ( 
https://conf.intel.com/teams/?conf=1127168143=teams=conf.intel.com=test_call
 )

Learn More ( https://aka.ms/JoinTeamsMeeting ) | Meeting options ( 
https://teams.microsoft.com/meetingOptions/?organizerId=6e4ce4c4-1242-431b-9a51-92cd01a5df3c=46c98d88-e344-4ed4-8496-4ed7712e255d=19_meeting_MTAyZGJhNjMtYzQ4Mi00MTUxLWFlMWMtOGU0MWNlZDk4NjY5@thread.v2=0=en-US
 )




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116450): https://edk2.groups.io/g/devel/message/116450
Mute This Topic: https://groups.io/mt/104768383/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] [edk2-stable202311][PATCH] BaseTools: Python VfrCompiler implementation

2024-03-06 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Hi Christine,
Is the VFR python tool upstream to edk2-staging?  May I know where can I get 
it? I would like to try it and see the flexibility of output some VFR 
information in JSON/YAML file. For edk2 Redfish, we are looking for the 
solution to automatically adding necessary edk2 Redfish drivers to platform 
DSC/FDF according to the UNI file.

Thanks
Abner

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Yuwei
> Chen via groups.io
> Sent: Tuesday, January 9, 2024 4:24 PM
> To: Kinney, Michael D ; Pedro Falcato
> ; devel@edk2.groups.io
> Cc: Gao, Liming ; Rebecca Cran
> ; Zimmer, Vincent ; Leif
> Lindholm ; Andrew Fish ;
> Feng, Bob C ; Yang, Yuting2
> ; Hartung, Stephen ;
> Narayanan, Bimod 
> Subject: Re: [edk2-devel] [edk2-stable202311][PATCH] BaseTools: Python
> VfrCompiler implementation
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Hi Liming,
>
> Have you tried with the new python tool? Any comments or concerns?
>
> Thanks,
> Christine
>
> > -Original Message-
> > From: Kinney, Michael D 
> > Sent: Saturday, December 16, 2023 1:31 AM
> > To: Pedro Falcato ; devel@edk2.groups.io; Chen,
> > Christine 
> > Cc: Gao, Liming ; Rebecca Cran
> > ; Zimmer, Vincent ; Leif
> > Lindholm ; Andrew Fish ;
> > Feng, Bob C ; Yang, Yuting2
> > ; Hartung, Stephen
> ;
> > Kinney, Michael D 
> > Subject: RE: [edk2-devel] [edk2-stable202311][PATCH] BaseTools: Python
> > VfrCompiler implementation
> >
> > There are several advantages for this direction:
> >
> >
> > * Current VFR compiler in C has dependencies on very old libs that
> >   have not been updated.
> >
> > * The movement to python will remove the pre-build step that requires
> >   some of the build tools to be built using host C compiler before
> >   running edk2 build command.
> >
> > * The other element is moving all the python code into edk2-basetools
> >   repo with a published pip package.  This enables the use of
> >   pip-requirements.txt to provide developers all the content needed
> >   to build.
> >
> > I agree that we should not have both VFR compilers.  We need to make sure
> > the new one in Python is 100% compatible with the C version and make the
> > decision to simultaneously add Python one and delete the C one and commit
> > to the Python one.  I provided this feedback to the VFR developers in the
> > TianoCore Tools/CI meeting earlier this year.
> >
> > The perf question is very good. It would be good for the VFR developers to
> > provide some perf comparisons.  I do not expect any significant different 
> > that
> > would impact overall platform build times.
> >
> > Mike
> >
> > > -Original Message-
> > > From: Pedro Falcato 
> > > Sent: Friday, December 15, 2023 9:04 AM
> > > To: devel@edk2.groups.io; Chen, Christine 
> > > Cc: Gao, Liming ; Rebecca Cran
> > > ; Zimmer, Vincent ;
> > > Kinney, Michael D ; Leif Lindholm
> > > ; Andrew Fish ; Feng, Bob
> > > C ; Yang, Yuting2 ;
> > > Hartung, Stephen 
> > > Subject: Re: [edk2-devel] [edk2-stable202311][PATCH] BaseTools: Python
> > > VfrCompiler implementation
> > >
> > > On Thu, Dec 7, 2023 at 9:08 AM Yuwei Chen 
> > wrote:
> > > >
> > > > Hi Liming,
> > > >
> > > >
> > > >
> > > > Is this feature been tested and reviewed these two weeks? 
> > >
> > > Two questions:
> > >
> > > 1) What testing strategy do you have to test for regressions in such a
> > > huge rewrite?
> > > 2) What's the point in shipping this to upstream if you're not aiming
> > > for the replacement of the original VfrCompiler?
> > > 3) What's the value of rewriting this in Python? If the existing
> > > VfrCompiler is already working fine (AFAIK?), a python version will
> > > likely just be slower (unless the original C version is super badly
> > > written).
> > > I *seriously* struggle to understand what this Python movement is
> > > supposed to do, except gratuitously rewrite large bits of BaseTools
> > > for a net loss (performance)
> > >
> > > --
> > > Pedro
>
>
> 
>



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




Re: [edk2-devel] [edk2-redfish-client][PATCH 1/3] RedfishClientPkg: introduce Redfish resource config2 protocol.

2024-03-06 Thread Nickle Wang via groups.io
> Can we say "The additional JSON data in ASCII string format passed to callee. 
> The
> usage is defined between the Redfish feature driver and subordinate Redfish
> resource feature driver."? Seems to me more clear about the usage.
> Also apply this description to the following functions.
> 

Thanks for your comment, Abner! I update the description of "JsonText" in 
version 2 patch set.

Regards,
Nickle

> -Original Message-
> From: Chang, Abner 
> Sent: Wednesday, March 6, 2024 1:16 PM
> To: Nickle Wang ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy ; Nick Ramirez 
> Subject: RE: [edk2-redfish-client][PATCH 1/3] RedfishClientPkg: introduce 
> Redfish
> resource config2 protocol.
> 
> External email: Use caution opening links or attachments
> 
> 
> [AMD Official Use Only - General]
> 
> > -Original Message-
> > From: Nickle Wang 
> > Sent: Monday, March 4, 2024 9:27 PM
> > To: devel@edk2.groups.io
> > Cc: Chang, Abner ; Igor Kulchytskyy
> > ; Nick Ramirez 
> > Subject: [edk2-redfish-client][PATCH 1/3] RedfishClientPkg: introduce
> > Redfish resource config2 protocol.
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Introduce EDKII Redfish Resource Config2 Protocol. Comparing to
> > Redfish Resource Config Protocol, this protocol adds new parameter
> > called "JsonText". This allows Redfish caller driver to pass JSON
> > context to callee. Callee save the effort of getting same data from
> > Redfish service again. This is useful when Redfish service supports
> > "expand" query parameter. "Version" is added to this protocol too so
> > we don't create new protocol to add new parameter in the future.
> >
> > Signed-off-by: Nickle Wang 
> > Cc: Abner Chang 
> > Cc: Igor Kulchytskyy 
> > Cc: Nick Ramirez 
> > ---
> >  RedfishClientPkg/RedfishClientPkg.dec |   2 +
> >  .../EdkIIRedfishResourceConfig2Protocol.h | 148 ++
> >  2 files changed, 150 insertions(+)
> >  create mode 100644
> > RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.
> > h
> >
> > diff --git a/RedfishClientPkg/RedfishClientPkg.dec
> > b/RedfishClientPkg/RedfishClientPkg.dec
> > index aa018d714..f894f30ab 100644
> > --- a/RedfishClientPkg/RedfishClientPkg.dec
> > +++ b/RedfishClientPkg/RedfishClientPkg.dec
> > @@ -48,6 +48,8 @@
> >gEdkIIRedfishResourceAddendumProtocolGuid = { 0xda36b12b, 0xaad4,
> > 0x4e90, { 0xba, 0xcb, 0xe3, 0xb5, 0x3b, 0x08, 0xbc, 0x54 } }
> >## Include/Protocol/EdkIIRedfishOverrideProtocol.h
> >gEdkiiRedfishOverrideProtocolGuid = { 0xb55bef20, 0xf7c8, 0x4ae9,
> > { 0xa7, 0xca, 0x8b, 0xba, 0x9f, 0x7b, 0xbf, 0x9c } }
> > +  ## Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
> > +  gEdkIIRedfishResourceConfig2ProtocolGuid  = { 0xe9bef87f, 0xbff4,
> > 0x4872, { 0xa9, 0xa4, 0x16, 0x59, 0xbe, 0xd9, 0x1c, 0xf4 } }
> >
> >  [Guids]
> >## Include/Guid/RedfishClientPkgTokenSpace.h
> > diff --git
> > a/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protoco
> > l.h
> > b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protoco
> > l.h
> > new file mode 100644
> > index 0..96384e265
> > --- /dev/null
> > +++
> > b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protoco
> > l.h
> > @@ -0,0 +1,148 @@
> > +/** @file
> > +  This file defines the EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL
> > interface.
> > +
> > +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights
> > reserved.
> > +
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > +
> > +**/
> > +
> > +#ifndef EDKII_REDFISH_RESOURCE_CONFIG2_H_ #define
> > +EDKII_REDFISH_RESOURCE_CONFIG2_H_
> > +
> > +#include 
> > +
> > +typedef struct _EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL
> > EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL;
> > +
> > +/**
> > +  Provision redfish resource by given URI.
> > +
> > +  @param[in]   ThisPointer to
> > EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
> > +  @param[in]   Uri Target URI to create resource.
> > +  @param[in]   JsonTextThe JSON data in ASCII string format. 
> > This is
> > optional.
> Can we say "The additional JSON data in ASCII string format passed to callee. 
> The
> usage is defined between the Redfish feature driver and subordinate Redfish
> resource feature driver."? Seems to me more clear about the usage.
> Also apply this description to the following functions.
> 
> Thanks
> Abner
> 
> > +  @param[in]   HttpPostModeTRUE if resource does not exist, HTTP 
> > POST
> > method is used.
> > +   FALSE if the resource exist but
> > + some of properties are
> > missing,
> > +   HTTP PUT method is used.
> > +
> > +  @retval EFI_SUCCESS  Value is returned successfully.
> > +  @retval Others   Some error happened.
> > +
> > +**/
> > +typedef
> > 

[edk2-devel] [edk2-redfish-client][PATCH v2 3/3] RedfishClientPkg/Features: support config2 protocol

2024-03-06 Thread Nickle Wang via groups.io
Because EdkIIRedfishResourceConfigLib is updated to support
Redfish resource config2 protocol, update corresponding
functions in feature drivers.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../Features/Bios/v1_0_9/Common/BiosCommon.c | 14 +++---
 .../BootOptionCollectionDxe.c| 14 +++---
 .../ComputerSystemCollectionDxe.c| 16 
 .../MemoryCollectionDxe/MemoryCollectionDxe.c| 16 
 4 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
index 1f3c30147..1eb269a84 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
@@ -782,7 +782,7 @@ HandleResource (
 
   DEBUG ((REDFISH_DEBUG_TRACE, "%a, process resource for: %s\n", __func__, 
Uri));
 
-  Status = GetRedfishSchemaInfo (Private->RedfishService, 
Private->JsonStructProtocol, Uri, );
+  Status = GetRedfishSchemaInfo (Private->RedfishService, 
Private->JsonStructProtocol, Uri, NULL, );
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, failed to get schema information from: %s %r\n", 
__func__, Uri, Status));
 return Status;
@@ -795,7 +795,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a Identify for %s\n", __func__, Uri));
   ConfigLang = RedfishGetConfigLanguage (Uri);
   if (ConfigLang == NULL) {
-Status = EdkIIRedfishResourceConfigIdentify (, Uri, 
Private->InformationExchange);
+Status = EdkIIRedfishResourceConfigIdentify (, Uri, NULL, 
Private->InformationExchange);
 if (EFI_ERROR (Status)) {
   if (Status == EFI_UNSUPPORTED) {
 DEBUG ((DEBUG_MANAGEABILITY, "%a, \"%s\" is not handled by us\n", 
__func__, Uri));
@@ -811,17 +811,17 @@ HandleResource (
   }
 
   //
-  // Check and see if target property exist or not even when collection 
memeber exists.
+  // Check and see if target property exist or not even when collection member 
exists.
   // If not, we sill do provision.
   //
   DEBUG ((REDFISH_DEBUG_TRACE, "%a Check for %s\n", __func__, Uri));
-  Status = EdkIIRedfishResourceConfigCheck (, Uri);
+  Status = EdkIIRedfishResourceConfigCheck (, Uri, NULL);
   if (EFI_ERROR (Status)) {
 //
 // The target property does not exist, do the provision to create property.
 //
 DEBUG ((REDFISH_DEBUG_TRACE, "%a provision for %s\n", __func__, Uri));
-Status = EdkIIRedfishResourceConfigProvisioning (, Uri, 
Private->InformationExchange, FALSE);
+Status = EdkIIRedfishResourceConfigProvisioning (, Uri, NULL, 
Private->InformationExchange, FALSE);
 if (EFI_ERROR (Status)) {
   DEBUG ((DEBUG_ERROR, "%a, failed to provision with GET mode: %r\n", 
__func__, Status));
 }
@@ -833,7 +833,7 @@ HandleResource (
   // Consume first.
   //
   DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));
-  Status = EdkIIRedfishResourceConfigConsume (, Uri);
+  Status = EdkIIRedfishResourceConfigConsume (, Uri, NULL);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n", 
__func__, Uri, Status));
   }
@@ -842,7 +842,7 @@ HandleResource (
   // Patch.
   //
   DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
-  Status = EdkIIRedfishResourceConfigUpdate (, Uri);
+  Status = EdkIIRedfishResourceConfigUpdate (, Uri, NULL);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n", 
__func__, Uri, Status));
   }
diff --git 
a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c 
b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c
index 4f94a4495..cd1437f54 100644
--- a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c
+++ b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c
@@ -44,7 +44,7 @@ HandleResource (
 
   DEBUG ((REDFISH_BOOT_OPTION_COLLECTION_DEBUG_TRACE, "%a: process resource 
for: %s\n", __func__, Uri));
 
-  Status = GetRedfishSchemaInfo (Private->RedfishService, 
Private->JsonStructProtocol, Uri, );
+  Status = GetRedfishSchemaInfo (Private->RedfishService, 
Private->JsonStructProtocol, Uri, NULL, );
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a: failed to get schema information from: %s %r\n", 
__func__, Uri, Status));
 return Status;
@@ -58,7 +58,7 @@ HandleResource (
   SystemRestDetected = FALSE;
   ConfigLang = RedfishGetConfigLanguage (Uri);
   if (ConfigLang == NULL) {
-Status = EdkIIRedfishResourceConfigIdentify (, Uri, 
Private->InformationExchange);
+Status = EdkIIRedfishResourceConfigIdentify (, Uri, NULL, 
Private->InformationExchange);
 if (EFI_ERROR (Status)) {
   if (Status == EFI_UNSUPPORTED) {
 DEBUG ((REDFISH_BOOT_OPTION_COLLECTION_DEBUG_TRACE, "%a: \"%s\" is not 
handled by 

[edk2-devel] [edk2-redfish-client][PATCH v2 2/3] RedfishClientPkg/Edk2RedfishResourceConfigLib: support config2 protocol

2024-03-06 Thread Nickle Wang via groups.io
Support Redfish resource config2 protocol in Edk2RedfishResourceConfigLib.
This library will try Redfish resource config2 protocol first. And if
there is no matching protocol found, Redfish resource config protocol will
be used.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
---
 .../EdkIIRedfishResourceConfigLib.inf |   4 +-
 .../Library/EdkIIRedfishResourceConfigLib.h   |  33 +-
 .../EdkIIRedfishResourceConfigInternal.h  |  44 ++
 .../EdkIIRedfishResourceConfigLib.c   | 391 ++
 4 files changed, 385 insertions(+), 87 deletions(-)
 create mode 100644 
RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigInternal.h

diff --git 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
index 2d10445f0..998a05c80 100644
--- 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
+++ 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
@@ -22,6 +22,7 @@
 #
 
 [Sources]
+  EdkIIRedfishResourceConfigInternal.h
   EdkIIRedfishResourceConfigLib.c
 
 [Packages]
@@ -42,8 +43,9 @@
   RedfishHttpLib
 
 [Protocols]
-  gEdkIIRedfishResourceConfigProtocolGuid   ## CONSUMES ##
+  gEdkIIRedfishResourceConfigProtocolGuid ## CONSUMES ##
   gEdkIIRedfishFeatureInterchangeDataProtocolGuid ## CONSUMES ##
+  gEdkIIRedfishResourceConfig2ProtocolGuid## CONSUEMS ##
 
 [Pcd]
   gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize
diff --git a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h 
b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
index 3aa953cec..57c7f2b80 100644
--- a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
+++ b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 /**
@@ -23,6 +24,7 @@
 
   @param[in]   Schema  Redfish schema information.
   @param[in]   Uri Target URI to create resource.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
   @param[in]   InformationExchange Pointer to RESOURCE_INFORMATION_EXCHANGE.
   @param[in]   HttpPostModeTRUE if resource does not exist, HTTP POST 
method is used.
FALSE if the resource exist but some of 
properties are missing,
@@ -33,9 +35,11 @@
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigProvisioning (
   IN REDFISH_SCHEMA_INFO*Schema,
   IN EFI_STRING Uri,
+  IN CHAR8  *JsonText OPTIONAL,
   IN RESOURCE_INFORMATION_EXCHANGE  *InformationExchange,
   IN BOOLEANHttpPostMode
   );
@@ -45,15 +49,18 @@ EdkIIRedfishResourceConfigProvisioning (
 
   @param[in]   Schema  Redfish schema information.
   @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
 
   @retval EFI_SUCCESS  Value is returned successfully.
   @retval Others   Some error happened.
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigConsume (
   IN REDFISH_SCHEMA_INFO  *Schema,
-  IN EFI_STRING   Uri
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
   );
 
 /**
@@ -61,21 +68,25 @@ EdkIIRedfishResourceConfigConsume (
 
   @param[in]   Schema  Redfish schema information.
   @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
 
   @retval EFI_SUCCESS  Value is returned successfully.
   @retval Others   Some error happened.
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigUpdate (
   IN REDFISH_SCHEMA_INFO  *Schema,
-  IN EFI_STRING   Uri
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
   );
 
 /**
   Check resource on given URI.
 
   @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe JSON data in ASCII string format. This 
is optional.
 
   @retval EFI_SUCCESS  Value is returned successfully.
   @retval EFI_UNSUPPORTED  This resource is not owned by feature 
driver.
@@ -84,9 +95,11 @@ EdkIIRedfishResourceConfigUpdate (
 
 **/
 EFI_STATUS
+EFIAPI
 EdkIIRedfishResourceConfigCheck (
   IN REDFISH_SCHEMA_INFO  *Schema,
-  IN EFI_STRING   Uri
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
   );
 
 /**
@@ -94,6 +107,7 @@ EdkIIRedfishResourceConfigCheck (
 
   @param[in]   Schema  Redfish 

[edk2-devel] [edk2-redfish-client][PATCH v2 1/3] RedfishClientPkg: introduce Redfish resource config2 protocol.

2024-03-06 Thread Nickle Wang via groups.io
Introduce EDKII Redfish Resource Config2 Protocol. Comparing to
Redfish Resource Config Protocol, this protocol adds new parameter
called "JsonText". This allows Redfish caller driver to pass JSON
context to callee. Callee save the effort of getting same data from
Redfish service again. This is useful when Redfish service supports
"expand" query parameter. "Version" is added to this protocol too so
we don't create new protocol to add new parameter in the future.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 RedfishClientPkg/RedfishClientPkg.dec |   2 +
 .../EdkIIRedfishResourceConfig2Protocol.h | 158 ++
 2 files changed, 160 insertions(+)
 create mode 100644 
RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h

diff --git a/RedfishClientPkg/RedfishClientPkg.dec 
b/RedfishClientPkg/RedfishClientPkg.dec
index aa018d714..f894f30ab 100644
--- a/RedfishClientPkg/RedfishClientPkg.dec
+++ b/RedfishClientPkg/RedfishClientPkg.dec
@@ -48,6 +48,8 @@
   gEdkIIRedfishResourceAddendumProtocolGuid = { 0xda36b12b, 0xaad4, 0x4e90, { 
0xba, 0xcb, 0xe3, 0xb5, 0x3b, 0x08, 0xbc, 0x54 } }
   ## Include/Protocol/EdkIIRedfishOverrideProtocol.h
   gEdkiiRedfishOverrideProtocolGuid = { 0xb55bef20, 0xf7c8, 0x4ae9, { 
0xa7, 0xca, 0x8b, 0xba, 0x9f, 0x7b, 0xbf, 0x9c } }
+  ## Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
+  gEdkIIRedfishResourceConfig2ProtocolGuid  = { 0xe9bef87f, 0xbff4, 0x4872, { 
0xa9, 0xa4, 0x16, 0x59, 0xbe, 0xd9, 0x1c, 0xf4 } }
 
 [Guids]
   ## Include/Guid/RedfishClientPkgTokenSpace.h
diff --git 
a/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h 
b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
new file mode 100644
index 0..a0613048b
--- /dev/null
+++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
@@ -0,0 +1,158 @@
+/** @file
+  This file defines the EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL interface.
+
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EDKII_REDFISH_RESOURCE_CONFIG2_H_
+#define EDKII_REDFISH_RESOURCE_CONFIG2_H_
+
+#include 
+
+typedef struct _EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL;
+
+/**
+  Provision redfish resource by given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri Target URI to create resource.
+  @param[in]   JsonTextThe additional JSON data in ASCII string 
format passed to callee.
+   The usage is defined between the Redfish 
feature driver and subordinate
+   Redfish resource feature driver.
+  @param[in]   HttpPostModeTRUE if resource does not exist, HTTP POST 
method is used.
+   FALSE if the resource exist but some of 
properties are missing,
+   HTTP PUT method is used.
+
+  @retval EFI_SUCCESS  Value is returned successfully.
+  @retval Others   Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_PROVISIONING)(
+  IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL  *This,
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL,
+  IN BOOLEAN  HttpPostMode
+  );
+
+/**
+  Consume resource from given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe additional JSON data in ASCII string 
format passed to callee.
+   The usage is defined between the Redfish 
feature driver and subordinate
+   Redfish resource feature driver.
+
+  @retval EFI_SUCCESS  Value is returned successfully.
+  @retval Others   Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_CONSUME)(
+  IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL  *This,
+  IN EFI_STRING   Uri,
+  IN CHAR8*JsonText OPTIONAL
+  );
+
+/**
+  Update resource to given URI.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+  @param[in]   Uri The target URI to consume.
+  @param[in]   JsonTextThe additional JSON data in ASCII string 
format passed to callee.
+   The usage is defined between the Redfish 
feature driver and subordinate
+   Redfish resource feature driver.
+
+  @retval EFI_SUCCESS

[edk2-devel] [edk2-redfish-client][PATCH v2 0/3] introduce Redfish Resource Config2 protocol.

2024-03-06 Thread Nickle Wang via groups.io
v2: address review comment about the description of "JsonText" parameter.

Introduce EDKII Redfish Resource Config2 Protocol so that caller can 
pass Redfish data to callee when caller uses "expand" query parameter
to get multiple Redfish resources all together. Then, callee does not 
get Redfish resource from Redfish service again and save the communication
effort between BIOS and Redfish service.

EdkIIRedfishConfigLib is updated to select Redfish Resource Config2 
Protocol as first priority. If there is no Config2 protocol supported,
library will use config protocol automatically.

Pull request is created: 
https://github.com/tianocore/edk2-redfish-client/pull/80

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 

Nickle Wang (3):
  RedfishClientPkg: introduce Redfish resource config2 protocol.
  RedfishClientPkg/Edk2RedfishResourceConfigLib: support config2
protocol
  RedfishClientPkg/Features: support config2 protocol

 RedfishClientPkg/RedfishClientPkg.dec |   2 +
 .../EdkIIRedfishResourceConfigLib.inf |   4 +-
 .../Library/EdkIIRedfishResourceConfigLib.h   |  33 +-
 .../EdkIIRedfishResourceConfig2Protocol.h | 158 +++
 .../EdkIIRedfishResourceConfigInternal.h  |  44 ++
 .../Features/Bios/v1_0_9/Common/BiosCommon.c  |  14 +-
 .../BootOptionCollectionDxe.c |  14 +-
 .../ComputerSystemCollectionDxe.c |  16 +-
 .../MemoryCollectionDxe/MemoryCollectionDxe.c |  16 +-
 .../EdkIIRedfishResourceConfigLib.c   | 391 ++
 10 files changed, 575 insertions(+), 117 deletions(-)
 create mode 100644 
RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
 create mode 100644 
RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigInternal.h

-- 
2.34.1



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




[edk2-devel] [edk2-redfish-client][PATCH 2/2] RedfishClientPkg: Remove unused header files.

2024-03-06 Thread Nickle Wang via groups.io
stdarg.h and stdio.h are not used in RedfishClientPkg.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 RedfishClientPkg/PrivateInclude/Crt/stdarg.h | 14 --
 RedfishClientPkg/PrivateInclude/Crt/stdio.h  | 14 --
 2 files changed, 28 deletions(-)
 delete mode 100644 RedfishClientPkg/PrivateInclude/Crt/stdarg.h
 delete mode 100644 RedfishClientPkg/PrivateInclude/Crt/stdio.h

diff --git a/RedfishClientPkg/PrivateInclude/Crt/stdarg.h 
b/RedfishClientPkg/PrivateInclude/Crt/stdarg.h
deleted file mode 100644
index 5f458c0a4..0
--- a/RedfishClientPkg/PrivateInclude/Crt/stdarg.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/** @file
-  Include file to support building the third-party jansson library.
-
- (C) Copyright 2021 Hewlett Packard Enterprise Development LP
-
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-#ifndef REDFISH_CLIENT_CRT_STDARG_H_
-#define REDFISH_CLIENT_CRT_STDARG_H_
-
-#include 
-
-#endif
diff --git a/RedfishClientPkg/PrivateInclude/Crt/stdio.h 
b/RedfishClientPkg/PrivateInclude/Crt/stdio.h
deleted file mode 100644
index 30a0afae6..0
--- a/RedfishClientPkg/PrivateInclude/Crt/stdio.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/** @file
-  Include file to support building the third-party jansson library.
-
- (C) Copyright 2021 Hewlett Packard Enterprise Development LP
-
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-#ifndef REDFISH_CLIENT_CRT_STDIO_H_
-#define REDFISH_CLIENT_CRT_STDIO_H_
-
-#include 
-
-#endif
-- 
2.34.1



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




回复: [edk2-devel] [PATCH v4 2/3] MdeModulePkg: Update ReceiveData and SendData function description

2024-03-06 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Qingyu
> 发送时间: 2024年2月26日 11:06
> 收件人: devel@edk2.groups.io
> 抄送: Liming Gao ; Michael D Kinney
> 
> 主题: [edk2-devel] [PATCH v4 2/3] MdeModulePkg: Update ReceiveData and
> SendData function description
> 
> AtaBusDxe, NvmExpressDxe, ScsiDiskDxe and EmmcDxe is used to back the
> EFI_STORAGE_SECURITY_COMMAND_PROTOCOL, update the parameter
> 'MediaId'
> description for the protocal function ReceiveData and SendData as
described
> in Uefi spec 2.10 section 13.14.
> 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Signed-off-by: Qingyu 
> ---
>  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c  |  8
> ++--
>  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h  |  8
> ++--
>  .../Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c|  8 ++--
>  .../Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.h|  8 ++--
>  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c |  8 ++--
>  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h |  8 ++--
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c| 12
> +---
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.h| 12
> +---
>  8 files changed, 54 insertions(+), 18 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c
> b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c
> index a729c087ff5a..67c6389bb8b3 100644
> --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c
> +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c
> @@ -1483,7 +1483,9 @@ AtaDiskInfoWhichIde (
>function shall return EFI_DEVICE_ERROR.
> 
>@param  This Indicates a pointer to the
> calling context.
> -  @param  MediaId  ID of the medium to
> receive data from.
> +  @param  MediaId  ID of the medium to
> receive data from. If there is no
> +   block IO protocol supported
> by the physical device, the
> +   value of MediaId is
> undefined.
>@param  Timeout  The timeout, in 100ns units,
> to use for the execution
> of the security protocol
> command. A Timeout value of 0
> means that this function
> will wait indefinitely for the
> @@ -1600,7 +1602,9 @@ AtaStorageSecurityReceiveData (
>shall return EFI_DEVICE_ERROR.
> 
>@param  This Indicates a pointer to the
> calling context.
> -  @param  MediaId  ID of the medium to
> receive data from.
> +  @param  MediaId  ID of the medium to
> receive data from. If there is no
> +   block IO protocol supported
> by the physical device, the
> +   value of MediaId is
> undefined.
>@param  Timeout  The timeout, in 100ns units,
> to use for the execution
> of the security protocol
> command. A Timeout value of 0
> means that this function
> will wait indefinitely for the
> diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
> b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
> index 6bc345f7e777..8906947e28b3 100644
> --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
> +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
> @@ -927,7 +927,9 @@ AtaDiskInfoWhichIde (
>function shall return EFI_DEVICE_ERROR.
> 
>@param  This Indicates a pointer to the
> calling context.
> -  @param  MediaId  ID of the medium to
> receive data from.
> +  @param  MediaId  ID of the medium to
> receive data from. If there is no
> +   block IO protocol supported
> by the physical device, the
> +   value of MediaId is
> undefined.
>@param  Timeout  The timeout, in 100ns units,
> to use for the execution
> of the security protocol
> command. A Timeout value of 0
> means that this function
> will wait indefinitely for the
> @@ -1007,7 +1009,9 @@ AtaStorageSecurityReceiveData (
>shall return EFI_DEVICE_ERROR.
> 
>@param  This Indicates a pointer to the
> calling context.
> -  @param  MediaId  ID of the medium to
> receive data from.
> +  @param  MediaId  ID of the medium to
> receive data from. If there is no
> +   block IO protocol supported
> by the physical device, the
> +   value of MediaId is
> undefined.
>@param  Timeout  The timeout, in 100ns units,
> to use for the execution
> of the security protocol
> command. A Timeout value of 0
>

回复: [edk2-devel] [PATCH v4 1/3] MdePkg: Update ReceiveData and SendData function description

2024-03-06 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Qingyu
> 发送时间: 2024年2月26日 11:06
> 收件人: devel@edk2.groups.io
> 抄送: Michael D Kinney ; Liming Gao
> ; Zhiguang Liu 
> 主题: [edk2-devel] [PATCH v4 1/3] MdePkg: Update ReceiveData and
> SendData function description
> 
> Refer to Uefi spec 2.10 section 13.14, update the parameter 'MediaId'
> description for EFI_STORAGE_SECURITY_COMMAND_PROTOCOL function
> ReceiveData
> and SendData.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Signed-off-by: Qingyu 
> ---
>  MdePkg/Include/Protocol/StorageSecurityCommand.h | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Include/Protocol/StorageSecurityCommand.h
> b/MdePkg/Include/Protocol/StorageSecurityCommand.h
> index 810af59b85c3..206ae79aff8d 100644
> --- a/MdePkg/Include/Protocol/StorageSecurityCommand.h
> +++ b/MdePkg/Include/Protocol/StorageSecurityCommand.h
> @@ -59,7 +59,9 @@ typedef struct
> _EFI_STORAGE_SECURITY_COMMAND_PROTOCOL
> EFI_STORAGE_SECURITY_COMMA
>function shall return EFI_DEVICE_ERROR.
> 
>@param  This Indicates a pointer to the
> calling context.
> -  @param  MediaId  ID of the medium to
> receive data from.
> +  @param  MediaId  ID of the medium to
> receive data from. If there is no
> +   block IO protocol supported
> by the physical device, the
> +   value of MediaId is
> undefined.
>@param  Timeout  The timeout, in 100ns units,
> to use for the execution
> of the security protocol
> command. A Timeout value of 0
> means that this function
> will wait indefinitely for the
> @@ -138,7 +140,9 @@ EFI_STATUS
>shall return EFI_DEVICE_ERROR.
> 
>@param  This Indicates a pointer to the
> calling context.
> -  @param  MediaId  ID of the medium to
> receive data from.
> +  @param  MediaId  ID of the medium to
> receive data from. If there is no
> +   block IO protocol supported
> by the physical device, the
> +   value of MediaId is
> undefined.
>@param  Timeout  The timeout, in 100ns units,
> to use for the execution
> of the security protocol
> command. A Timeout value of 0
> means that this function
> will wait indefinitely for the
> --
> 2.39.1.windows.1
> 
> 
> 
> 
> 





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




[edk2-devel] 回复: [PATCH] SignedCapsulePkg: Update GetImage and GetImageInfo description details

2024-03-06 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: Pethaiyan Madhan 
> 发送时间: 2024年2月27日 18:04
> 收件人: devel@edk2.groups.io
> 抄送: Pethaiyan Madhan ; Michael D Kinney
> ; Liming Gao ;
> Zhiguang Liu ; Yi Li ; GuoX Xu
> 
> 主题: [PATCH] SignedCapsulePkg: Update GetImage and GetImageInfo
> description details
> 
> 1.For EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetImage():
> Add the following sentence at the end of the Image parameter
> description. "May be NULL with a zero ImageSize in order to determine
> the size of the buffer needed".
> 
> Modify the description of "EFI_INVALID_PARAMETER" return code as "The
> ImageSize is not too small and Image is NULL."
> 
> 2.For EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetImageInfo():
> Add the following sentence at the end of the ImageInfo parameter
> description."May be NULL with a zero ImageInfoSize in order to
> determine the size of the buffer needed".
> 
> Modify the description of "EFI_INVALID_PARAMETER" return code as "The
> ImageInfoSize is not too small and Image is NULL." and add new
> descriptions for "EFI_INVALID_PARAMETER" return code.
> 
>  REF: UEFI spec v2.10 23.1.2
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Yi Li 
> Cc: GuoX Xu 
> Signed-off-by: Pethaiyan Madhan 
> ---
>  .../SystemFirmwareUpdate/SystemFirmwareCommonDxe.c  | 13
> +++--
>  .../SystemFirmwareUpdate/SystemFirmwareDxe.h| 13
> +++--
>  2 files changed, 22 insertions(+), 4 deletions(-)
> 
> diff --git
> a/SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareCo
> mmonDxe.c
> b/SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareCo
> mmonDxe.c
> index 077bd0cb31..6e394d85d4 100644
> ---
> a/SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareCo
> mmonDxe.c
> +++
> b/SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareCo
> mmonDxe.c
> @@ -34,6 +34,8 @@ EFI_FIRMWARE_MANAGEMENT_PROTOCOL
> mFirmwareManagementProtocol = {
>   to contain the image(s)
> information if the buffer was too small.
>@param[in, out] ImageInfo  A pointer to the buffer in which
> firmware places the current image(s)
>   information. The information
> is an array of EFI_FIRMWARE_IMAGE_DESCRIPTORs.
> + May be NULL with a zero
> ImageInfoSize in order to determine the size of the
> + buffer needed.
>@param[out] DescriptorVersion  A pointer to the location in which
> firmware returns the version number
>   associated with the
> EFI_FIRMWARE_IMAGE_DESCRIPTOR.
>@param[out] DescriptorCountA pointer to the location in
> which firmware returns the number of
> @@ -54,7 +56,12 @@ EFI_FIRMWARE_MANAGEMENT_PROTOCOL
> mFirmwareManagementProtocol = {
>@retval EFI_SUCCESSThe device was successfully
> updated with the new image.
>@retval EFI_BUFFER_TOO_SMALL   The ImageInfo buffer was too
> small. The current buffer size
>   needed to hold the image(s)
> information is returned in ImageInfoSize.
> -  @retval EFI_INVALID_PARAMETER  ImageInfoSize is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is not too small
> and ImageInfo is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is non-zero and
> DescriptorVersion is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is non-zero and
> DescriptorCount is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is non-zero and
> DescriptorSize is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is non-zero and
> PackageVersion is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is non-zero and
> PackageVersionName is NULL.
>@retval EFI_DEVICE_ERROR   Valid information could not be
> returned. Possible corrupted image.
> 
>  **/
> @@ -153,6 +160,8 @@ FmpGetImageInfo (
>@param[in] ImageIndex  A unique number identifying the
> firmware image(s) within the device.
>   The number is between 1 and
> DescriptorCount.
>@param[in,out] Image   Points to the buffer where the
> current image is copied to.
> + May be NULL with a zero
> ImageSize in order to determine the size of the
> + buffer needed.
>@param[in,out] ImageSize   On entry, points to the size of the
> buffer pointed to by Image, in bytes.
>   On return, points to the length of
> the image, in bytes.
> 
> @@ -160,7 +169,7 @@ FmpGetImageInfo (
>@retval EFI_BUFFER_TOO_SMALL   The buffer specified by ImageSize is
> too small to hold the
>   image. The current buffer size
> needed to hold the image is returned
>   in ImageSize.
> -  @retval EFI_INVALID_PARAMETER  The Image was NULL.
> +  @retval 

[edk2-devel] 回复: [PATCH V4] FmpDevicePkg: GetImageInfo Add missing conditions

2024-03-06 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: Pethaiyan Madhan 
> 发送时间: 2024年2月27日 17:46
> 收件人: devel@edk2.groups.io
> 抄送: Pethaiyan Madhan ; Michael D Kinney
> ; Liming Gao ;
> Zhiguang Liu ; Yi Li ; GuoX Xu
> 
> 主题: [PATCH V4] FmpDevicePkg: GetImageInfo Add missing conditions
> 
> 1.For EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetImage():
> Add the following sentence at the end of the Image parameter
> description. "May be NULL with a zero ImageSize in order to determine
> the size of the buffer needed".
> 
> Modify the description of "EFI_INVALID_PARAMETER" return code as "The
> ImageSize is not too small and Image is NULL."
> 
> 2.For EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetImageInfo():
> Add the following sentence at the end of the ImageInfo parameter
> description."May be NULL with a zero ImageInfoSize in order to
> determine the size of the buffer needed".
> 
> Modify the description of "EFI_INVALID_PARAMETER" return code as "The
> ImageInfoSize is not too small and Image is NULL." and add new
> descriptions for "EFI_INVALID_PARAMETER" return code.
> 
>  REF: UEFI spec v2.10 23.1.2
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Yi Li 
> Cc: GuoX Xu 
> Signed-off-by: Pethaiyan Madhan 
> ---
>  FmpDevicePkg/FmpDxe/FmpDxe.c | 20 +++-
>  FmpDevicePkg/FmpDxe/FmpDxe.h | 15 ---
>  2 files changed, 27 insertions(+), 8 deletions(-)
> 
> diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c
> b/FmpDevicePkg/FmpDxe/FmpDxe.c
> index 1e7ec4a09e..1d580c9f69 100644
> --- a/FmpDevicePkg/FmpDxe/FmpDxe.c
> +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
> @@ -43,7 +43,7 @@ const FIRMWARE_MANAGEMENT_PRIVATE_DATA
> mFirmwareManagementPrivateDataTemplate =
>FIRMWARE_MANAGEMENT_PRIVATE_DATA_SIGNATURE, // Signature
>NULL,   // Handle
>{// Fmp
> -GetTheImageInfo,
> +GetImageInfo,
>  GetTheImage,
>  SetTheImage,
>  CheckTheImage,
> @@ -417,6 +417,8 @@ PopulateDescriptor (
>   to contain the image(s)
> information if the buffer was too small.
>@param[in, out] ImageInfo  A pointer to the buffer in which
> firmware places the current image(s)
>   information. The information
> is an array of EFI_FIRMWARE_IMAGE_DESCRIPTORs.
> + May be NULL with a zero
> ImageInfoSize in order to determine the size of the
> + buffer needed.
>@param[out] DescriptorVersion  A pointer to the location in which
> firmware returns the version number
>   associated with the
> EFI_FIRMWARE_IMAGE_DESCRIPTOR.
>@param[out] DescriptorCountA pointer to the location in
> which firmware returns the number of
> @@ -437,13 +439,18 @@ PopulateDescriptor (
>@retval EFI_SUCCESSThe device was successfully
> updated with the new image.
>@retval EFI_BUFFER_TOO_SMALL   The ImageInfo buffer was too
> small. The current buffer size
>   needed to hold the image(s)
> information is returned in ImageInfoSize.
> -  @retval EFI_INVALID_PARAMETER  ImageInfoSize is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is not too small
> and ImageInfo is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is non-zero and
> DescriptorVersion is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is non-zero and
> DescriptorCount is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is non-zero and
> DescriptorSize is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is non-zero and
> PackageVersion is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is non-zero and
> PackageVersionName is NULL.
>@retval EFI_DEVICE_ERROR   Valid information could not be
> returned. Possible corrupted image.
> 
>  **/
>  EFI_STATUS
>  EFIAPI
> -GetTheImageInfo (
> +GetImageInfo (
>IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL  *This,
>IN OUT UINTN *ImageInfoSize,
>IN OUT EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo,
> @@ -495,7 +502,7 @@ GetTheImageInfo (
>// Confirm that buffer isn't null
>//
>if (  (ImageInfo == NULL) || (DescriptorVersion == NULL) ||
> (DescriptorCount == NULL) || (DescriptorSize == NULL)
> - || (PackageVersion == NULL))
> + || (PackageVersion == NULL) || (PackageVersionName == NULL))
>{
>  DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetImageInfo() - Pointer
> Parameter is NULL.\n", mImageIdName));
>  Status = EFI_INVALID_PARAMETER;
> @@ -544,6 +551,9 @@ cleanup:
>@param[in]  ImageIndex A unique number identifying the
> firmware image(s) within the device.
>   The number is between 1 and
> DescriptorCount.
>@param[in, out] Image  Points to the buffer where the current
> image is copied to.
> +  

[edk2-devel] 回复: [PATCH] MdePkg: Update GetImage , GetImageInfo description details

2024-03-06 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: Pethaiyan Madhan 
> 发送时间: 2024年2月27日 17:59
> 收件人: devel@edk2.groups.io
> 抄送: Pethaiyan Madhan ; Michael D Kinney
> ; Liming Gao ;
> Zhiguang Liu ; Yi Li ; GuoX Xu
> 
> 主题: [PATCH] MdePkg: Update GetImage , GetImageInfo description details
> 
> 1.For EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetImage():
> Add the following sentence at the end of the Image parameter
> description. "May be NULL with a zero ImageSize in order to determine
> the size of the buffer needed".
> 
> Modify the description of "EFI_INVALID_PARAMETER" return code as "The
> ImageSize is not too small and Image is NULL."
> 
> 2.For EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetImageInfo():
> Add the following sentence at the end of the ImageInfo parameter
> description."May be NULL with a zero ImageInfoSize in order to
> determine the size of the buffer needed".
> 
> Modify the description of "EFI_INVALID_PARAMETER" return code as "The
> ImageInfoSize is not too small and Image is NULL." and add new
> descriptions for "EFI_INVALID_PARAMETER" return code.
> 
>  REF: UEFI spec v2.10 23.1.2
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Yi Li 
> Cc: GuoX Xu 
> Signed-off-by: Pethaiyan Madhan 
> ---
>  MdePkg/Include/Protocol/FirmwareManagement.h | 14 --
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Include/Protocol/FirmwareManagement.h
> b/MdePkg/Include/Protocol/FirmwareManagement.h
> index e535bb697d..90b7d83c8f 100644
> --- a/MdePkg/Include/Protocol/FirmwareManagement.h
> +++ b/MdePkg/Include/Protocol/FirmwareManagement.h
> @@ -294,6 +294,8 @@ EFI_STATUS
>   to contain the image(s)
> information if the buffer was too small.
>@param[in, out] ImageInfo  A pointer to the buffer in which
> firmware places the current image(s)
>   information. The information
> is an array of EFI_FIRMWARE_IMAGE_DESCRIPTORs.
> + May be NULL with a zero
> ImageInfoSize in order to determine the size of the
> + buffer needed.
>@param[out] DescriptorVersion  A pointer to the location in which
> firmware returns the version number
>   associated with the
> EFI_FIRMWARE_IMAGE_DESCRIPTOR.
>@param[out] DescriptorCountA pointer to the location in
> which firmware returns the number of
> @@ -314,7 +316,12 @@ EFI_STATUS
>@retval EFI_SUCCESSThe device was successfully
> updated with the new image.
>@retval EFI_BUFFER_TOO_SMALL   The ImageInfo buffer was too
> small. The current buffer size
>   needed to hold the image(s)
> information is returned in ImageInfoSize.
> -  @retval EFI_INVALID_PARAMETER  ImageInfoSize is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is not too small
> and ImageInfo is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is non-zero and
> DescriptorVersion is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is non-zero and
> DescriptorCount is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is non-zero and
> DescriptorSize is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is non-zero and
> PackageVersion is NULL.
> +  @retval EFI_INVALID_PARAMETER  ImageInfoSize is non-zero and
> PackageVersionName is NULL.
>@retval EFI_DEVICE_ERROR   Valid information could not be
> returned. Possible corrupted image.
> 
>  **/
> @@ -341,6 +348,9 @@ EFI_STATUS
>@param[in]  ImageIndex A unique number identifying the
> firmware image(s) within the device.
>   The number is between 1 and
> DescriptorCount.
>@param[out] Image  Points to the buffer where the
> current image is copied to.
> + May be NULL with a zero
> ImageSize in order to determine the size of the
> + buffer needed.
> +
>@param[in, out] ImageSize  On entry, points to the size of the
> buffer pointed to by Image, in bytes.
>   On return, points to the length of
> the image, in bytes.
> 
> @@ -348,7 +358,7 @@ EFI_STATUS
>@retval EFI_BUFFER_TOO_SMALL   The buffer specified by ImageSize is
> too small to hold the
>   image. The current buffer size
> needed to hold the image is returned
>   in ImageSize.
> -  @retval EFI_INVALID_PARAMETER  The Image was NULL.
> +  @retval EFI_INVALID_PARAMETER  The ImageSize is not too small and
> Image is NULL.
>@retval EFI_NOT_FOUND  The current image is not copied to
> the buffer.
>@retval EFI_UNSUPPORTEDThe operation is not supported.
>@retval EFI_SECURITY_VIOLATION The operation could not be performed
> due to an authentication failure.
> --
> 2.38.1.windows.1






[edk2-devel] Event: TianoCore edk2-test Bug Triage Meeting - Thursday, March 7, 2024 #cal-reminder

2024-03-06 Thread Group Notification
*Reminder: TianoCore edk2-test Bug Triage Meeting*

*When:*
Thursday, March 7, 2024
10:00pm to 11:00pm
(UTC+08:00) Asia/Shanghai

*Where:*
https://armltd.zoom.us/j/94348061758?pwd=Q3RDeFA5K2JFaU5jdWUxc1FnaGdyUT09=addon

*Organizer:* Edhaya Chandran edhaya.chand...@arm.com ( 
edhaya.chand...@arm.com?subject=Re:%20Event:%20TianoCore%20edk2-test%20Bug%20Triage%20Meeting
 )

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

*Description:*


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




[edk2-devel] [PATCH v1 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Make RunningApCount on exclusive cacheline

2024-03-06 Thread Wu, Jiaxin
For non blocking mode during SmmMpBroadcastProcedure, multiple APs might
contended access the RunningApCount in the PROCEDURE_TOKEN:

Step1: RunningApCount is initialized to the mMaxNumberOfCpus
(See GetFreeToken).
Step2: Decrease RunningApCount if the AP is not present
(See InterlockedDecrement in InternalSmmStartupAllAPs).
Step3: multiple APs are contended to decrease RunningApCount in the
same token (See ReleaseToken in APHandler).

So, Contended lock case happen during Step3. For multiple APs access
the shared memory (RunningApCount), we shall use exclusive cache line
with WB attribute for SMM Performance Tuning.

This patch makes RunningApCount on exclusive cacheline.

Cc: Ray Ni 
Cc: Laszlo Ersek 
Cc: Eric Dong 
Cc: Zeng Star 
Cc: Gerd Hoffmann 
Cc: Rahul Kumar 
Signed-off-by: Jiaxin Wu 
---
 UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c  | 35 +++---
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h |  2 +-
 2 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c 
b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
index 9790b4f888..05fa6854fe 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
@@ -421,11 +421,11 @@ ReleaseToken (
 {
   PROCEDURE_TOKEN  *Token;
 
   Token = mSmmMpSyncData->CpuData[CpuIndex].Token;
 
-  if (InterlockedDecrement (>RunningApCount) == 0) {
+  if (InterlockedDecrement (Token->RunningApCount) == 0) {
 ReleaseSpinLock (Token->SpinLock);
   }
 
   mSmmMpSyncData->CpuData[CpuIndex].Token = NULL;
 }
@@ -970,12 +970,12 @@ AllocateTokenBuffer (
   )
 {
   UINTNSpinLockSize;
   UINT32   TokenCountPerChunk;
   UINTNIndex;
-  SPIN_LOCK*SpinLock;
-  UINT8*SpinLockBuffer;
+  UINTNBufferAddr;
+  VOID *Buffer;
   PROCEDURE_TOKEN  *ProcTokens;
 
   SpinLockSize = GetSpinLockProperties ();
 
   TokenCountPerChunk = FixedPcdGet32 (PcdCpuSmmMpTokenCountPerChunk);
@@ -986,25 +986,34 @@ AllocateTokenBuffer (
   }
 
   DEBUG ((DEBUG_INFO, "CpuSmm: SpinLock Size = 0x%x, 
PcdCpuSmmMpTokenCountPerChunk = 0x%x\n", SpinLockSize, TokenCountPerChunk));
 
   //
-  // Separate the Spin_lock and Proc_token because the alignment requires by 
Spin_Lock.
+  // Allocate the buffer for SpinLock and RunningApCount to meet the alignment 
requirement.
   //
-  SpinLockBuffer = AllocatePool (SpinLockSize * TokenCountPerChunk);
-  ASSERT (SpinLockBuffer != NULL);
+  Buffer =  AllocatePages (EFI_SIZE_TO_PAGES (SpinLockSize * 
TokenCountPerChunk * 2));
+  if (Buffer == NULL) {
+DEBUG ((DEBUG_ERROR, "AllocateTokenBuffer: Failed to allocate the buffer 
for SpinLock and RunningApCount!\n"));
+CpuDeadLoop ();
+  }
 
   ProcTokens = AllocatePool (sizeof (PROCEDURE_TOKEN) * TokenCountPerChunk);
   ASSERT (ProcTokens != NULL);
 
+  BufferAddr = (UINTN)Buffer;
   for (Index = 0; Index < TokenCountPerChunk; Index++) {
-SpinLock = (SPIN_LOCK *)(SpinLockBuffer + SpinLockSize * Index);
-InitializeSpinLock (SpinLock);
+ProcTokens[Index].Signature = PROCEDURE_TOKEN_SIGNATURE;
+
+ProcTokens[Index].SpinLock = (SPIN_LOCK *)BufferAddr;
+InitializeSpinLock (ProcTokens[Index].SpinLock);
+
+BufferAddr += SpinLockSize;
+
+ProcTokens[Index].RunningApCount  = (volatile UINT32 *)BufferAddr;
+*ProcTokens[Index].RunningApCount = 0;
 
-ProcTokens[Index].Signature  = PROCEDURE_TOKEN_SIGNATURE;
-ProcTokens[Index].SpinLock   = SpinLock;
-ProcTokens[Index].RunningApCount = 0;
+BufferAddr += SpinLockSize;
 
 InsertTailList (>TokenList, [Index].Link);
   }
 
   return [0].Link;
@@ -1036,11 +1045,11 @@ GetFreeToken (
   }
 
   NewToken   = PROCEDURE_TOKEN_FROM_LINK 
(gSmmCpuPrivate->FirstFreeToken);
   gSmmCpuPrivate->FirstFreeToken = GetNextNode (>TokenList, 
gSmmCpuPrivate->FirstFreeToken);
 
-  NewToken->RunningApCount = RunningApsCount;
+  *NewToken->RunningApCount = RunningApsCount;
   AcquireSpinLock (NewToken->SpinLock);
 
   return NewToken;
 }
 
@@ -1298,11 +1307,11 @@ InternalSmmStartupAllAPs (
 
   //
   // Decrease the count to mark this processor(AP or BSP) as finished.
   //
   if (ProcToken != NULL) {
-InterlockedDecrement (>RunningApCount);
+InterlockedDecrement (ProcToken->RunningApCount);
   }
 }
   }
 
   ReleaseAllAPs ();
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h 
b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h
index 7f244ea803..07473208fd 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h
@@ -213,11 +213,11 @@ typedef struct {
 typedef struct {
   UINTN  Signature;
   LIST_ENTRY Link;
 
   SPIN_LOCK  *SpinLock;
-  volatile UINT32RunningApCount;
+  volatile UINT32*RunningApCount;
 } PROCEDURE_TOKEN;
 
 #define PROCEDURE_TOKEN_FROM_LINK(a)  CR (a, PROCEDURE_TOKEN, Link, 
PROCEDURE_TOKEN_SIGNATURE)
 
 #define TOKEN_BUFFER_SIGNATURE  

[edk2-devel] [PATCH v1 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: Remove one round of Busy spinlock

2024-03-06 Thread Wu, Jiaxin
For both non blocking and blocking:
Remove unnecessary a pair of AcquireSpinLock and ReleaseSpinLock
for each AP. It's target to improve SmmStartupAllAPs performance.

No functional impact, see below analysis:

During first acquire spinLock, InternalSmmStartupAllAPs will
return EFI_NOT_READY if AcquireSpinLockOrFail return false:

  if (!AcquireSpinLockOrFail (mSmmMpSyncData->CpuData[Index].Busy)) {
return EFI_NOT_READY;
  }

which means the AcquireSpinLockOrFail () must return TRUE if
InternalSmmStartupAllAPs () can continue the second round of Busy
spinlock. since the Busy has already acquired the spinlock, no need
to release and acquire again.

Cc: Ray Ni 
Cc: Laszlo Ersek 
Cc: Eric Dong 
Cc: Zeng Star 
Cc: Gerd Hoffmann 
Cc: Rahul Kumar 
Signed-off-by: Jiaxin Wu 
---
 UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c 
b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
index 081f0c1501..9790b4f888 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
@@ -1257,12 +1257,10 @@ InternalSmmStartupAllAPs (
   }
 
   if (!AcquireSpinLockOrFail (mSmmMpSyncData->CpuData[Index].Busy)) {
 return EFI_NOT_READY;
   }
-
-  ReleaseSpinLock (mSmmMpSyncData->CpuData[Index].Busy);
 }
   }
 
   if (CpuCount == 0) {
 return EFI_NOT_STARTED;
@@ -1273,23 +1271,10 @@ InternalSmmStartupAllAPs (
 *Token= (MM_COMPLETION)ProcToken->SpinLock;
   } else {
 ProcToken = NULL;
   }
 
-  //
-  // Make sure all BUSY should be acquired.
-  //
-  // Because former code already check mSmmMpSyncData->CpuData[***].Busy for 
each AP.
-  // Here code always use AcquireSpinLock instead of AcquireSpinLockOrFail for 
not
-  // block mode.
-  //
-  for (Index = 0; Index < mMaxNumberOfCpus; Index++) {
-if (IsPresentAp (Index)) {
-  AcquireSpinLock (mSmmMpSyncData->CpuData[Index].Busy);
-}
-  }
-
   for (Index = 0; Index < mMaxNumberOfCpus; Index++) {
 if (IsPresentAp (Index)) {
   mSmmMpSyncData->CpuData[Index].Procedure = (EFI_AP_PROCEDURE2)Procedure;
   mSmmMpSyncData->CpuData[Index].Parameter = ProcedureArguments;
   if (ProcToken != NULL) {
-- 
2.16.2.windows.1



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




[edk2-devel] [PATCH v1 0/2] SMM MP service performance Improvement

2024-03-06 Thread Wu, Jiaxin
The series patch are to improve the SMM MP service performance.

Cc: Ray Ni 
Cc: Laszlo Ersek 
Cc: Eric Dong 
Cc: Zeng Star 
Cc: Gerd Hoffmann 
Cc: Rahul Kumar 
Signed-off-by: Jiaxin Wu 

Jiaxin Wu (2):
  UefiCpuPkg/PiSmmCpuDxeSmm: Remove one round of Busy spinlock
  UefiCpuPkg/PiSmmCpuDxeSmm: Make RunningApCount on exclusive cacheline

 UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c  | 50 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h |  2 +-
 2 files changed, 23 insertions(+), 29 deletions(-)

-- 
2.16.2.windows.1



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




[edk2-devel] [PATCH edk2-platforms v6 7/7] Platform/SbsaQemu: add DeviceTree fallbacks to parse memory information

2024-03-06 Thread Marcin Juszkiewicz
From: Xiong Yining 

Add the DeviceTree fallbacks to parsing the information about memory
if the related SMC calls Failed.

Signed-off-by: Xiong Yining 
Signed-off-by: Chen Baozi 
---
 .../SbsaQemuHardwareInfoLib.c   | 106 +++-
 1 file changed, 104 insertions(+), 2 deletions(-)

diff --git 
a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
 
b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
index 88b50e46c072..d63cfbf7d5ef 100644
--- 
a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
+++ 
b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
@@ -118,6 +118,106 @@ FdtHelperCountCpus (
   return CpuCount;
 }
 
+/**
+  Walks through the Device Tree created by Qemu and counts the number of 
Memory node present in it.
+
+  @retval   the number of memory nodes.
+**/
+UINT32
+FdtHelperMemNodeCount (
+  VOID
+  )
+{
+  VOID  *DeviceTreeBase;
+  CONST CHAR8   *Type;
+  UINT32MemNodeCount;
+  INT32 Node;
+  INT32 Prev;
+  INT32 Len;
+
+  DeviceTreeBase = (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeBaseAddress);
+  ASSERT (DeviceTreeBase != NULL);
+
+  // Make sure we have a valid device tree blob
+  ASSERT (fdt_check_header (DeviceTreeBase) == 0);
+
+  MemNodeCount = 0;
+  for (Prev = 0;; Prev = Node) {
+Node = fdt_next_node (DeviceTreeBase, Prev, NULL);
+if (Node < 0){
+  break;
+}
+
+Type = fdt_getprop (DeviceTreeBase, Node, "device_type", );
+if (Type && AsciiStrnCmp (Type, "memory", Len) == 0) {
+  MemNodeCount++;
+}
+  }
+
+  return MemNodeCount;
+}
+
+/** Walks through the Device Tree created by Qemu and counts the adress、size 
and node-id of the Memory node present in it.
+
+  @param [in]   MemoryIdIndex of memory to retrieve memory information.
+
+  @retval   memory infomation for given memory node.
+**/
+MemoryInfo
+FdtHelperGetMemInfo (
+  IN UINTN   MemoryId
+)
+{
+  VOID  *DeviceTreeBase;
+  CONST UINT64  *RegProp;
+  CONST UINT32  *NodeProp;
+  CONST CHAR8   *Type;
+  INT64 MemNodeCount;
+  INT32 Len;
+  INT32 Node;
+  INT32 Prev;
+  MemoryInfoMemInfo = {0};
+
+  DeviceTreeBase = (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeBaseAddress);
+  ASSERT (DeviceTreeBase != NULL);
+
+  // Make sure we have a valid device tree blob
+  ASSERT (fdt_check_header (DeviceTreeBase) == 0);
+
+  MemNodeCount = 0;
+
+  for (Prev = 0;; Prev = Node){
+Node = fdt_next_node (DeviceTreeBase, Prev, NULL);
+if (Node < 0){
+  break;
+}
+
+Type = fdt_getprop (DeviceTreeBase, Node, "device_type", );
+if (Type && AsciiStrnCmp (Type, "memory", Len) == 0){
+  if (MemoryId == MemNodeCount){
+RegProp = fdt_getprop (DeviceTreeBase, Node, "reg", );
+if (RegProp != 0 && Len == (2 * sizeof (UINT64))) {
+MemInfo.AddressBase = fdt64_to_cpu (ReadUnaligned64 (RegProp));
+MemInfo.AddressSize= fdt64_to_cpu (ReadUnaligned64 (RegProp + 1));
+} else {
+  DEBUG ((DEBUG_ERROR, "Failed to find the address and size of the 
memory"));
+}
+
+NodeProp= fdt_getprop (DeviceTreeBase, Node, "numa-node-id", );
+if (NodeProp){
+  MemInfo.NodeId= fdt32_to_cpu (ReadUnaligned32 (NodeProp));
+} else {
+  DEBUG ((DEBUG_ERROR, "Failed to find the node-id of the memory"));
+}
+  }
+
+  MemNodeCount ++;
+}
+  }
+
+  return MemInfo;
+}
+
 /**
   Get CPU count from information passed by Qemu.
 
@@ -212,7 +312,8 @@ SbsaQemuGetMemNodeCount (
 
   SmcResult = ArmCallSmc0 (SIP_SVC_GET_MEMORY_NODE_COUNT, , NULL, NULL);
   if (SmcResult != SMC_SIP_CALL_SUCCESS) {
-DEBUG ((DEBUG_ERROR, "SIP_SVC_GET_MEMORY_NODE_COUNT call failed.\n"));
+DEBUG ((DEBUG_ERROR, "SIP_SVC_GET_MEMORY_NODE_COUNT call failed. We have 
to get the number of memory nodes from DT.\n"));
+Arg0 = FdtHelperMemNodeCount();
   }
 
   DEBUG(( DEBUG_INFO, "The number of the memory nodes is %ld\n", Arg0));
@@ -234,7 +335,8 @@ SbsaQemuGetMemInfo (
 
   SmcResult = ArmCallSmc1 (SIP_SVC_GET_MEMORY_NODE, , , );
   if (SmcResult != SMC_SIP_CALL_SUCCESS) {
-DEBUG ((DEBUG_ERROR, "SIP_SVC_GET_MEMORY_NODE call failed.\n"));
+DEBUG ((DEBUG_ERROR, "SIP_SVC_GET_MEMORY_NODE call failed. We have to get 
memory info from DT.\n"));
+MemInfo = FdtHelperGetMemInfo(MemoryId);
   } else {
 MemInfo.NodeId = Arg0;
 MemInfo.AddressBase = Arg1;

-- 
2.44.0



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




[edk2-devel] [PATCH edk2-platforms v6 6/7] Platform/SbsaQemu: get the information of memory via SMC calls

2024-03-06 Thread Marcin Juszkiewicz
From: Xiong Yining 

Provide functions to check for memory information:

- amount of memory nodes
- memory address
- NUMA node id for memory

Values are read from TF-A using platform specific SMC calls.

Signed-off-by: Xiong Yining 
Signed-off-by: Chen Baozi 
---
 .../SbsaQemu/Library/SbsaQemuLib/SbsaQemuLib.inf |  2 +-
 .../SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h  |  2 +
 .../Include/Library/SbsaQemuHardwareInfoLib.h| 28 ++
 .../SbsaQemuHardwareInfoLib.c| 47 +
 .../Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuMem.c  | 54 +---
 5 files changed, 91 insertions(+), 42 deletions(-)

diff --git a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuLib.inf 
b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuLib.inf
index c067a80cc715..fb856efe4c27 100644
--- a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuLib.inf
+++ b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuLib.inf
@@ -32,9 +32,9 @@ [LibraryClasses]
   ArmLib
   BaseMemoryLib
   DebugLib
-  FdtLib
   MemoryAllocationLib
   PcdLib
+  SbsaQemuHardwareInfoLib
 
 [Pcd]
   gArmTokenSpaceGuid.PcdSystemMemoryBase
diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h 
b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h
index d9faee7fa5b2..e7bf54978d4e 100644
--- a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h
+++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h
@@ -16,6 +16,8 @@
 #define SIP_SVC_GET_GIC_ITSSMC_SIP_FUNCTION_ID(101)
 #define SIP_SVC_GET_CPU_COUNT  SMC_SIP_FUNCTION_ID(200)
 #define SIP_SVC_GET_CPU_NODE   SMC_SIP_FUNCTION_ID(201)
+#define SIP_SVC_GET_MEMORY_NODE_COUNT SMC_SIP_FUNCTION_ID(300)
+#define SIP_SVC_GET_MEMORY_NODE SMC_SIP_FUNCTION_ID(301)
 
 /*
  *  SMCC does not define return codes for SiP functions.
diff --git a/Silicon/Qemu/SbsaQemu/Include/Library/SbsaQemuHardwareInfoLib.h 
b/Silicon/Qemu/SbsaQemu/Include/Library/SbsaQemuHardwareInfoLib.h
index ca52c6b27093..0b71a3f7e6eb 100644
--- a/Silicon/Qemu/SbsaQemu/Include/Library/SbsaQemuHardwareInfoLib.h
+++ b/Silicon/Qemu/SbsaQemu/Include/Library/SbsaQemuHardwareInfoLib.h
@@ -9,6 +9,12 @@
 #ifndef SBSA_QEMU_HARDWARE_INFO_
 #define SBSA_QEMU_HARDWARE_INFO_
 
+typedef struct{
+  UINT32  NodeId;
+  UINT64  AddressBase;
+  UINT64  AddressSize;
+} MemoryInfo;
+
 /**
   Get CPU count from information passed by Qemu.
 
@@ -42,4 +48,26 @@ SbsaQemuGetCpuNumaNode (
   IN UINTN  CpuId
   );
 
+/**
+  Get the number of memory node from device tree passed by Qemu.
+
+  @retval   the number of memory nodes.
+**/
+UINT32
+SbsaQemuGetMemNodeCount (
+  VOID
+  );
+
+/**
+  Get memory infomation(node-id, addressbase, addresssize) for a given memory 
node from device tree passed by Qemu.
+
+  @param [in]   MemoryIdIndex of memory to retrieve memory information.
+
+  @retval   memory infomation for given memory node.
+**/
+MemoryInfo
+SbsaQemuGetMemInfo (
+  IN UINTN   MemoryId
+  );
+
 #endif /* SBSA_QEMU_HARDWARE_INFO_ */
diff --git 
a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
 
b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
index e1f1a9588b19..88b50e46c072 100644
--- 
a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
+++ 
b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
@@ -201,3 +201,50 @@ SbsaQemuGetCpuNumaNode (
 
   return Arg0;
 }
+
+UINT32
+SbsaQemuGetMemNodeCount (
+  VOID
+  )
+{
+  UINTNSmcResult;
+  UINTNArg0;
+
+  SmcResult = ArmCallSmc0 (SIP_SVC_GET_MEMORY_NODE_COUNT, , NULL, NULL);
+  if (SmcResult != SMC_SIP_CALL_SUCCESS) {
+DEBUG ((DEBUG_ERROR, "SIP_SVC_GET_MEMORY_NODE_COUNT call failed.\n"));
+  }
+
+  DEBUG(( DEBUG_INFO, "The number of the memory nodes is %ld\n", Arg0));
+  return (UINT32)Arg0;
+}
+
+MemoryInfo
+SbsaQemuGetMemInfo (
+  IN UINTN   MemoryId
+  )
+{
+  UINTN   SmcResult;
+  UINTN   Arg0;
+  UINTN   Arg1;
+  UINTN   Arg2;
+  MemoryInfo  MemInfo;
+
+  Arg0 = MemoryId;
+
+  SmcResult = ArmCallSmc1 (SIP_SVC_GET_MEMORY_NODE, , , );
+  if (SmcResult != SMC_SIP_CALL_SUCCESS) {
+DEBUG ((DEBUG_ERROR, "SIP_SVC_GET_MEMORY_NODE call failed.\n"));
+  } else {
+MemInfo.NodeId = Arg0;
+MemInfo.AddressBase = Arg1;
+MemInfo.AddressSize = Arg2;
+  }
+
+  DEBUG(( DEBUG_INFO, "NUMA node for System RAM:%d = 0x%lx - 0x%lx\n",
+  MemInfo.NodeId,
+  MemInfo.AddressBase,
+  MemInfo.AddressBase + MemInfo.AddressSize -1 ));
+
+  return MemInfo;
+}
diff --git a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuMem.c 
b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuMem.c
index 8c2eb0b6a028..5a418a461174 100644
--- a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuMem.c
+++ b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuMem.c
@@ -12,7 +12,7 @@
 #include 
 #include 
 #include 
-#include 

[edk2-devel] [PATCH edk2-platforms v6 4/7] Platform/SbsaQemu: move FdtHandlerLib to SbsaQemuHardwareInfoLib

2024-03-06 Thread Marcin Juszkiewicz
There is no need for EDK2 to know that there is DeviceTree around.
All hardware information is read using functions from
SbsaQemuHardwareInfoLib library.

Library fallbacks to parsing DT if needed.

Signed-off-by: Marcin Juszkiewicz 
Reviewed-by: Leif Lindholm 
---
 Platform/Qemu/SbsaQemu/SbsaQemu.dsc |   1 -
 .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf |   4 +-
 .../SbsaQemu/Library/FdtHelperLib/FdtHelperLib.inf  |  33 ---
 .../SbsaQemuHardwareInfoLib.inf |   2 +
 .../Qemu/SbsaQemu/Include/Library/FdtHelperLib.h|  36 ---
 .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c   |   4 +-
 .../SbsaQemu/Library/FdtHelperLib/FdtHelperLib.c|  98 --
 .../SbsaQemuHardwareInfoLib.c   | 104 
 8 files changed, 110 insertions(+), 172 deletions(-)

diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc 
b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
index 07cb3490f4cf..bde61651da2e 100644
--- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
+++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
@@ -126,7 +126,6 @@ [LibraryClasses.common]
   # ARM PL011 UART Driver
   PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
 
-  FdtHelperLib|Silicon/Qemu/SbsaQemu/Library/FdtHelperLib/FdtHelperLib.inf
   OemMiscLib|Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf
   
SbsaQemuHardwareInfoLib|Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.inf
 
diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf 
b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf
index 291743b19115..9bf0a13de5d1 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf
@@ -1,7 +1,7 @@
 ## @file
 #  This driver modifies ACPI tables for the Qemu SBSA platform
 #
-#  Copyright (c) 2020, Linaro Ltd. All rights reserved.
+#  Copyright (c) Linaro Ltd. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -35,9 +35,9 @@ [LibraryClasses]
   BaseLib
   DebugLib
   DxeServicesLib
-  FdtHelperLib
   PcdLib
   PrintLib
+  SbsaQemuHardwareInfoLib
   UefiDriverEntryPoint
   UefiLib
   UefiRuntimeServicesTableLib
diff --git a/Silicon/Qemu/SbsaQemu/Library/FdtHelperLib/FdtHelperLib.inf 
b/Silicon/Qemu/SbsaQemu/Library/FdtHelperLib/FdtHelperLib.inf
deleted file mode 100644
index 9c059f3e5851..
--- a/Silicon/Qemu/SbsaQemu/Library/FdtHelperLib/FdtHelperLib.inf
+++ /dev/null
@@ -1,33 +0,0 @@
-#/** @file
-#
-#  Component description file for FdtHelperLib module
-#
-#  Copyright (c) 2021, NUVIA Inc. All rights reserved.
-#
-#  SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#**/
-
-[Defines]
-  INF_VERSION= 1.29
-  BASE_NAME  = FdtHelperLib
-  FILE_GUID  = 34e4396f-c2fc-4f9e-ad58-0f98e99e3875
-  MODULE_TYPE= BASE
-  VERSION_STRING = 1.0
-  LIBRARY_CLASS  = FdtHelperLib
-
-[Sources.common]
-  FdtHelperLib.c
-
-[Packages]
-  EmbeddedPkg/EmbeddedPkg.dec
-  MdePkg/MdePkg.dec
-  Silicon/Qemu/SbsaQemu/SbsaQemu.dec
-
-[LibraryClasses]
-  DebugLib
-  FdtLib
-  PcdLib
-
-[FixedPcd]
-  gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdDeviceTreeBaseAddress
diff --git 
a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.inf
 
b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.inf
index 8c2def1878e6..5358dd339eb3 100644
--- 
a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.inf
+++ 
b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.inf
@@ -27,6 +27,8 @@ [LibraryClasses]
   ArmSmcLib
   BaseMemoryLib
   DebugLib
+  FdtLib
 
  [Pcd]
+  gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdDeviceTreeBaseAddress
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdCoreCount
diff --git a/Silicon/Qemu/SbsaQemu/Include/Library/FdtHelperLib.h 
b/Silicon/Qemu/SbsaQemu/Include/Library/FdtHelperLib.h
deleted file mode 100644
index ea9159857215..
--- a/Silicon/Qemu/SbsaQemu/Include/Library/FdtHelperLib.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/** @file
-*  FdtHelperLib.h
-*
-*  Copyright (c) 2021, NUVIA Inc. All rights reserved.
-*
-*  SPDX-License-Identifier: BSD-2-Clause-Patent
-*
-**/
-
-#ifndef FDT_HELPER_LIB_
-#define FDT_HELPER_LIB_
-
-/**
-  Get MPIDR for a given cpu from device tree passed by Qemu.
-
-  @param [in]   CpuIdIndex of cpu to retrieve MPIDR value for.
-
-  @retvalMPIDR value of CPU at index 
-**/
-UINT64
-FdtHelperGetMpidr (
-  IN UINTN   CpuId
-  );
-
-/** Walks through the Device Tree created by Qemu and counts the number
-of CPUs present in it.
-
-@return The number of CPUs present.
-**/
-EFIAPI
-UINT32
-FdtHelperCountCpus (
-  VOID
-  );
-
-#endif /* FDT_HELPER_LIB_ */
diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c 

[edk2-devel] [PATCH edk2-platforms v6 5/7] Platform/SbsaQemu: hang if there is no cpu information

2024-03-06 Thread Marcin Juszkiewicz
In case we do not have cpu information (SMC call fails,
our minimal DT lacks info) we shutdown system.

Signed-off-by: Marcin Juszkiewicz 
---
 .../Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.inf| 2 ++
 .../SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.inf
 
b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.inf
index 5358dd339eb3..acf91225b4c7 100644
--- 
a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.inf
+++ 
b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.inf
@@ -21,6 +21,7 @@ [Packages]
   ArmPkg/ArmPkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
   MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
   Silicon/Qemu/SbsaQemu/SbsaQemu.dec
 
 [LibraryClasses]
@@ -28,6 +29,7 @@ [LibraryClasses]
   BaseMemoryLib
   DebugLib
   FdtLib
+  ResetSystemLib
 
  [Pcd]
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdDeviceTreeBaseAddress
diff --git 
a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
 
b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
index 6315cce3fb7f..e1f1a9588b19 100644
--- 
a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
+++ 
b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -95,7 +96,7 @@ FdtHelperCountCpus (
   Node = fdt_path_offset (DeviceTreeBase, "/cpus");
   if (Node <= 0) {
 DEBUG ((DEBUG_ERROR, "Unable to locate /cpus in DeviceTree\n"));
-return 0;
+ResetShutdown();
   }
 
   CpuCount = 0;

-- 
2.44.0



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




[edk2-devel] [PATCH edk2-platforms v6 3/7] Platform/SbsaQemu: use PcdCoreCount directly

2024-03-06 Thread Marcin Juszkiewicz
During platform initialization we read amount of cpu cores and set
PcdCoreCount so there is no need to call FdtHandler.

Signed-off-by: Marcin Juszkiewicz 
---
 Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf  |  6 ++
 Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c| 10 --
 .../Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c   | 11 ++-
 3 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf 
b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf
index a34f54d431d4..8e2bf8c512f1 100644
--- a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf
+++ b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf
@@ -3,7 +3,7 @@
 #
 #Copyright (c) 2021, NUVIA Inc. All rights reserved.
 #Copyright (c) 2018, Hisilicon Limited. All rights reserved.
-#Copyright (c) 2018, Linaro Limited. All rights reserved.
+#Copyright (c) 2023, Linaro Ltd. All rights reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -29,8 +29,6 @@ [Packages]
 
 [LibraryClasses]
   BaseMemoryLib
-  FdtLib
-  FdtHelperLib
   IoLib
   PcdLib
 
@@ -40,7 +38,6 @@ [Guids]
 [Pcd]
   gArmTokenSpaceGuid.PcdEmbeddedControllerFirmwareRelease
   gArmTokenSpaceGuid.PcdSystemBiosRelease
-  gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdDeviceTreeBaseAddress
 
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdSystemManufacturer
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdSystemSerialNumber
@@ -56,3 +53,4 @@ [Pcd]
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisManufacturer
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisAssetTag
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisSKU
+  gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdCoreCount
diff --git a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c 
b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c
index c38f2851904f..ab97768b5ddc 100644
--- a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c
+++ b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c
@@ -2,7 +2,7 @@
 *  OemMiscLib.c
 *
 *  Copyright (c) 2021, NUVIA Inc. All rights reserved.
-*  Copyright (c) 2020, Linaro Ltd. All rights reserved.
+*  Copyright (c) Linaro Ltd. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -12,14 +12,12 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 
 /** Returns whether the specified processor is present or not.
 
@@ -33,7 +31,7 @@ OemIsProcessorPresent (
   UINTN ProcessorIndex
   )
 {
-  if (ProcessorIndex < FdtHelperCountCpus ()) {
+  if (ProcessorIndex < PcdGet32 (PcdCoreCount)) {
 return TRUE;
   }
 
@@ -76,7 +74,7 @@ OemGetProcessorInformation (
 {
   UINT16 ProcessorCount;
 
-  ProcessorCount = FdtHelperCountCpus ();
+  ProcessorCount = PcdGet32 (PcdCoreCount);
 
   if (ProcessorIndex < ProcessorCount) {
 ProcessorStatus->Bits.CpuStatus   = 1; // CPU enabled
@@ -121,7 +119,7 @@ OemGetMaxProcessors (
   VOID
   )
 {
-  return FdtHelperCountCpus ();
+  return PcdGet32 (PcdCoreCount);
 }
 
 /** Gets information about the cache at the specified cache level.
diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c 
b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
index 9fb17151d7b8..59536ea9575e 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
@@ -1,7 +1,7 @@
 /** @file
 *  This file is an ACPI driver for the Qemu SBSA platform.
 *
-*  Copyright (c) 2020, Linaro Ltd. All rights reserved.
+*  Copyright (c) Linaro Ltd. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -255,7 +255,6 @@ AddMadtTable (
  // Initialize GIC Redistributor Structure
   EFI_ACPI_6_0_GICR_STRUCTURE Gicr = SBSAQEMU_MADT_GICR_INIT();
 
-  // Get CoreCount which was determined eariler after parsing device tree
   NumCores = PcdGet32 (PcdCoreCount);
 
   // Calculate the new table size based on the number of cores
@@ -291,7 +290,7 @@ AddMadtTable (
   New += sizeof (EFI_ACPI_6_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER);
 
   // Add new GICC structures for the Cores
-  for (CoreIndex = 0; CoreIndex < PcdGet32 (PcdCoreCount); CoreIndex++) {
+  for (CoreIndex = 0; CoreIndex < NumCores; CoreIndex++) {
 EFI_ACPI_6_0_GIC_STRUCTURE *GiccPtr;
 
 CopyMem (New, , sizeof (EFI_ACPI_6_0_GIC_STRUCTURE));
@@ -758,12 +757,6 @@ InitializeSbsaQemuAcpiDxe (
 {
   EFI_STATUS Status;
   EFI_ACPI_TABLE_PROTOCOL*AcpiTable;
-  UINT32 NumCores;
-
-  // Parse the device tree and get the number of CPUs
-  NumCores = FdtHelperCountCpus ();
-  Status = PcdSet32S (PcdCoreCount, NumCores);
-  ASSERT_RETURN_ERROR (Status);
 
   // Check if ACPI Table Protocol has been installed
   Status = gBS->LocateProtocol (

-- 
2.44.0



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

[edk2-devel] [PATCH edk2-platforms v6 2/7] Platform/SbsaQemu: read amount of cpus during init

2024-03-06 Thread Marcin Juszkiewicz
We read it once and store in Pcd for future use.

Signed-off-by: Marcin Juszkiewicz 
---
 .../SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf | 4 +++-
 .../SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c   | 9 +
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git 
a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf 
b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf
index 19534b7a274a..9752694a432b 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf
@@ -1,7 +1,7 @@
 ## @file
 #  This driver effectuates SbsaQemu platform configuration settings
 #
-#  Copyright (c) 2019, Linaro Ltd. All rights reserved.
+#  Copyright (c) Linaro Ltd. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -32,6 +32,7 @@ [LibraryClasses]
   PcdLib
   DebugLib
   NonDiscoverableDeviceRegistrationLib
+  SbsaQemuHardwareInfoLib
   UefiDriverEntryPoint
 
 [Pcd]
@@ -46,6 +47,7 @@ [Pcd]
   gArmTokenSpaceGuid.PcdGicDistributorBase
   gArmTokenSpaceGuid.PcdGicRedistributorsBase
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdGicItsBase
+  gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdCoreCount
 
 
 [Depex]
diff --git 
a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c 
b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c
index 4ebbe7c93a19..14e1ec7eab29 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c
@@ -1,7 +1,7 @@
 /** @file
-*  FDT client protocol driver for qemu,mach-virt-ahci DT node
+*  SbsaQemu Platform Initialization
 *
-*  Copyright (c) 2019, Linaro Ltd. All rights reserved.
+*  Copyright (c) Linaro Ltd. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -12,13 +12,12 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
-#include 
-
 EFI_STATUS
 EFIAPI
 InitializeSbsaQemuPlatformDxe (
@@ -123,5 +122,7 @@ InitializeSbsaQemuPlatformDxe (
 }
   }
 
+  SbsaQemuGetCpuCount ();
+
   return EFI_SUCCESS;
 }

-- 
2.44.0



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




[edk2-devel] [PATCH edk2-platforms v6 0/7] get rid of DeviceTree from SbsaQemu

2024-03-06 Thread Marcin Juszkiewicz
We want to stop parsing DeviceTree to gather hardware information.

Instead we ask TF-A for those details using SMC calls. On real hardware
platform it could be asking on-board Embedded Controller.

Hardware information (CPU, Memory) is now in SbsaQemuHardwareInfoLib
together with new code for handling SMC stuff. If TF-A answer to SMC
call would be not success then we go back to parsing DeviceTree data
directly. There is no DT parsing elsewhere.

I hope that we can drop FdtHandler part as part of 202411 release.

TF-A part: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/25707

Signed-off-by: Marcin Juszkiewicz 
---
Changes in v6 (Marcin Juszkiewicz):
- patch 5 now shutdowns system in case of no CPU information

Changes in v5 (Xiong Yining):
- added missing patch
- Link to v5: 
https://openfw.io/edk2-devel/20240131132400.3022662-1-xiongyining1...@phytium.com.cn/

Changes in v4 (Xiong Yining):
- patch 6 add the support for getting the hardware information of memory via 
SMC calls.
- patch 7 add the callback of DeviceTree when SMC calls defined on patch 6 
failled.
- replace FdtHelperGetMpidr() with SbsaQemuGetMpidr() on patch 4 to compile 
successfully.
- Link to v4: 
https://openfw.io/edk2-devel/20240131100027.2538549-1-xiongyining1...@phytium.com.cn/

Changes in v3:
- added SMC_SIP_CALL_SUCCESS
- on SMC call fail tell that SMC call failed instead of blaming TF-A
- hang when there is no cpu information (TODO: shutdown instead)
- Link to v3: 
https://openfw.io/edk2-devel/20240124-no-dt-for-cpu-v3-0-5375fcf09...@linaro.org/

---
Marcin Juszkiewicz (5):
  Platform/SbsaQemu: add SbsaQemuHardwareInfoLib
  Platform/SbsaQemu: read amount of cpus during init
  Platform/SbsaQemu: use PcdCoreCount directly
  Platform/SbsaQemu: move FdtHandlerLib to SbsaQemuHardwareInfoLib
  Platform/SbsaQemu: hang if there is no cpu information

Xiong Yining (2):
  Platform/SbsaQemu: get the information of memory via SMC calls
  Platform/SbsaQemu: add DeviceTree fallbacks to parse memory information

 Platform/Qemu/SbsaQemu/SbsaQemu.dsc |   4 +-
 Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf|   6 +-
 .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf |   4 +-
 .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf |   4 +-
 .../SbsaQemu/Library/FdtHelperLib/FdtHelperLib.inf  |  33 --
 .../SbsaQemuHardwareInfoLib.inf |  36 ++
 .../SbsaQemu/Library/SbsaQemuLib/SbsaQemuLib.inf|   2 +-
 .../SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h |  17 +-
 .../Qemu/SbsaQemu/Include/Library/FdtHelperLib.h|  36 --
 .../Include/Library/SbsaQemuHardwareInfoLib.h   |  73 
 Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c  |  10 +-
 .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c   |  15 +-
 .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c   |   9 +-
 .../SbsaQemu/Library/FdtHelperLib/FdtHelperLib.c|  98 --
 .../SbsaQemuHardwareInfoLib.c   | 352 
 .../Qemu/SbsaQemu/Library/SbsaQemuLib/SbsaQemuMem.c |  54 +--
 16 files changed, 511 insertions(+), 242 deletions(-)
---
base-commit: fe41713668d42b20a2370dab27de3269e877e454
change-id: 20240115-no-dt-for-cpu-2c511393df93

Best regards,
-- 
Marcin Juszkiewicz 



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




[edk2-devel] [PATCH edk2-platforms v6 1/7] Platform/SbsaQemu: add SbsaQemuHardwareInfoLib

2024-03-06 Thread Marcin Juszkiewicz
This library provides functions to check for hardware information.
For now it covers CPU ones:

- amount of cpu cores
- MPIDR value for cpu core
- NUMA node id for cpu core

Values are read from TF-A using platform specific SMC calls.

Signed-off-by: Marcin Juszkiewicz 
---
 Platform/Qemu/SbsaQemu/SbsaQemu.dsc  |  3 +-
 .../SbsaQemuHardwareInfoLib.inf  | 32 +++
 .../SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h  | 15 ++-
 .../Include/Library/SbsaQemuHardwareInfoLib.h| 45 +
 .../SbsaQemuHardwareInfoLib.c| 98 
 5 files changed, 189 insertions(+), 4 deletions(-)

diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc 
b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
index 378600050df9..07cb3490f4cf 100644
--- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
+++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
@@ -1,6 +1,6 @@
 #
 #  Copyright (c) 2021, NUVIA Inc. All rights reserved.
-#  Copyright (c) 2019, Linaro Limited. All rights reserved.
+#  Copyright (c) 2019-2024, Linaro Ltd. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -128,6 +128,7 @@ [LibraryClasses.common]
 
   FdtHelperLib|Silicon/Qemu/SbsaQemu/Library/FdtHelperLib/FdtHelperLib.inf
   OemMiscLib|Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf
+  
SbsaQemuHardwareInfoLib|Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.inf
 
   # Debug Support
   
PeCoffExtraActionLib|ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf
diff --git 
a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.inf
 
b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.inf
new file mode 100644
index ..8c2def1878e6
--- /dev/null
+++ 
b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.inf
@@ -0,0 +1,32 @@
+#/* @file
+#
+#  Copyright (c) Linaro Ltd. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+#*/
+
+[Defines]
+  INF_VERSION= 0x0001001c
+  BASE_NAME  = SbsaQemuHardwareInfoLib
+  FILE_GUID  = 6454006f-6502-46e2-9be4-4bba8d4b29fb
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = ArmPlatformLib
+
+[Sources]
+  SbsaQemuHardwareInfoLib.c
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdePkg/MdePkg.dec
+  Silicon/Qemu/SbsaQemu/SbsaQemu.dec
+
+[LibraryClasses]
+  ArmSmcLib
+  BaseMemoryLib
+  DebugLib
+
+ [Pcd]
+  gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdCoreCount
diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h 
b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h
index 7934875e4aba..d9faee7fa5b2 100644
--- a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h
+++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuSmc.h
@@ -11,8 +11,17 @@
 
 #include 
 
-#define SIP_SVC_VERSION  SMC_SIP_FUNCTION_ID(1)
-#define SIP_SVC_GET_GIC  SMC_SIP_FUNCTION_ID(100)
-#define SIP_SVC_GET_GIC_ITS  SMC_SIP_FUNCTION_ID(101)
+#define SIP_SVC_VERSIONSMC_SIP_FUNCTION_ID(1)
+#define SIP_SVC_GET_GICSMC_SIP_FUNCTION_ID(100)
+#define SIP_SVC_GET_GIC_ITSSMC_SIP_FUNCTION_ID(101)
+#define SIP_SVC_GET_CPU_COUNT  SMC_SIP_FUNCTION_ID(200)
+#define SIP_SVC_GET_CPU_NODE   SMC_SIP_FUNCTION_ID(201)
+
+/*
+ *  SMCC does not define return codes for SiP functions.
+ *  We use Architecture ones then.
+ */
+
+#define SMC_SIP_CALL_SUCCESS  SMC_ARCH_CALL_SUCCESS
 
 #endif /* SBSA_QEMU_SMC_H_ */
diff --git a/Silicon/Qemu/SbsaQemu/Include/Library/SbsaQemuHardwareInfoLib.h 
b/Silicon/Qemu/SbsaQemu/Include/Library/SbsaQemuHardwareInfoLib.h
new file mode 100644
index ..ca52c6b27093
--- /dev/null
+++ b/Silicon/Qemu/SbsaQemu/Include/Library/SbsaQemuHardwareInfoLib.h
@@ -0,0 +1,45 @@
+/** @file
+*
+*  Copyright (c) Linaro Ltd. All rights reserved.
+*
+*  SPDX-License-Identifier: BSD-2-Clause-Patent
+*
+**/
+
+#ifndef SBSA_QEMU_HARDWARE_INFO_
+#define SBSA_QEMU_HARDWARE_INFO_
+
+/**
+  Get CPU count from information passed by Qemu.
+
+**/
+VOID
+SbsaQemuGetCpuCount (
+  VOID
+  );
+
+/**
+  Get MPIDR for a given cpu from device tree passed by Qemu.
+
+  @param [in]   CpuIdIndex of cpu to retrieve MPIDR value for.
+
+  @retvalMPIDR value of CPU at index 
+**/
+UINT64
+SbsaQemuGetMpidr (
+  IN UINTN  CpuId
+  );
+
+/**
+  Get NUMA node id for a given cpu from device tree passed by Qemu.
+
+  @param [in]   CpuIdIndex of cpu to retrieve NUMA node id for.
+
+  @retvalNUMA node id for CPU at index 
+**/
+UINT64
+SbsaQemuGetCpuNumaNode (
+  IN UINTN  CpuId
+  );
+
+#endif /* SBSA_QEMU_HARDWARE_INFO_ */
diff --git 
a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
 
b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
new file mode 100644
index