[edk2-devel] [PATCH v3 2/2] MdePkg: Add gEfiDeviceSignatureDatabaseGuid to dec

2024-03-26 Thread Wenxing Hou
According to UEFI 2.10 spec
32.8.2 UEFI Device Signature Variable GUID and Variable Name section,
add gEfiDeviceSignatureDatabaseGuid to dec.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Jiewen Yao 
Signed-off-by: Wenxing Hou 
---
 MdePkg/MdePkg.dec | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 0459418906..0c18e1decd 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -4,7 +4,7 @@
 # It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of
 # EFI1.10/UEFI2.7/PI1.7 and some Industry Standards.
 #
-# Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2024, Intel Corporation. All rights reserved.
 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
 # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development LP
 # Copyright (c) 2022, Loongson Technology Corporation Limited. All rights 
reserved.
@@ -740,6 +740,12 @@
   ## Include/Protocol/SerilaIo.h
   gEfiSerialTerminalDeviceTypeGuid = { 0x6AD9A60F, 0x5815, 0x4C7C, { 0x8A, 
0x10, 0x50, 0x53, 0xD2, 0xBF, 0x7A, 0x1B }}
 
+  # GUIDs defined in UEFI2.10
+  #
+  ## GUID used to specify section with devdb content
+  ## Include/Guid/DeviceAuthentication.h
+  gEfiDeviceSignatureDatabaseGuid  = { 0xb9c2b4f4, 0xbf5f, 0x462d, {0x8a, 
0xdf, 0xc5, 0xc7, 0xa, 0xc3, 0x5d, 0xad }}
+
   #
   # GUID defined in PI1.0
   #
-- 
2.26.2.windows.1



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




[edk2-devel] [PATCH v3 0/2] Add UEFI 2.10 DeviceAuthentication and GUID

2024-03-26 Thread Wenxing Hou
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Jiewen Yao 
Signed-off-by: Wenxing Hou 

Wenxing Hou (2):
  MdePkg: Add UEFI 2.10 DeviceAuthentication
  MdePkg: Add gEfiDeviceSignatureDatabaseGuid to dec

 MdePkg/Include/Guid/DeviceAuthentication.h | 61 ++
 MdePkg/MdePkg.dec  |  8 ++-
 2 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 MdePkg/Include/Guid/DeviceAuthentication.h

-- 
2.26.2.windows.1



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




[edk2-devel] [PATCH v3 1/2] MdePkg: Add UEFI 2.10 DeviceAuthentication

2024-03-26 Thread Wenxing Hou
According to UEFI 2.10 spec
32.8.2 UEFI Device Signature Variable GUID and Variable Name section,
add signature database for device authentication.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Jiewen Yao 
Signed-off-by: Wenxing Hou 
---
 MdePkg/Include/Guid/DeviceAuthentication.h | 61 ++
 1 file changed, 61 insertions(+)
 create mode 100644 MdePkg/Include/Guid/DeviceAuthentication.h

diff --git a/MdePkg/Include/Guid/DeviceAuthentication.h 
b/MdePkg/Include/Guid/DeviceAuthentication.h
new file mode 100644
index 00..0dd933dfa5
--- /dev/null
+++ b/MdePkg/Include/Guid/DeviceAuthentication.h
@@ -0,0 +1,61 @@
+/** @file
+  Guid & data structure used for Device Security.
+
+  Copyright (c) 2024, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EFI_DEVICE_AUTHENTICATION_GUID_H_
+#define EFI_DEVICE_AUTHENTICATION_GUID_H_
+
+/**
+  This is a signature database for device authentication, instead of image 
authentication.
+
+  The content of the signature database is same as the one in db/dbx. (a list 
of EFI_SIGNATURE_LIST)
+**/
+#define EFI_DEVICE_SIGNATURE_DATABASE_GUID \
+  {0xb9c2b4f4, 0xbf5f, 0x462d, 0x8a, 0xdf, 0xc5, 0xc7, 0xa, 0xc3, 0x5d, 0xad}
+#define EFI_DEVICE_SECURITY_DATABASE  L"devdb"
+
+extern EFI_GUID  gEfiDeviceSignatureDatabaseGuid;
+
+/**
+  Signature Database:
+
+  +---+ <-
+  | SignatureType (GUID)  |  |
+  +---+  |
+  | SignatureListSize (UINT32)|  |
+  +---+  |
+  | SignatureHeaderSize (UINT32)  |  |
+  +---+  |
+  | SignatureSize (UINT32)|  
|-EFI_SIGNATURE_LIST (1)
+  +---+  |
+  | SignatureHeader (SignatureHeaderSize) |  |
+  +---+ <--  |
+  | SignatureOwner (GUID) |   |  |
+  +---+   |-EFI_SIGNATURE_DATA (1)
+  | SignatureData (SignatureSize - 16)|   |  |
+  +---+ <--  |
+  | SignatureOwner (GUID) |   |  |
+  +---+   |-EFI_SIGNATURE_DATA (n)
+  | SignatureData (SignatureSize - 16)|   |  |
+  +---+ <-
+  | SignatureType (GUID)  |  |
+  +---+  |
+  | SignatureListSize (UINT32)|  
|-EFI_SIGNATURE_LIST (n)
+  +---+  |
+  | ...   |  |
+  +---+ <-
+
+  SignatureType := EFI_CERT_SHAxxx_GUID |
+   EFI_CERT_RSA2048_GUID |
+   EFI_CERT_RSA2048_SHAxxx_GUID |
+   EFI_CERT_X509_GUID |
+   EFI_CERT_X509_SHAxxx_GUID
+  (xxx = 256, 384, 512)
+
+**/
+
+#endif
-- 
2.26.2.windows.1



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




[edk2-devel] [PATCH 1/1] MdeModulePkg/XhciDxe: Add PCD for the delay of HCRST

2024-03-26 Thread Xianglei Cai
https://bugzilla.tianocore.org/show_bug.cgi?id=4727

Recently some of XHCI host controllers require to have
extra 1ms delay before accessing any MMIO register
during reset. PHY transition from P3 to P0 can take
around 1.3ms and the xHCI reset can take around 1.5ms.
Add PCD to control the delay, the default is 2 ms.

Cc: Hao A Wu 
Cc: Ray Ni   
Cc: Jian J Wang  
Cc: Liming Gao   
Cc: Jenny Huang  
Cc: More Shih
Cc: Chiu, Ian

Signed-off-by: Xianglei Cai 
---
 MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h  | 1 +
 MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf | 4 
 MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c   | 2 +-
 MdePkg/MdePkg.dec| 4 
 MdePkg/MdePkg.dsc| 1 +
 5 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h 
b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h
index 44016758724c..c9a12095c29e 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h
@@ -28,6 +28,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf 
b/MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
index 18ef87916ae4..2ee4c22d1e32 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
@@ -56,6 +56,7 @@
   DebugLib
   ReportStatusCodeLib
   TimerLib
+  PcdLib
 
 [Guids]
   gEfiEventExitBootServicesGuid ## SOMETIMES_CONSUMES ## Event
@@ -64,6 +65,9 @@
   gEfiPciIoProtocolGuid ## TO_START
   gEfiUsb2HcProtocolGuid## BY_START
 
+[Pcd]
+  gEfiMdePkgTokenSpaceGuid.PcdDelayXhciHCReset  ## CONSUMES
+
 # [Event]
 # EVENT_TYPE_PERIODIC_TIMER   ## CONSUMES
 #
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c 
b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
index 40f2f1f22766..525942a167b0 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
@@ -864,7 +864,7 @@ XhcResetHC (
 // Otherwise there may have the timeout case happened.
 // The below is a workaround to solve such problem.
 //
-gBS->Stall (XHC_1_MILLISECOND);
+gBS->Stall (PcdGet16 (PcdDelayXhciHCReset));
 Status = XhcWaitOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RESET, FALSE, 
Timeout);
 
 if (!EFI_ERROR (Status)) {
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 0459418906f8..a5b3ce94072c 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -2510,5 +2510,9 @@
   # @Prompt Memory encryption attribute
   
gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr|0|UINT64|0x002e
 
+  ## This dynamic PCD indicates time delay for XHCI registers access after it 
issues HCRST.
+  # @Prompt Delay access XHCI register after it issues HCRST (us)
+  gEfiMdePkgTokenSpaceGuid.PcdDelayXhciHCReset|2000|UINT16|0x0043
+
 [UserExtensions.TianoCore."ExtraFiles"]
   MdePkgExtra.uni
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index 109224c527f7..23aea04fea2e 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -31,6 +31,7 @@
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f
   gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE000
+  gEfiMdePkgTokenSpaceGuid.PcdDelayXhciHCReset|2000
 
 [LibraryClasses]
   SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
-- 
2.42.0.windows.2



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




Re: [edk2-devel] [PATCH] ShellPkg: Update smbiosview type 4 with SMBIOS 3.6 fields

2024-03-26 Thread Gao, Zhichao
Reviewed-by: Zhichao Gao 

Thanks,
Zhichao

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Lien,
> HoraceX
> Sent: Tuesday, March 26, 2024 5:11 PM
> To: devel@edk2.groups.io
> Cc: Lien, HoraceX ; Gao, Zhichao
> 
> Subject: [edk2-devel] [PATCH] ShellPkg: Update smbiosview type 4 with
> SMBIOS 3.6 fields
> 
> From: HoraceX Lien 
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4737
> 
> update smbiosview type 4 related fileds.
> 
> Signed-off-by: HoraceX Lien 
> Cc: Zhichao Gao 
> ---
>  .../Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> index f96317b314..48b4488215 100644
> ---
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> +++
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> @@ -520,6 +520,10 @@ SmbiosPrintStructure (
>  ShellPrintEx (-1, -1, L"Thread Count 2: %u\n", Struct->Type4-
> >ThreadCount2);   } +  if (AE_SMBIOS_VERSION (0x3, 0x6) && (Struct-
> >Hdr->Length > 0x2E)) {+ShellPrintEx (-1, -1, L"Thead Enable: %u\n",
> Struct->Type4->ThreadEnabled);+  }+   break;  //--
> 2.43.0.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#117106):
> https://edk2.groups.io/g/devel/message/117106
> Mute This Topic: https://groups.io/mt/105155005/1768756
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [zhichao@intel.com]
> -=-=-=-=-=-=
> 



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




Re: [edk2-devel] [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config language searching optimization

2024-03-26 Thread Nickle Wang via groups.io
Hi Abner,

Could we change "DescriptionStr" below to something like "XuefiString", so 
people don't think it is a regular English string of HII statement?

> +  EFI_STRING_ID Description;  // String 
> token of this question.
> +  CHAR16*DescriptionStr;  // String of 
> this question.
> +  EFI_STRING_ID Help; // String 
> token of help message.


Thanks,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Tuesday, March 26, 2024 11:15 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config language
> searching optimization
> 
> External email: Use caution opening links or attachments
> 
> 
> From: abnchang 
> 
> Build up the x-uefi-redfish string database for the Redfish confg language
> searching, instead of using HII String protocol.
> This can improve the time consumption lot on searching strings.
> 
> Signed-off-by: Abner Chang 
> Co-authored-by: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  .../RedfishPlatformConfigImpl.h   | 107 ++-
>  .../RedfishPlatformConfigDxe.c|  23 +-
>  .../RedfishPlatformConfigImpl.c   | 820 +-
>  3 files changed, 878 insertions(+), 72 deletions(-)
> 
> diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> index 9f4312decf5..6e6c7fdb8a9 100644
> --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> @@ -2,7 +2,8 @@
>This file defines the EDKII Redfish Platform Config Protocol private 
> structure.
> 
>(C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> -  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
> + reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -30,6 +31,10 @@
>  #define ENGLISH_LANGUAGE_CODE  "en-US"
>  #define X_UEFI_SCHEMA_PREFIX   "x-uefi-redfish-"
> 
> +#define MAX_X_UEFI_REDFISH_STRING_SIZE  (128 * 2)// 128 character in UCS.
> +
> +typedef struct _REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE
> +REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE;
> +
>  //
>  // Definition of REDFISH_PLATFORM_CONFIG_PRIVATE.
>  //
> @@ -46,17 +51,49 @@ typedef struct {
>CHAR8**SchemaList;// Schema list
>  } REDFISH_PLATFORM_CONFIG_SCHEMA;
> 
> +// Defines the number of elements in array #define
> +X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER  1024
> +
> +//
> +// Definition of x-uefi-redfish string element.
> +//
> +typedef struct {
> +  EFI_STRING_IDStringId;
> +  CHAR16   *UcsString;
> +} REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT;
> +
> +//
> +// Discrete string array buffer, each has
> X_UEFI_REDFISH_STRING_ARRAY_NUMBER element.
> +//
> +typedef struct {
> +  LIST_ENTRY  NextArray;
> +  REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT*ArrayEntryAddress;
> +} REDFISH_X_UEFI_STRINGS_ARRAY;
> +
> +//
> +// x-uefi-redfish string database, x-uefi-redfish language based.
> +//
> +typedef struct {
> +  LIST_ENTRYNextXuefiRedfishLanguage;
>  // Link to the
> next suppoted x-uefi-Redfish language.
> +  CHAR8 *XuefiRedfishLanguage;   
>  // x-uefi-redfish
> language.
> +  UINTN StringsArrayBlocks;  
>  // Number of the array
> blocks that accommodate X_UEFI_REDFISH_STRING_ARRAY_NUMBER
> + 
>  // elements in each.
> +  LIST_ENTRYXuefiRedfishStringArrays;
>  // Link entry of x-
> uefi-redfish string array.
> +} REDFISH_X_UEFI_STRING_DATABASE;
> +
>  //
>  // Definition of REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE
>  //
>  typedef struct {
>LIST_ENTRYLink;
> -  HII_FORMSET   *HiiFormSet; // Pointer to HII 
> formset data.
> -  EFI_GUID  Guid;// Formset GUID.
> -  EFI_HII_HANDLEHiiHandle;   // Hii Handle of this 
> formset.
> -  LIST_ENTRYHiiFormList; // Form list that keep 
> form data under
> this formset.
> -  CHAR16*DevicePathStr;  // Device path of this 
> formset.
> -  REDFISH_PLATFORM_CONFIG_SCHEMASupportedSchema; // Schema that is
> supported in this formset.
> +  HII_FORMSET   *HiiFormSet;// Pointer 
> to HII formset data.
> +  EFI_GUID  Guid;   // Formset 
> GUID.
> +  EFI_HII_HAND

Re: [edk2-devel] [PATCH] Platform/Loongson: Remove minimium memory size limitation

2024-03-26 Thread xianglai
hi  maobibo:
>
>
> On 2024/3/25 下午5:25, xianglai wrote:
>> From: Bibo Mao 
>>
>> Temparory stack memory on PEI is hardcoded now, also minimium memory
>>
[..]
>> +
>> +  QemuFwCfgSelectItem (FwCfgItem);
>> +  for (Processed = 0; Processed < FwCfgSize; Processed += sizeof 
>> MemoryMapEntry) {
>> +    QemuFwCfgReadBytes (sizeof MemoryMapEntry, &MemoryMapEntry);
>> +    if (MemoryMapEntry.Type != EfiAcpiAddressRangeMemory) {
>> +  continue;
>> +    }
>> +
>> +    /*
>> + * Find memory map entry where PEI temp stack is located
>> + */
>> +    if ((MemoryMapEntry.BaseAddr <= Base) &&
>> +    (Base < (MemoryMapEntry.BaseAddr + MemoryMapEntry.Length))) {
>> +    RamTop = MemoryMapEntry.BaseAddr + MemoryMapEntry.Length;
> Xianglai,
>
> Will it be better if there is one "break" sentence?

Ok,I will fix it in the next version.

Thanks,
Xianglai.
>
> Regards
> Bibo Mao
>
>> +    }
>> +  }
>> +
>> +  if (RamTop == 0) {
>> +    DEBUG ((DEBUG_ERROR, "ERROR: No memory map entry contains temp stack 
>> \n"));
>> +    ASSERT (FALSE);
>> +  }
>>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117144): https://edk2.groups.io/g/devel/message/117144
Mute This Topic: https://groups.io/mt/105134610/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 Bug Triage - APAC / NAMO - Tuesday, March 26, 2024 #cal-cancelled

2024-03-26 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:2159771 
UID:mlda.1580078539586725120.r...@groups.io
DTSTAMP:20240326T235656Z
ORGANIZER;CN=Liming Gao;SENT-BY="mailto:gaolim...@byosoft.com.cn":mailto:
 gaolim...@byosoft.com.cn
DTSTART:20240327T013000Z
DTEND:20240327T023000Z
SUMMARY:TianoCore Bug Triage - APAC / NAMO
DESCRIPTION:TianoCore Bug Triage - APAC / NAMO\n\nHosted by Liming Gao\n\
 n
 \n\nMicrosoft Teams meeting\n\n*Join on your computer or mobile a
 pp*\n\nClick here to join the meeting ( https://teams.microsoft.com/l/mee
 tup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40
 thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255
 d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d )\n\n*Jo
 in with a video conferencing device*\n\nte...@conf.intel.com\n\nVideo Con
 ference ID: 116 062 094 0\n\nAlternate VTC dialing instructions ( https:/
 /conf.intel.com/teams/?conf=1160620940&ivr=teams&d=conf.intel.com&test=te
 st_call )\n\n*Or call in (audio only)*\n\n+1 916-245-6934\,\,77463821# ( 
 tel:+19162456934\,\,77463821# ) United States\, Sacramento\n\nPhone Confe
 rence ID: 774 638 21#\n\nFind a local number ( https://dialin.teams.micro
 soft.com/d195d438-2daa-420e-b9ea-da26f9d1d6d5?id=77463821 ) | Reset PIN (
  https://mysettings.lync.com/pstnconferencing )\n\nLearn More ( https://a
 ka.ms/JoinTeamsMeeting ) | Meeting options ( https://teams.microsoft.com/
 meetingOptions/?organizerId=b286b53a-1218-4db3-bfc9-3d4c5aa7669e&tenantId
 =46c98d88-e344-4ed4-8496-4ed7712e255d&threadId=19_meeting_OTUyZTg2NjgtNDh
 lNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh@thread.v2&messageId=0&language=en-US )
LOCATION:https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN
 2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%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][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex()

2024-03-26 Thread Mike Maslenkin
Hi,

I have updated patches with R-b and pushed it to PR
https://github.com/tianocore/edk2-redfish-client/pull/85

Thank you for the review!

Regards,
Mike

On Tue, Mar 26, 2024 at 4:41 PM Nickle Wang  wrote:
>
> Thanks for your reminder, Abner. I verify this patch series on my system, and 
> I don't see any issue.
>
>
>
> Hi @Mike Maslenkin, please add Abner and my reviewed-by to the commit 
> messages. And we can merge the pull request.
>
>
>
> Thanks,
>
> Nickle
>
>
>
> > -Original Message-
>
> > From: Chang, Abner 
>
> > Sent: Monday, March 25, 2024 10:13 AM
>
> > To: Mike Maslenkin ; devel@edk2.groups.io
>
> > Cc: Igor Kulchytskyy ; Nickle Wang 
>
> > Subject: RE: [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix
>
> > GetRedpathNodeByIndex()
>
> >
>
> > External email: Use caution opening links or attachments
>
> >
>
> >
>
> > [AMD Official Use Only - General]
>
> >
>
> > For this patch set,  Reviewed-by: Abner Chang 
>
> >
>
> > Hi Nickle, please also take a look at this change. Thanks Abner
>
> >
>
> > > -Original Message-
>
> > > From: Mike Maslenkin 
>
> > > Sent: Saturday, March 23, 2024 8:01 PM
>
> > > To: devel@edk2.groups.io
>
> > > Cc: Chang, Abner ; Igor Kulchytskyy
>
> > > ; Nickle Wang ; Mike Maslenkin
>
> > > 
>
> > > Subject: [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix
>
> > > GetRedpathNodeByIndex()
>
> > >
>
> > > Caution: This message originated from an External Source. Use proper
>
> > > caution when opening attachments, clicking links, or responding.
>
> > >
>
> > >
>
> > > This set contains fixes for proper nodes handling in 
> > > GetRedpathNodeByIndex().
>
> > > It fixes handling of nodes with Index different from 0, it removes
>
> > > leading '/' returned for section with Index = 0, also it fixes return
>
> > > of the last section.
>
> >
>
> > This set does not have any impact to
>
> > > existing code,
>
> > > because in all places this function is used to obtain the end of the 
> > > first section.
>
> > > And actually returned pointer to the requested section is not used.
>
> > > The current usages is:
>
> > >GetRedpathNodeByIndex (ConfigLangList.List[0].ConfigureLang, 0,
>
> > > &EndOfChar);
>
> > >
>
> > > and return of EndOfChar value is not affected by this set.
>
> > >
>
> > > Cc: Abner Chang 
>
> > > Cc: Igor Kulchytskyy 
>
> > > Cc: Nickle Wang 
>
> > > Signed-off-by: Mike Maslenkin 
>
> > >
>
>


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




Re: [edk2-devel] [PATCH 1/1] OvmfPkg: Align the SEC module within OvmfPkgX64

2024-03-26 Thread Ard Biesheuvel
On Tue, 26 Mar 2024 at 22:01, Glenn Griffin  wrote:
>
> Prior to this change the alignment of the SEC module would be 4 bytes.
> This is inconsistent with the expectations of the compiler and can lead
> to unexpected behavior.
>
> For example a modern version of clang with size optimizations enabled
> (-Oz) can break the ALIGN_POINTER macro in the SEC module.
>

...
>
> However by mapping the data section that contains mArray onto a
> 4-byte-aligned base address we violate the compiler's expectations. The
> last 4 bits of the mArray address are no longer zeroes leading to an
> ALIGN_POINTER macro that doesn't work.
>
> Cc: Ard Biesheuvel 
>
> Signed-off-by: Glenn Griffin 
> ---
>  OvmfPkg/OvmfPkgX64.fdf | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
> index eb3fb90cb8b6..8b60355de40b 100644
> --- a/OvmfPkg/OvmfPkgX64.fdf
> +++ b/OvmfPkg/OvmfPkgX64.fdf
> @@ -434,7 +434,7 @@ [FV.FVMAIN_COMPACT]
>
>  [Rule.Common.SEC]
>FILE SEC = $(NAMED_GUID) {
> -PE32 PE32   $(INF_OUTPUT)/$(MODULE_NAME).efi
> +PE32 PE32   Align=Auto$(INF_OUTPUT)/$(MODULE_NAME).efi
>  UI   STRING ="$(MODULE_NAME)" Optional
>  VERSION  STRING ="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
>}

Thanks Glenn. As you have mentioned to me off-list, this is the same
issue Andrew reported here

Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3887

Your fix is obviously correct, and I intend to merge it unless anyone
has any concerns with this.


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




[edk2-devel] [PATCH 1/1] OvmfPkg: Align the SEC module within OvmfPkgX64

2024-03-26 Thread Glenn Griffin
Prior to this change the alignment of the SEC module would be 4 bytes.
This is inconsistent with the expectations of the compiler and can lead
to unexpected behavior.

For example a modern version of clang with size optimizations enabled
(-Oz) can break the ALIGN_POINTER macro in the SEC module.

Here is a minimal example:

https://godbolt.org/z/fzW67ndTY

```
unsigned char mArray[112];

#define ALIGN_VALUE(Value, Alignment)  ((Value) + (((Alignment) -
(Value)) & ((Alignment) - 1)))
#define ALIGN_POINTER(Pointer, Alignment)  ((void *) (ALIGN_VALUE
((uint64_t)(Pointer), (Alignment

int main() {
printf("0x%llx\n", mArray);
printf("0x%llx\n", ALIGN_POINTER(mArray, 64));
return 0;
}
```

The above code compiles down to:

```
main:   # @main
pushr14
pushrbx
pushrax
lea rbx, [rip + .L.str]
lea r14, [rip + mArray]
mov rdi, rbx
mov rsi, r14
xor eax, eax
callprintf@PLT
push64
pop rsi
sub esi, r14d
and esi, 48
add rsi, r14
mov rdi, rbx
xor eax, eax
callprintf@PLT
xor eax, eax
add rsp, 8
pop rbx
pop r14
ret
mArray:
.zero   112

.L.str:
.asciz  "0x%llx\n"
```

Note that the `value & 63` in the ALIGN_VALUE implementation gets
transformed into `and esi, 48` in the assembly. The compiler knows
the array address is already aligned so it believes there is no need to
clear the last 4 bits of the address.

However by mapping the data section that contains mArray onto a
4-byte-aligned base address we violate the compiler's expectations. The
last 4 bits of the mArray address are no longer zeroes leading to an
ALIGN_POINTER macro that doesn't work.

Cc: Ard Biesheuvel 

Signed-off-by: Glenn Griffin 
---
 OvmfPkg/OvmfPkgX64.fdf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index eb3fb90cb8b6..8b60355de40b 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -434,7 +434,7 @@ [FV.FVMAIN_COMPACT]

 [Rule.Common.SEC]
   FILE SEC = $(NAMED_GUID) {
-PE32 PE32   $(INF_OUTPUT)/$(MODULE_NAME).efi
+PE32 PE32   Align=Auto$(INF_OUTPUT)/$(MODULE_NAME).efi
 UI   STRING ="$(MODULE_NAME)" Optional
 VERSION  STRING ="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
   }
-- 
2.44.0.396.g6e790dbe36-goog


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




[edk2-devel] [PATCH 1/1] OvmfPkg: Align the SEC module within OvmfPkgX64

2024-03-26 Thread Glenn Griffin
Prior to this change the alignment of the SEC module would be 4 bytes.
This is inconsistent with the expectations of the compiler and can lead
to unexpected behavior.

For example a modern version of clang with size optimizations enabled
(-Oz) can break the ALIGN_POINTER macro in the SEC module.

Here is a minimal example:

https://godbolt.org/z/fzW67ndTY

```
unsigned char mArray[112];

#define ALIGN_VALUE(Value, Alignment)  ((Value) + (((Alignment) - (Value)) & 
((Alignment) - 1)))
#define ALIGN_POINTER(Pointer, Alignment)  ((void *) (ALIGN_VALUE 
((uint64_t)(Pointer), (Alignment

int main() {
printf("0x%llx\n", mArray);
printf("0x%llx\n", ALIGN_POINTER(mArray, 64));
return 0;
}
```

The above code compiles down to:

```
main:                                   # @main
push    r14
push    rbx
push    rax
lea     rbx, [rip + .L.str]
lea     r14, [rip + mArray]
mov     rdi, rbx
mov     rsi, r14
xor     eax, eax
call    printf@PLT
push    64
pop     rsi
sub     esi, r14d
and     esi, 48
add     rsi, r14
mov     rdi, rbx
xor     eax, eax
call    printf@PLT
xor     eax, eax
add     rsp, 8
pop     rbx
pop     r14
ret
mArray:
.zero   112

.L.str:
.asciz  "0x%llx\n"
```

Note that the `value & 63` in the ALIGN_VALUE implementation gets
transformed into `and esi, 48` in the assembly. The compiler knows
the array address is already aligned so it believes there is no need to
clear the last 4 bits of the address.

However by mapping the data section that contains mArray onto a
4-byte-aligned base address we violate the compiler's expectations. The
last 4 bits of the mArray address are no longer zeroes leading to an
ALIGN_POINTER macro that doesn't work.

Cc: Ard Biesheuvel 

Signed-off-by: Glenn Griffin 
---
OvmfPkg/OvmfPkgX64.fdf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index eb3fb90cb8b6..8b60355de40b 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -434,7 +434,7 @@ [FV.FVMAIN_COMPACT]

[Rule.Common.SEC]
FILE SEC = $(NAMED_GUID) {
-    PE32     PE32           $(INF_OUTPUT)/$(MODULE_NAME).efi
+    PE32     PE32   Align=Auto    $(INF_OUTPUT)/$(MODULE_NAME).efi
UI       STRING ="$(MODULE_NAME)" Optional
VERSION  STRING ="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
}
--
2.44.0.396.g6e790dbe36-goog


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




Re: [edk2-devel] [PATCH v3 00/24] Provide SEV-SNP support for running under an SVSM

2024-03-26 Thread Lendacky, Thomas via groups.io
Any issues with this version of the series? Still looking for 
Reviewed-by's for the MdePkg, UefiCpuPkg and UefiPayloadPkg related patches.


Once I get those, I'll submit the edk2-platform patches to support the new 
library as a response to these patches for a quick review.


Thanks,
Tom

On 3/8/24 09:29, Tom Lendacky wrote:


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

This series adds SEV-SNP support for running OVMF under an Secure VM
Service Module (SVSM) at a less privileged VM Privilege Level (VMPL).
By running at a less priviledged VMPL, the SVSM can be used to provide
services, e.g. a virtual TPM, for the guest OS within the SEV-SNP
confidential VM (CVM) rather than trust such services from the hypervisor.

Currently, OVMF expects to run at the highest VMPL, VMPL0, and there are
certain SNP related operations that require that VMPL level. Specifically,
the PVALIDATE instruction and the RMPADJUST instruction when setting the
the VMSA attribute of a page (used when starting APs).

If OVMF is to run at a less privileged VMPL, e.g. VMPL2, then it must
use an SVSM (which is running at VMPL0) to perform the operations that
it is no longer able to perform.

When running under an SVSM, OVMF must know the APIC IDs of the vCPUs that
it will be starting. As a result, the GHCB APIC ID retrieval action must
be performed. Since this service can also work with SEV-SNP running at
VMPL0, the patches to make use of this feature are near the beginning of
the series.

How OVMF interacts with and uses the SVSM is documented in the SVSM
specification [1] and the GHCB specification [2].

This support creates a new AmdSvsmLib library that is used by MpInitLib.
The edk2-platforms repo requires updates/patches to add the new library
requirement. To accomodate that, this series could be split between:

patch number 12:
   UefiCpuPkg/AmdSvsmLib: Create the AmdSvsmLib library to support an SVSM

and patch number 13:
   UefiPayloadPkg: Prepare UefiPayloadPkg to use the AmdSvsmLib library

The updates to edk2-platforms can be applied at the split.

This series introduces support to run OVMF under an SVSM. It consists
of:
   - Retrieving the list of vCPU APIC IDs and starting up all APs without
 performing a broadcast SIPI
   - Reorganizing the page state change support to not directly use the
 GHCB buffer since an SVSM will use the calling area buffer, instead
   - Detecting the presence of an SVSM
   - When not running at VMPL0, invoking the SVSM for page validation and
 VMSA page creation/deletion
   - Detecting and allowing OVMF to run in a VMPL other than 0 when an
 SVSM is present

The series is based off of commit:

   e60529df58e4 ("UefiPayloadPkg: Make Dsc accomodative of other archs")

[1] 
https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/specifications/58019.pdf
[2] 
https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/specifications/56421.pdf

Cc: Anatol Belski 
Cc: Anthony Perard 
Cc: Ard Biesheuvel 
Cc: Corvin Köhne 
Cc: Erdem Aktas 
Cc: Gerd Hoffmann 
Cc: Gua Guo 
Cc: Guo Dong 
Cc: James Lu 
Cc: Jianyong Wu 
Cc: Jiewen Yao 
Cc: Laszlo Ersek 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Michael Roth 
Cc: Min Xu 
Cc: Rahul Kumar 
Cc: Ray Ni 
Cc: Rebecca Cran 
Cc: Sean Rhodes 
Cc: Zhiguang Liu 

---

Changes in v3:
- Renamed CcSvsmLib to a more AMD-specific AmdSvsmLib with corresponding
   function name changes
- Moved the GHCB APIC ID list GUID definition from MdePkg to UefiCpuPkg
   and change the name from gEfiApicIdsGuid to gGhcbApicIdsGuid
- Separated the OvmfPkg changes for the AmdSvsmLib into two patches:
   - First patch adds usage of the AmdSvsmLib NULL library
   - Second patch adds the OVMF AmdSvsmLib implementation
- Updated the commit message for the OVMF AmdSvsmLib implementation to
   indicate that the base functionality for PVALIDATE and RMPADJUST was
   copied from the original locations in prep for converting those sites
   to using the library API.

Changes in v2:
- Move the APIC IDs retrieval support to the beginning of the patch series
 - Use a GUIDed HOB to hold the APIC ID list instead of a PCD
- Split up Page State Change reorganization into multiple patches
- Created CcSvsmLib library instead of extending CcExitLib
 - This will require a corresponding update to edk2-platform DSC files
 - Removed Ray Ni's Acked-by since it is not a minor change
- Variable name changes and other misc changes

Tom Lendacky (24):
   OvmfPkg/BaseMemEncryptLib: Fix error check from AsmRmpAdjust()
   MdePkg: GHCB APIC ID retrieval support definitions
   UefiCpuPkg/MpInitLib: Always use AP Create if GhcbApicIds HOB is
 present
   OvmfPkg/PlatformPei: Retrieve APIC IDs from the hypervisor
   OvmfPkg/BaseMemEncryptSevLib: Fix uncrustify errors
   OvmfPkg/BaseMemEncryptSevLib: Calculate memory size for Page State
 Change
   MdePkg: Avoid hardcoded value for number of Page State Change entries
   OvmfPkg/BaseMemEncryptSevLib: Re-organize p

[edk2-devel] [PATCH v1 1/1] ArmVirtPkg: Kvmtool: Fix ACPI/DT boot selection

2024-03-26 Thread Sami Mujawar
The Kvmtool guest firmware uses the dynamic HII
PCD PcdForceNoAcpi to determine if ACPI tables
or the DT must be used for booting an OS.

This PcdForceNoAcpi is a BOOLEAN value that can
be configured using the variable "ForceNoAcpi"
specifing the gOvmfVariableGuid GUID which is
"50BEA1E5-A2C5-46E9-9B3A-59596516B00A".

However, this feature was not working as the
PCD was not defined in the platform DSC file
and the DEPEX section in KvmtoolPlatfomDxe.inf
was not set correctly.

Therefore, fix this issue so that the ACPI/DT
boot selection can be done from the UEFI shell
as shown below.

1. Check the status of the 'ForceNoAcpi' variable
   setvar ForceNoAcpi -guid
 "50BEA1E5-A2C5-46E9-9B3A-59596516B00A"
 -nv -bs

Value 00 indicates ACPI boot
Value 01 indicates DT boot

2. Set the boot mode to ACPI
   setvar ForceNoAcpi -guid
 "50BEA1E5-A2C5-46E9-9B3A-59596516B00A"
 -nv -bs =0x00

3. Set the boot mode to DT
   setvar ForceNoAcpi -guid
 "50BEA1E5-A2C5-46E9-9B3A-59596516B00A"
 -nv -bs =0x01

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Gerd Hoffmann 
Signed-off-by: Sami Mujawar 
---
The changes can be seen at:
https://github.com/samimujawar/edk2/tree/2954_kvmtool_fix_acpi_dt_selection_v1

 ArmVirtPkg/ArmVirtKvmTool.dsc| 14 ++
 ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf |  2 +-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
index 
20da3319667900e64755272fa110d57452d1fc67..c3c27b2765b34599c7312026ce5cb9474a22c684
 100644
--- a/ArmVirtPkg/ArmVirtKvmTool.dsc
+++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
@@ -189,6 +189,20 @@ [PcdsPatchableInModule.common]
 [PcdsDynamicHii]
   
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|5
 
+  #
+  #  Dynamic Hii PCD to select ACPI/DT boot.
+  #
+  #   1. Check the status of the 'ForceNoAcpi' variable
+  #  setvar ForceNoAcpi -guid "50BEA1E5-A2C5-46E9-9B3A-59596516B00A" -nv 
-bs
+  #Value 00 indicates ACPI boot
+  #Value 01 indicates DT boot
+  #   2. Set the boot mode to ACPI
+  #  setvar ForceNoAcpi -guid "50BEA1E5-A2C5-46E9-9B3A-59596516B00A" -nv 
-bs =0x00
+  #   3. Set the boot mode to DT
+  #  setvar ForceNoAcpi -guid "50BEA1E5-A2C5-46E9-9B3A-59596516B00A" -nv 
-bs =0x01
+  #
+  
gUefiOvmfPkgTokenSpaceGuid.PcdForceNoAcpi|L"ForceNoAcpi"|gOvmfVariableGuid|0x0|FALSE|NV,BS
+
 [PcdsDynamicDefault.common]
   gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum|0x0
   gArmTokenSpaceGuid.PcdArmArchTimerIntrNum|0x0
diff --git a/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf 
b/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
index 
b0583d52058805aaeece31d7e3776ac498f101ad..508bfa60c2c2cb3f3e7456b010f4e9057437cda8
 100644
--- a/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
+++ b/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
@@ -42,4 +42,4 @@ [Pcd]
   gUefiOvmfPkgTokenSpaceGuid.PcdForceNoAcpi
 
 [Depex]
-  TRUE
+  gEfiVariableArchProtocolGuid
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




Re: [edk2-devel] [PATCH V1] MdePkg: Update GetImage , GetImageInfo description details

2024-03-26 Thread Pethaiyan, Madhan
Hi All ,

Remider , request to review and provide feedback ,

Thanks,
P. Madhan

-Original Message-
From: Pethaiyan, Madhan 
Sent: Thursday, March 14, 2024 1:47 PM
To: Kinney, Michael D ; devel@edk2.groups.io
Cc: Liming Gao ; Liu, Zhiguang 
; Li, Yi1 ; GuoX Xu 

Subject: RE: [edk2-devel] [PATCH V1] MdePkg: Update GetImage , GetImageInfo 
description details

Hi Mike ,

I had raised new code review addressing the coding standard errors and those 
were not part of my change any way .. 

Thanks,
P. Madhan

-Original Message-
From: Kinney, Michael D 
Sent: Sunday, March 10, 2024 1:47 AM
To: devel@edk2.groups.io; Pethaiyan, Madhan 
Cc: Liming Gao ; Liu, Zhiguang 
; Li, Yi1 ; GuoX Xu 
; Kinney, Michael D 
Subject: RE: [edk2-devel] [PATCH V1] MdePkg: Update GetImage , GetImageInfo 
description details

Hi Madhan,

I created a PR with all 3 related patches to run through EDK II CI.

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

There are CI failures.  Please resolve and send updated patches.

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of 
> Pethaiyan Madhan
> Sent: Friday, March 8, 2024 3:17 PM
> To: devel@edk2.groups.io
> Cc: Pethaiyan, Madhan ; Kinney, Michael D 
> ; Liming Gao ; 
> Liu, Zhiguang ; Li, Yi1 ; 
> GuoX Xu 
> Subject: [edk2-devel] [PATCH V1] 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
>  REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4660
> 
> 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] Im

Re: [edk2-devel] [RFC PATCH] OvmfPkg/SecurityPkg: Add build option for coexistance of vTPM and RTMR.

2024-03-26 Thread Mikko Ylinen
On Fri, Mar 22, 2024 at 07:56:53AM -0700, Dionna Amalie Glaze wrote:
> On Fri, Mar 22, 2024 at 1:52 AM Gerd Hoffmann  wrote:
> >
> > On Fri, Mar 22, 2024 at 02:39:20AM +, Yao, Jiewen wrote:
> > > Please aware that this option will cause potential security risk.
> > >
> > > In case that any the guest component only knows one of vTPM or RTMR,
> > > and only extends one of vTPM or RTMR, but the other one only verifies
> > > the other, then the chain of trust is broken.  This solution is secure
> > > if and only if all guest components aware of coexistence, and can
> > > ensure all measurements are extended to both vTPM and RTMR.  But I am
> > > not sure if all guest components are ready today.
> >
> > As far I know (it's been a while I looked at those patches) shim.efi and
> > grub.efi have support for EFI_CC_MEASUREMENT_PROTOCOL, but use the same
> > logic we have in DxeTpm2MeasureBootLib, i.e. they will not measure to
> > both RTMR and vTPM.
> 
> Shim will measure into CC and then continue to measure into TPM
> https://github.com/rhboot/shim/blob/126a07ebc30bbd203b6966465b058da741b2654b/tpm.c#L164
> 
> GRUB2 has the same behavior. We can at least get coexistence
> supporting the current boot integrity strategy that Confidential Space
> is using, which is to depend on a dmverity initramfs whose root hash
> is in the kernel_cmdline, and a Linux kernel built with LOADPIN. The
> changes to Linux are proposed but not accepted precisely due to this
> conversation we're having now.
> I recall describing this to another CSP engineer at an IETF meeting
> and they claimed they used the same approach, but I can't remember if
> that was Oracle or another company.
> 
> >
> > Looking at systemd-boot I see it will likewise not measure to both RTMR
> > and vTPM, but with reversed priority (use vTPM not RTMR in case both are
> > present).
> >
> 
> Interesting. Thanks for this report. We'll push for the changed
> semantics here if the spec is indeed changed, and request partner
> distros in the CCC to include the updated systemd-boot.

FWIW, my RTMRs patch to systemd was merged quite recently so it's not
included in any systemd release yet. (It was mainly implemented for the
UKI case that allows TDVF to boot a UKI image directly and then have the
image sections measured separately.)

> I think that since the current boot integrity story stops at PCR9, we
> have time to update this component before the attestation method
> evolves to support a less special-purpose system composition.
> 
> > Linux kernel appears to not have EFI_CC_MEASUREMENT_PROTOCOL support.
> >

Since 6.9-rc1 we have it: ac93cbfc

> > > Since this option caused a potential risk / misuse breaking the chain
> > > of trust, I recommend we have at least one more company to endorse the
> > > runtime co-existence of vTPM and RTMR.  Also, I would like to hear the
> > > opinions from other companies.
> >
> > Rumors say intel is working on coconut-svsm support for tdx.  That will
> > most likely allow to use a vTPM with tdx even without depending on the
> > virtualization host or cloud hyperscaler providing one.  We will see VMs
> > with both RTMR and vTPM and surely need a strategy how guests should
> > deal with that situation, consistent across the whole boot stack and
> > not every component doing something different.
> >
> 
> An ephemeral TPM that Coconut-svsm offers is qualitatively different
> than the persistent TPMs in CSPs today. Users of Confidential VMs all
> have different threat models that allow for trusting a CSP-managed
> vTPM for sealing keys but not for trusting unencrypted data in use.
> The boot stack attestation story will not be fully resolved for a long
> while, and a smooth transition is better than a jarring one.
> 
> > Given that the vTPM might be provided by the hypervisor and thus not be
> > part of the TCB I can see that guests might want use both vTPM and RTMR.
> > So, yes, for that case coexistance makes sense.  I'm not convinced it is
> > a good idea to make that a compile time option though.  That will not
> > help to promote a consistent story ...
> >
> 
> I agree, but it does mean we have to change the event log composition
> to describe the configured measurement services like described above.
> I think a static Pcd is okay to begin with. The idea for tracking
> these qualities is through software supply chain endorsements.
> Eventually that would look like the proposed in-toto's SCAI [1] but
> until then we'd have a bespoke format that we document and integrate
> with in an attestation verification service.
> 
> [1] https://arxiv.org/pdf/2210.05813.pdf

-- Regards, Mikko


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



[edk2-devel] compile with Visual Studio 2022 Community edition

2024-03-26 Thread andreas.macher
Hello Mr. Tianocore,

 

I am registered under schwertas at github, but did not want to register in
your bug tracker tool.

 

I have a feature request:

 

The Edk2 tool cannot be compiled by Vs2022 Community edition, because some
compiler Warnings have turned to errors by Microsoft. This affects merely
pointer arithmetics, which are used by your kit. You should not mix up 64
bit pointers with short pointers at all. So you need to reprogram some
modules I think .

 

With kindly regards

 

SchwertAs

DE 91058 Erlangen

 



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




[edk2-devel] [RFC PATCH] OvmfPkg/SecurityPkg: Add build option for coexistance of vTPM and RTMR.

2024-03-26 Thread qinkun Bao via groups.io
From: Qinkun Bao 

The UEFI v2.10 spec defines the protocol EFI_CC_MEASUREMENT_PROTOCOL
to enable (for example) RTMR-based boot measurement for TDX VMs.
With the current UEFI spec’s “should not” wording and EDK2
implementation, TPM measurement in TDVF is disabled when
RTMR measurement is enabled.

Mutual exclusion of the CC measurement protocol and TCG measurement
protocol breaks backwards compatibility, which makes adoption of RTMRs
challenging. A virtualized TPM device (vTPM) managed by the host VMM
makes boot measurements visible to the VMM operator, but this is an
oft-requested feature that users can choose to accept.

The TPM has been a standard for over a decade and many existing
applications rely on the TPM. Both inside and outside Google,
we have many users that require vTPM, including features that are
not easily available via RTMRs (e.g. sealing using keys that the
guest OS cannot access).

This patch adds a non-default build option to allow the coexistence
of both the CC measurement and TCG protocols. Not included is a
vendor-specific measured event in the CC event log that indicates
whether a vTPM is attached or not.

Cc: Erdem Aktas 
Cc: James Bottomley 
Cc: Jiewen Yao 
Cc: Gerd Hoffmann 
Cc: Tom Lendacky 
Cc: Michael Roth 
Signed-off-by: Qinkun Bao 
---
 OvmfPkg/OvmfPkgX64.dsc   |  9 -
 .../DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c| 12 +++-
 .../DxeTpmMeasurementLib/DxeTpmMeasurementLib.c  |  6 ++
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 56c920168d..9bcee45047 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -32,7 +32,8 @@
   DEFINE SECURE_BOOT_ENABLE  = FALSE
   DEFINE SMM_REQUIRE = FALSE
   DEFINE SOURCE_DEBUG_ENABLE = FALSE
-  DEFINE CC_MEASUREMENT_ENABLE   = FALSE
+  DEFINE CC_MEASUREMENT_ENABLE   = TRUE
+  DEFINE CC_MEASUREMENT_AND_TCG2_COEXIST  = FASLE
 
 !include OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc
 
@@ -99,6 +100,11 @@
   INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable
 !endif
   RELEASE_*_*_GENFW_FLAGS = --zero
+!if $(CC_MEASUREMENT_ENABLE) == TRUE && $(CC_MEASUREMENT_AND_TCG2_COEXIST) == 
TRUE
+  MSFT:*_*_*_CC_FLAGS = /D CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
+  INTEL:*_*_*_CC_FLAGS = /D CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
+  GCC:*_*_*_CC_FLAGS = -D CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
+!endif
 
   #
   # Disable deprecated APIs.
@@ -1045,6 +1051,7 @@
   }
 !endif
 
+
   #
   # TPM support
   #
diff --git a/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c 
b/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
index 73719f3b96..4c9bc8ab4a 100644
--- a/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
+++ b/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
@@ -325,7 +325,12 @@ Tcg2MeasureGptTable (
 }
 
 DEBUG ((DEBUG_INFO, "DxeTpm2MeasureBootHandler - Cc MeasureGptTable - 
%r\n", Status));
+#ifdef CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
+  }
+  if (Tcg2Protocol != NULL) {
+#else
   } else if (Tcg2Protocol != NULL) {
+#endif
 //
 // If Tcg2Protocol is installed, then Measure GPT data with this protocol.
 //
@@ -493,7 +498,12 @@ Tcg2MeasurePeImage (
CcEvent
);
 DEBUG ((DEBUG_INFO, "DxeTpm2MeasureBootHandler - Cc MeasurePeImage - 
%r\n", Status));
-  } else if (Tcg2Protocol != NULL) {
+#ifdef CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
+   }
+   if (Tcg2Protocol != NULL) {
+#else
+   } else if (Tcg2Protocol != NULL) {
+#endif
 Status = Tcg2Protocol->HashLogExtendEvent (
  Tcg2Protocol,
  PE_COFF_IMAGE,
diff --git a/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.c 
b/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.c
index 6f287b31fc..b1c6198b4b 100644
--- a/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.c
+++ b/SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.c
@@ -261,7 +261,11 @@ TpmMeasureAndLogData (
HashData,
HashDataLen
);
+#ifdef CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
+  }
+#else
   } else {
+#endif
 //
 // Try to measure using Tpm20 protocol
 //
@@ -287,7 +291,9 @@ TpmMeasureAndLogData (
  HashDataLen
  );
 }
+#ifndef CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
   }
+#endif
 
   return Status;
 }
-- 
2.44.0.291.gc1ea87d7ee-goog



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




[edk2-devel] UART Driver for STM32MP25 with EDK2

2024-03-26 Thread Ba Gia Bao Phan
I want to write a driver UART for my platform in EDK2-platform. I made a
change at
https://github.com/tianocore/edk2/blob/master/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c
with
the address of my platform and used
https://github.com/tianocore/edk2/blob/master/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
to
display the content of boot process at my computer host (using minicom) and
I succeeded but when I compile my driver and use it with PrePeiCore.c, it
did not work.

I think that my driver does not link to library of EDK2. So how can I make
my driver UART link to library of EDK2?

-- 
PHAN Ba Gia Bao
Etudiant en 5A STI - INSA Centre Val de Loire


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




Re: [edk2-devel] [RFC PATCH] OvmfPkg/SecurityPkg: Add build option for coexistance of vTPM and RTMR.

2024-03-26 Thread qinkun Bao via groups.io
On Fri, Mar 22, 2024 at 7:57 AM Dionna Amalie Glaze
 wrote:
>
> On Fri, Mar 22, 2024 at 1:52 AM Gerd Hoffmann  wrote:
> >
> > On Fri, Mar 22, 2024 at 02:39:20AM +, Yao, Jiewen wrote:
> > > Please aware that this option will cause potential security risk.
> > >
> > > In case that any the guest component only knows one of vTPM or RTMR,
> > > and only extends one of vTPM or RTMR, but the other one only verifies
> > > the other, then the chain of trust is broken.  This solution is secure
> > > if and only if all guest components aware of coexistence, and can
> > > ensure all measurements are extended to both vTPM and RTMR.  But I am
> > > not sure if all guest components are ready today.
> >

Thank you for the feedback. I believe it is the existing status even
without the patch.
Both EFI_CC_MEASUREMENT_PROTOCOL and EFI_TCG2_PROTOCOL
are exposed by TDVF when CC_MEASUREMENT_ENABLE is set to true even
without the patch. TDVF only measures with EFI_CC_MEASUREMENT_PROTOCOL
protocol. However, since both protocols exist, Shim and Grub2 measure
into both CCand TPM. In the guest, the user can access both the event log for
TPM andvRTMR. Some of the event logs for TPM are missing without the patch.
As Dionna mentioned (CVE-2021-42299), measuring into every device that
is available seems to be a safer choice.  It's a mistake we've
concretely made in the past.

I am thinking your biggest concern is OS. Fortunately, there is no
accepted patch in the kernel that appears to have
EFI_CC_MEASUREMENT_PROTOCOL support. Once this
patch is accepted, we will work with the kernel community to recommend
the following code pattern "for device in measurement_devices:
device.Extend(bla)" for all guest components.





> > As far I know (it's been a while I looked at those patches) shim.efi and
> > grub.efi have support for EFI_CC_MEASUREMENT_PROTOCOL, but use the same
> > logic we have in DxeTpm2MeasureBootLib, i.e. they will not measure to
> > both RTMR and vTPM.
>
> Shim will measure into CC and then continue to measure into TPM
> https://github.com/rhboot/shim/blob/126a07ebc30bbd203b6966465b058da741b2654b/tpm.c#L164
>
> GRUB2 has the same behavior. We can at least get coexistence
> supporting the current boot integrity strategy that Confidential Space
> is using, which is to depend on a dmverity initramfs whose root hash
> is in the kernel_cmdline, and a Linux kernel built with LOADPIN. The
> changes to Linux are proposed but not accepted precisely due to this
> conversation we're having now.
> I recall describing this to another CSP engineer at an IETF meeting
> and they claimed they used the same approach, but I can't remember if
> that was Oracle or another company.
>


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




Re: [edk2-devel] [PATCH V1 1/1] OvmfPkg/QemuBootOrderLib: Measure the etc/boot-menu-wait

2024-03-26 Thread Gerd Hoffmann
On Tue, Mar 26, 2024 at 09:08:59AM +, Sun, CepingX wrote:
> On Friday, March 22, 2024 5:06 PM Gerd Hoffmann wrote:
> > 
> > No, we only need to update QemuFwCfgSelectItem + QemuFwCfgReadBytes to
> > support reading from the cache.
> Do you mean the existing API (QemuFwCfgSelectItem + QemuFwCfgReadBytes) need 
> to be changed to support reading from the cache?
> 
> If that is the case,  there are some concerns as below:
> 1:  One or more new parameters (of QemuFwCfgReadBytes())  need to be added to 
> search 
> the item in cache, which is equivalent to adding a new API.

No.

Yes, you need to maintain some extra state, so you know which item was
selected most recently and how many bytes have been read already.

It's not needed to task the caller with that though.  Alternatively you
can add fields to EFI_HOB_PLATFORM_INFO, or create a new HOB for that,
and store the state there.  That way QemuFwCfgReadBytes works properly
with the cache without the caller passing in the state.

take care,
  Gerd



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




[edk2-devel] [PATCH V2 5/6] EmulatorPkg/Redfish: Use edk2 Redfish debug PCDs

2024-03-26 Thread Chang, Abner via groups.io
From: Abner Chang 

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
---
 EmulatorPkg/EmulatorPkg.dsc | 21 +
 1 file changed, 21 insertions(+)

diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index 85134b07816..5fa1ed345a3 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -278,6 +278,27 @@
   
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceDevicePath.DevicePath|{DEVICE_PATH("MAC(,0x1)")}
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceAccessModeInBand|False
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDiscoverAccessModeInBand|False
+
+  gEmulatorPkgTokenSpaceGuid.PcdRedfishServiceStopIfSecureBootDisabled|False
+  gEmulatorPkgTokenSpaceGuid.PcdRedfishServiceStopIfExitbootService|False
+
+  gEfiRedfishClientPkgTokenSpaceGuid.PcdRedfishServiceEtagSupported|False
+
+  #
+  # Redfish Debug enablement
+  #
+  # 0x0001  RedfishPlatformConfigDxe driver debug enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0
+  #   0x0001  x-uefi-redfish string database message enabled
+  #   0x0002  Debug Message for dumping formset
+  #   0x0004  Debug Message for x-uefi-redfish searching result
+  #   0x0008  Debug Message for x-uefi-redfish Regular Expression 
searching result
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty|0
+
+  # Redfish Platform Configure DXE driver feature enablement
+  #   0x0001  Enable building Redfish Attribute Registry menu path.
+  #   0x0002  Allow supressed HII option to be exposed on Redfish.
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigFeatureProperty|0
 !endif
 
 [PcdsDynamicDefault.common.DEFAULT]
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH V2 6/6] RedfishPkg/RedfishPlatformConfigDxe: support menu path report

2024-03-26 Thread Chang, Abner via groups.io
From: Nickle Wang 

"MenuPath" is the attribute in BIOS attribute registry. To support
reporting this attribute, we need to include the formset without
x-uefi-redfish support in database. So driver can find menu path to
target attribute in BIOS menu.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Signed-off-by: Abner Chang 
---
 .../RedfishPlatformConfigDxe.h|  8 +--
 .../RedfishPlatformConfigDxe.c|  8 +--
 .../RedfishPlatformConfigImpl.c   | 51 +++
 3 files changed, 49 insertions(+), 18 deletions(-)

diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
index 688f2067bff..8eb7b0dc2aa 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
@@ -2,7 +2,7 @@
   This file defines the EDKII Redfish Platform Config Protocol interface.
 
   (C) Copyright 2021 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
   Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -49,8 +49,8 @@
 // 2  RedfishPlatformConfigDxe debug enablement must be set in
 //PcdRedfishDebugCategory (defined in RedfishPkg.dec)
 //
-// 3. The suborinate debug enablement for RedfishPlatformConfigDxe
-//must be set in PcdRedfishPlatformConfigDebugPropert (defined
+// 3. The subordinate debug enablement for RedfishPlatformConfigDxe
+//must be set in PcdRedfishPlatformConfigDebugProperty (defined
 //in RedfishPkg.dec).
 //
 #define DEBUG_REDFISH_THIS_MODULE(DebugSubordinate, ...) \
@@ -116,7 +116,7 @@ typedef struct {
 
 #define REDFISH_MENU_PATH_SIZE  8
 
-// Definitions of Redfish platform config capbility
+// Definitions of Redfish platform config capability
 #define REDFISH_PLATFORM_CONFIG_BUILD_MENU_PATH   0x1
 #define REDFISH_PLATFORM_CONFIG_ALLOW_SUPPRESSED  0x2
 
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
index d165799f9a1..7821146e901 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
@@ -2016,7 +2016,7 @@ RedfishPlatformConfigProtocolGetConfigureLang (
   UINTN   Index;
   CHAR8   *FullSchema;
 
-  DEBUG ((DEBUG_INFO, "%a: Harvest config language of %a_%a (Regex: %s).\n", 
__func__, Schema, Version, RegexPattern));
+  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Harvest config language of %a_%a 
(Regex: %s).\n", __func__, Schema, Version, RegexPattern));
 
   if ((This == NULL) || IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) 
|| (Count == NULL) || (ConfigureLangList == NULL) || IS_EMPTY_STRING 
(RegexPattern)) {
 return EFI_INVALID_PARAMETER;
@@ -2103,7 +2103,7 @@ RELEASE_RESOURCE:
 ReleaseStatementList (&StatementList);
   }
 
-  DEBUG ((DEBUG_INFO, "%a: exit.\n", __func__));
+  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: exit.\n", __func__));
   return Status;
 }
 
@@ -2318,7 +2318,7 @@ RedfishPlatformConfigProtocolGetAttribute (
   CHAR8  *FullSchema;
   CHAR8  *Buffer;
 
-  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
+  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Entry\n", __func__));
   if ((This == NULL) || IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) 
|| IS_EMPTY_STRING (ConfigureLang) || (AttributeValue == NULL)) {
 return EFI_INVALID_PARAMETER;
   }
@@ -2395,7 +2395,7 @@ RELEASE_RESOURCE:
 FreePool (FullSchema);
   }
 
-  DEBUG ((DEBUG_INFO, "%a: Exit\n", __func__));
+  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Exit\n", __func__));
   return Status;
 }
 
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c
index 537ce09a2d3..86f3aa529c5 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c
@@ -2,7 +2,7 @@
   The implementation of EDKII Redfish Platform Config Protocol.
 
   (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
   Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -656,8 +656,10 @@ GetStatementPrivateByConfigureLangRegex (
   ++StatementList->Count;
 }
   } else {
-

[edk2-devel] [PATCH V2 4/6] RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted unexpectedly

2024-03-26 Thread Chang, Abner via groups.io
From: Abner Chang 

Add the condition check when delete HII string.
Only when the HiiStatement operand equal to "EFI_IFR_STRING_OP"
and the statement value type = EFI_IFR_TYPE_STRING.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c| 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
index 8a02c839035..d165799f9a1 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
@@ -1873,8 +1873,11 @@ RedfishPlatformConfigSetStatementCommon (
 DEBUG ((DEBUG_ERROR, "%a: failed to save question value: %r\n", __func__, 
Status));
   }
 
-  if (StatementValue->Value.string != 0) {
-HiiDeleteString (StatementValue->Value.string, 
TargetStatement->ParentForm->ParentFormset->HiiHandle);
+  if ((TargetStatement->HiiStatement->Operand == EFI_IFR_STRING_OP) && 
(StatementValue->Type == EFI_IFR_TYPE_STRING)) {
+if (StatementValue->Value.string != 0) {
+  // Delete HII string which was created for HII statement operand = 
EFI_IFR_STRING_OP and Type = EFI_IFR_TYPE_STRING.
+  HiiDeleteString (StatementValue->Value.string, 
TargetStatement->ParentForm->ParentFormset->HiiHandle);
+}
   }
 
   return Status;
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH V2 3/6] RedfishPkg/RedfishPlatformConfigDxe:Add RefishDebugLib support

2024-03-26 Thread Chang, Abner via groups.io
From: Abner Chang 

Add RedfishPlatformConfigDxe debug capability that aligns
with edk2 Redfish debug mechanism.

- PcdRedfishPlatformConfigDebugProperty, add PCD to control
  RedfishPlatformConfigDxe subordinate of Redfish debug
  capabilities.
- PcdRedfishPlatformConfigFeatureProperty, add PCD to
  manage RedfishPlatformConfigDxe features.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dec |  15 +++
 .../RedfishPlatformConfigDxe.inf  |   8 ++
 .../RedfishPlatformConfigDxe.h|  46 +++-
 .../RedfishPlatformConfigImpl.h   |  28 +
 .../RedfishPlatformConfigCapability.c |  58 ++
 .../RedfishPlatformConfigDxe.c|  59 +++---
 .../RedfishPlatformConfigImpl.c   | 107 +++---
 7 files changed, 262 insertions(+), 59 deletions(-)
 create mode 100644 
RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigCapability.c

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index a9665ff68ef..c048e43f53b 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -193,3 +193,18 @@
   #   0x0001  RedfishPlatformConfigDxe driver debug enabled.
   #
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0|UINT64|0x1012
+  #
+  # Redfish RedfishPlatformConfigDxe Debug Properties
+  #   0x0001  x-uefi-redfish string database message enabled
+  #   0x0002  Debug Message for dumping formset
+  #   0x0004  Debug Message for x-uefi-redfish searching result
+  #   0x0008  Debug Message for x-uefi-redfish Regular Expression 
searching result
+  #
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty|0|UINT32|0x1013
+  #
+  # RedfishPlatformConfigDxe feature enablement
+  #   0x0001  Enable building Redfish Attribute Registry menu path.
+  #   0x0002  Allow supressed HII option to be exposed on Redfish.
+  #
+  # Redfish RedfishPlatformConfigDxe feature Properties
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigFeatureProperty|0|UINT32|0x1014
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
index 5a249c8c3bc..2db47c2cffc 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
@@ -3,6 +3,7 @@
 #
 #  (C) Copyright 2021 Hewlett Packard Enterprise Development LP
 #  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -23,6 +24,7 @@
   RedfishPkg/RedfishPkg.dec
 
 [Sources]
+  RedfishPlatformConfigCapability.c
   RedfishPlatformConfigDxe.h
   RedfishPlatformConfigDxe.c
   RedfishPlatformConfigImpl.h
@@ -36,7 +38,9 @@
   HiiLib
   HiiUtilityLib
   MemoryAllocationLib
+  PcdLib
   PrintLib
+  RedfishDebugLib
   UefiLib
   UefiBootServicesTableLib
   UefiRuntimeServicesTableLib
@@ -51,5 +55,9 @@
 [Guids]
   gEfiRegexSyntaxTypePerlGuid ## CONSUMED
 
+[FixedPcd]
+ gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigFeatureProperty
+ gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty
+
 [Depex]
   TRUE
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
index 38adea04c5b..688f2067bff 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
@@ -3,6 +3,7 @@
 
   (C) Copyright 2021 Hewlett Packard Enterprise Development LP
   Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -20,7 +21,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -37,6 +40,41 @@
 //
 #include 
 
+//
+// Debug message in DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE scope.
+// To enable the debug message for this module, below PCDs must be set.
+//
+// 1. DEBUG_MANAGEABILITY must be set PcdDebugPrintErrorLevel.
+//
+// 2  RedfishPlatformConfigDxe debug enablement must be set in
+//PcdRedfishDebugCategory (defined in RedfishPkg.dec)
+//
+// 3. The suborinate debug enablement for RedfishPlatformConfigDxe
+//must be set in PcdRedfishPlatformConfigDebugPropert (defined
+//in RedfishPkg.dec).
+//
+#define DEBUG_REDFISH_THIS_MODULE(DebugSubordinate, ...) \
+  while (RedfishPlatformConfigDebugProp (DebugSubordinate)) { \
+DEBUG_REDFISH(DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE, ##__VA_ARGS__); 
\
+break; \
+  }
+
+#define DEBUG_REDFISH_THIS_MODULE_CODE_BEGIN(DebugSubordinate) \
+  if (RedfishPlatformConfigDebugProp (DebugSubordin

[edk2-devel] [PATCH V2 2/6] RedfishPkg/RedfishDebugLib: Introduce Redfish DEBUG macro

2024-03-26 Thread Chang, Abner via groups.io
From: Abner Chang 

Introduce DEBUG_REDFISH macro for the debug message
of edk2 Redfish components.
DEBUG_REDFISH can be used in any edk2 Redfish component
with Redfish DebugCatagory as the first parameter.
Whether the debug message is output or not depends on
the platform setting of PcdRedfishDebugCatagory.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dec |  9 +++
 .../RedfishDebugLib/RedfishDebugLib.inf   |  4 ++
 RedfishPkg/Include/Library/RedfishDebugLib.h  | 43 +++
 .../Library/RedfishDebugLib/RedfishDebugLib.c | 55 ---
 4 files changed, 57 insertions(+), 54 deletions(-)

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 1a9c9ed7bc5..a9665ff68ef 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -5,6 +5,7 @@
 # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
 # Copyright (c) 2023, American Megatrends International LLC.
 # Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
@@ -184,3 +185,11 @@
   gEfiRedfishPkgTokenSpaceGuid.PcdHttpRetryWaitInSecond|1|UINT16|0x1010
   ## This is used to disable Redfish HTTP cache function and every request 
will be sent to Redfish service.
   gEfiRedfishPkgTokenSpaceGuid.PcdHttpCacheDisabled|FALSE|BOOLEAN|0x1011
+  #
+  # Redfish debug catagories
+  # To enable the debug message for the entire edk2 Redfish implementation, 
below PCDs must be set.
+  # DEBUG_MANAGEABILITY must be set PcdDebugPrintErrorLevel.
+  #
+  #   0x0001  RedfishPlatformConfigDxe driver debug enabled.
+  #
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0|UINT64|0x1012
diff --git a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf 
b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
index d468bb213b6..42ff321b48e 100644
--- a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
+++ b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
@@ -2,6 +2,7 @@
 #  INF file for Redfish debug library.
 #
 #  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -35,5 +36,8 @@
   RedfishHttpLib
   UefiLib
 
+[FixedPcd]
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory
+
 [Depex]
   TRUE
diff --git a/RedfishPkg/Include/Library/RedfishDebugLib.h 
b/RedfishPkg/Include/Library/RedfishDebugLib.h
index ad7a6975867..19e5a895cc8 100644
--- a/RedfishPkg/Include/Library/RedfishDebugLib.h
+++ b/RedfishPkg/Include/Library/RedfishDebugLib.h
@@ -2,6 +2,7 @@
   This file defines the Redfish debug library interface.
 
   Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -11,28 +12,48 @@
 #define REDFISH_DEBUG_LIB_H_
 
 #include 
+#include 
 #include 
 #include 
 #include 
 
 #include 
 
-#define DEBUG_REDFISH_NETWORK DEBUG_MANAGEABILITY   ///< Debug error 
level for Redfish networking function
-#define DEBUG_REDFISH_HOST_INTERFACE  DEBUG_MANAGEABILITY   ///< Debug error 
level for Redfish networking function
+// Used with MdePKg DEBUG macro.
+#define DEBUG_REDFISH_NETWORK  DEBUG_MANAGEABILITY  ///< Debug 
error level for Redfish networking function
+#define DEBUG_REDFISH_HOST_INTERFACE   DEBUG_MANAGEABILITY  ///< Debug 
error level for Redfish Host INterface
+#define DEBUG_REDFISH_PLATFORM_CONFIG  DEBUG_MANAGEABILITY  ///< Debug 
error level for Redfish Platform Configure Driver
+
+//
+// Definitions of Redfish debug capability in Redfish component scope, used 
with DEBUG_REDFISH macro
+// For example, Redfish Platform Config Driver
+//   DEBUG_REDFISH(DEBUG_REDFISH_PLATFORM_CONFIG_DXE, ...)
+//
+#define DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE  0x0001
+
+#define DEBUG_REDFISH(DebugCategory, ...) \
+do {\
+  if (!DebugPrintEnabled()) {   \
+break;  \
+  } \
+  if (!DebugRedfishComponentEnabled (DebugCategory)) { \
+break; \
+  }\
+  DEBUG ((DEBUG_MANAGEABILITY, ##__VA_ARGS__));   \
+} while (FALSE)
 
 /**
-  Debug print the value of StatementValue.
+  Determine whether the Redfish debug category is enabled in
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory.
 
-  @param[in]  ErrorLevel DEBUG macro error level.
-  @param[in]  StatementValue The statement value to print.
+  @param[in]  DebugCategory  Redfi

[edk2-devel] [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config language searching optimization

2024-03-26 Thread Chang, Abner via groups.io
From: abnchang 

Build up the x-uefi-redfish string database for the Redfish confg
language searching, instead of using HII String protocol.
This can improve the time consumption lot on searching strings.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../RedfishPlatformConfigImpl.h   | 107 ++-
 .../RedfishPlatformConfigDxe.c|  23 +-
 .../RedfishPlatformConfigImpl.c   | 820 +-
 3 files changed, 878 insertions(+), 72 deletions(-)

diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
index 9f4312decf5..6e6c7fdb8a9 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
@@ -2,7 +2,8 @@
   This file defines the EDKII Redfish Platform Config Protocol private 
structure.
 
   (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -30,6 +31,10 @@
 #define ENGLISH_LANGUAGE_CODE  "en-US"
 #define X_UEFI_SCHEMA_PREFIX   "x-uefi-redfish-"
 
+#define MAX_X_UEFI_REDFISH_STRING_SIZE  (128 * 2)// 128 character in UCS.
+
+typedef struct _REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE 
REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE;
+
 //
 // Definition of REDFISH_PLATFORM_CONFIG_PRIVATE.
 //
@@ -46,17 +51,49 @@ typedef struct {
   CHAR8**SchemaList;// Schema list
 } REDFISH_PLATFORM_CONFIG_SCHEMA;
 
+// Defines the number of elements in array
+#define X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER  1024
+
+//
+// Definition of x-uefi-redfish string element.
+//
+typedef struct {
+  EFI_STRING_IDStringId;
+  CHAR16   *UcsString;
+} REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT;
+
+//
+// Discrete string array buffer, each has X_UEFI_REDFISH_STRING_ARRAY_NUMBER 
element.
+//
+typedef struct {
+  LIST_ENTRY  NextArray;
+  REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT*ArrayEntryAddress;
+} REDFISH_X_UEFI_STRINGS_ARRAY;
+
+//
+// x-uefi-redfish string database, x-uefi-redfish language based.
+//
+typedef struct {
+  LIST_ENTRYNextXuefiRedfishLanguage; 
// Link to the next suppoted x-uefi-Redfish language.
+  CHAR8 *XuefiRedfishLanguage;
// x-uefi-redfish language.
+  UINTN StringsArrayBlocks;   
// Number of the array blocks that accommodate 
X_UEFI_REDFISH_STRING_ARRAY_NUMBER
+  
// elements in each.
+  LIST_ENTRYXuefiRedfishStringArrays; 
// Link entry of x-uefi-redfish string array.
+} REDFISH_X_UEFI_STRING_DATABASE;
+
 //
 // Definition of REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE
 //
 typedef struct {
   LIST_ENTRYLink;
-  HII_FORMSET   *HiiFormSet; // Pointer to HII formset 
data.
-  EFI_GUID  Guid;// Formset GUID.
-  EFI_HII_HANDLEHiiHandle;   // Hii Handle of this 
formset.
-  LIST_ENTRYHiiFormList; // Form list that keep 
form data under this formset.
-  CHAR16*DevicePathStr;  // Device path of this 
formset.
-  REDFISH_PLATFORM_CONFIG_SCHEMASupportedSchema; // Schema that is 
supported in this formset.
+  HII_FORMSET   *HiiFormSet;// Pointer to 
HII formset data.
+  EFI_GUID  Guid;   // Formset 
GUID.
+  EFI_HII_HANDLEHiiHandle;  // Hii Handle 
of this formset.
+  EFI_HII_PACKAGE_LIST_HEADER   *HiiPackageListHeader;  // Hii Package 
list header.
+  LIST_ENTRYHiiFormList;// Form list 
that keep form data under this formset.
+  CHAR16*DevicePathStr; // Device path 
of this formset.
+  REDFISH_PLATFORM_CONFIG_SCHEMASupportedSchema;// Schema that 
is supported in this formset.
+  LIST_ENTRYXuefiRedfishStringDatabase; // 
x-uefi-redfish string/Id data base;
 } REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE;
 
 #define REDFISH_PLATFORM_CONFIG_FORMSET_FROM_LINK(a)  BASE_CR (a, 
REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE, Link)
@@ -90,19 +127,19 @@ typedef struct {
 //
 // Definition of REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE
 //
-typedef struct {
+struct _REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE {
   LIST_ENTRYLink;
   REDFISH_PLATFORM_CONFI

[edk2-devel] [PATCH V2 0/6] [PATCH V2 0/5] Config language searching algorithm enhancement and the bug fixes

2024-03-26 Thread Chang, Abner via groups.io
From: Abner Chang 

PR # 5491

In V2, add patch 6/6 contibuted by Nvidia for updating BIOS
menu path implementation based on the performance improvement.

In this patch set,
1 We enhance the config language searching algorithm.
  As the performance of searching config language using HII GetString is
  pretty slow. For the example, 1800 HII BIOS options takes over 30 mins
  to build up the metadata required for Redfish BIOS resource. With this
  improvement, it only takes 4 seconds.

2.Introduce the Redfish debug framework, there are three edk2 Redfish
  debug scopes.
  a. PcdDebugPrintErrorLevel, DEBUG_MANAGEABILITY to enable debug message
 for edk2 Redfish.
  b. PcdRedfishDebugCategory, enablement of individule edk2 Redfish
 component. Currently we only support RedfishPlatformConfigDxe
 module.
  c. PcdRedfishPlatformConfigDebugProperty, edk2 Redfish module debug
 scope. This PCD is used by RedfishPlatformConfigDxe debug enablement.

3 This patch set also fixes an issue that deletes HII string unexpectedly.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 

Abner Chang (4):
  RedfishPkg/RedfishDebugLib: Introduce Redfish DEBUG macro
  RedfishPkg/RedfishPlatformConfigDxe:Add RefishDebugLib support
  RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted
unexpectedly
  EmulatorPkg/Redfish: Use edk2 Redfish debug PCDs

Nickle Wang (1):
  RedfishPkg/RedfishPlatformConfigDxe: support menu path report

abnchang (1):
  RedfishPkg/RedfishPlatformConfigDxe: Config language searching
optimization

 RedfishPkg/RedfishPkg.dec |  24 +
 EmulatorPkg/EmulatorPkg.dsc   |  21 +
 .../RedfishDebugLib/RedfishDebugLib.inf   |   4 +
 .../RedfishPlatformConfigDxe.inf  |   8 +
 RedfishPkg/Include/Library/RedfishDebugLib.h  |  43 +-
 .../RedfishPlatformConfigDxe.h|  48 +-
 .../RedfishPlatformConfigImpl.h   | 135 ++-
 .../Library/RedfishDebugLib/RedfishDebugLib.c |  55 +-
 .../RedfishPlatformConfigCapability.c |  58 ++
 .../RedfishPlatformConfigDxe.c|  89 +-
 .../RedfishPlatformConfigImpl.c   | 928 --
 11 files changed, 1240 insertions(+), 173 deletions(-)
 create mode 100644 
RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigCapability.c

-- 
2.37.1.windows.1



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




Re: [edk2-devel] [PATCH v2 1/1] SbsaQemu: AcpiDxe: Create SRAT table at runtime

2024-03-26 Thread Marcin Juszkiewicz

W dniu 20.02.2024 o 08:47, Xiong Yining pisze:

Add support to create SRAT(System resource affinity table) for
sbsa platform at runtime.

Signed-off-by: Xiong Yining
Signed-off-by: Chen Baozi


Needs rebase on top of "get rid of DeviceTree from SbsaQemu" series.

Rename SbsaQemuHardwareInfoLib to HardwareInfoLib and use newer function 
names.



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




Re: [edk2-devel] [PATCH v3 1/1] SbsaQemu: add memory space for the high memory nodes

2024-03-26 Thread Marcin Juszkiewicz

W dniu 20.02.2024 o 08:33, Xiong Yining pisze:

To support more memory nodes, we refer to the implement of
"OvmfPkg/Fdt/HighMemDxe" to add memory space for the high memory nodes
except the first one.

Signed-off-by: Xiong Yining
Signed-off-by: Chen Baozi


Needs rebase on top of "get rid of DeviceTree from SbsaQemu" series.

Rename SbsaQemuHardwareInfoLib to HardwareInfoLib and use newer function 
names.



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117120): https://edk2.groups.io/g/devel/message/117120
Mute This Topic: https://groups.io/mt/104463710/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][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex()

2024-03-26 Thread Nickle Wang via groups.io
Thanks for your reminder, Abner. I verify this patch series on my system, and I 
don't see any issue.



Hi @Mike Maslenkin, please add Abner and my 
reviewed-by to the commit messages. And we can merge the pull request.



Thanks,

Nickle



> -Original Message-

> From: Chang, Abner 

> Sent: Monday, March 25, 2024 10:13 AM

> To: Mike Maslenkin ; devel@edk2.groups.io

> Cc: Igor Kulchytskyy ; Nickle Wang 

> Subject: RE: [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix

> GetRedpathNodeByIndex()

>

> External email: Use caution opening links or attachments

>

>

> [AMD Official Use Only - General]

>

> For this patch set,  Reviewed-by: Abner Chang 
> mailto:abner.ch...@amd.com>>

>

> Hi Nickle, please also take a look at this change. Thanks Abner

>

> > -Original Message-

> > From: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>

> > Sent: Saturday, March 23, 2024 8:01 PM

> > To: devel@edk2.groups.io

> > Cc: Chang, Abner mailto:abner.ch...@amd.com>>; Igor 
> > Kulchytskyy

> > mailto:ig...@ami.com>>; Nickle Wang 
> > mailto:nick...@nvidia.com>>; Mike Maslenkin

> > mailto:mike.maslen...@gmail.com>>

> > Subject: [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix

> > GetRedpathNodeByIndex()

> >

> > Caution: This message originated from an External Source. Use proper

> > caution when opening attachments, clicking links, or responding.

> >

> >

> > This set contains fixes for proper nodes handling in 
> > GetRedpathNodeByIndex().

> > It fixes handling of nodes with Index different from 0, it removes

> > leading '/' returned for section with Index = 0, also it fixes return

> > of the last section.

>

> This set does not have any impact to

> > existing code,

> > because in all places this function is used to obtain the end of the first 
> > section.

> > And actually returned pointer to the requested section is not used.

> > The current usages is:

> >GetRedpathNodeByIndex (ConfigLangList.List[0].ConfigureLang, 0,

> > &EndOfChar);

> >

> > and return of EndOfChar value is not affected by this set.

> >

> > Cc: Abner Chang mailto:abner.ch...@amd.com>>

> > Cc: Igor Kulchytskyy mailto:ig...@ami.com>>

> > Cc: Nickle Wang mailto:nick...@nvidia.com>>

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

> >




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117118): https://edk2.groups.io/g/devel/message/117118
Mute This Topic: https://groups.io/mt/105101990/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][RFC PATCH 3/3] RedfishClientPkg: fix the first node processing in GetRedpathNodeByIndex()

2024-03-26 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Saturday, March 23, 2024 8:01 PM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin ; Abner Chang
> ; Igor Kulchytskyy ; Nickle Wang
> 
> Subject: [edk2-redfish-client][RFC PATCH 3/3] RedfishClientPkg: fix the first 
> node
> processing in GetRedpathNodeByIndex()
> 
> External email: Use caution opening links or attachments
> 
> 
> For node with index 0, the result of this function contains leading L'/'
> character. But for other nodes no such characters (separators) returned.
> Make processing of all fields consistent.
> 
> After this patch the debug output for specified URI is the following:
> 
>  @Redfish.Settings found:/redfish/v1/Systems/system/Bios/Settings
>  GetNumberOfRedpathNodes:6
>  GetRedpathNodeByIndex[0]:redfish/v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[1]:v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[2]:Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[3]:system/Bios/Settings
>  GetRedpathNodeByIndex[4]:Bios/Settings
>  GetRedpathNodeByIndex[5]:Settings
> 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nickle Wang 
> Signed-off-by: Mike Maslenkin 
> ---
>  .../Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> index b0a3b20a40bd..c55dc2ee6d05 100644
> ---
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> +++
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> @@ -1304,7 +1304,7 @@ GetRedpathNodeByIndex (
>NumberNodes = 0;
> 
>StringLen   = StrLen (NodeString);
> 
>StringIndex = 1; // ConfigLang always starts with '/'.
> 
> -  NodeStart   = NodeString;
> 
> +  NodeStart   = NodeString + StringIndex;
> 
>if (EndOfNodePtr != NULL) {
> 
>  *EndOfNodePtr = NULL;
> 
>}
> 
> --
> 2.32.0 (Apple Git-132)



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




Re: [edk2-devel] [PATCH edk2-platforms v2 1/1] Maintainers.txt: add myself as QemuSbsa maintainer

2024-03-26 Thread Leif Lindholm
On Tue, Mar 26, 2024 at 13:10:58 +0100, Marcin Juszkiewicz wrote:
> With all changes going around sbsa-ref/QemuSbsa platform Leif suggested
> that I should become maintainer as well.
> 
> My GitHub account name is "hrw".
> 
> Signed-off-by: Marcin Juszkiewicz 

Reviewed-by: Leif Lindholm 
Tweaked subject line and pushed as 8e5981584663.

Thanks!

> ---
>  Maintainers.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index e57c32f16a05..ca36aa679470 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -383,8 +383,8 @@ F: Platform/Qemu/SbsaQemu/
>  F: Silicon/Qemu/SbsaQemu/
>  M: Ard Biesheuvel 
>  M: Leif Lindholm 
> +M: Marcin Juszkiewicz  [hrw]
>  R: Graeme Gregory 
> -R: Marcin Juszkiewicz 
>  
>  Raspberry Pi platforms and silicon
>  F: Platform/RaspberryPi/
> -- 
> 2.44.0
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117116): https://edk2.groups.io/g/devel/message/117116
Mute This Topic: https://groups.io/mt/105156582/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][RFC PATCH 2/3] RedfishClientPkg: fix the last field processing in GetRedpathNodeByIndex()

2024-03-26 Thread Nickle Wang via groups.io


Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Saturday, March 23, 2024 8:01 PM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin ; Abner Chang
> ; Igor Kulchytskyy ; Nickle Wang
> 
> Subject: [edk2-redfish-client][RFC PATCH 2/3] RedfishClientPkg: fix the last 
> field
> processing in GetRedpathNodeByIndex()
> 
> External email: Use caution opening links or attachments
> 
> 
> After processing of nodes was fixed it was revealed that this function is not
> handling the last node correctly. The problem is that the end of node 
> detected by
> comparing to L'/', but usually ConfigLang and other properties do not have
> terminating separator (i.e '/'). So, before this patch the situation was as 
> below:
> 
>  @Redfish.Settings found: /redfish/v1/Systems/system/Bios/Settings
>  GetNumberOfRedpathNodes: 6
>  GetRedpathNodeByIndex[0]:/redfish/v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[1]:v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[2]:Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[3]:system/Bios/Settings
>  GetRedpathNodeByIndex[4]:Bios/Settings
>  GetRedpathNodeByIndex[5]:
> 
> And after this patch the debug output is:
> 
>  @Redfish.Settings found: /redfish/v1/Systems/system/Bios/Settings
>  GetNumberOfRedpathNodes: 6
>  GetRedpathNodeByIndex[0]:/redfish/v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[1]:v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[2]:Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[3]:system/Bios/Settings
>  GetRedpathNodeByIndex[4]:Bios/Settings
>  GetRedpathNodeByIndex[5]:Settings
> 
> The section with Index=5 is found and returned correctly.
> 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nickle Wang 
> Signed-off-by: Mike Maslenkin 
> ---
>  .../RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c  | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> index 3231ef883379..b0a3b20a40bd 100644
> ---
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUt
> +++ ilityLib.c
> @@ -1327,6 +1327,11 @@ GetRedpathNodeByIndex (
>  StringIndex++;
> 
>}
> 
> 
> 
> +  if (NumberNodes == Index) {
> 
> +*EndOfNodePtr = NodeString + StringIndex - 1;
> 
> +return NodeStart;
> 
> +  }
> 
> +
> 
>return (NULL);
> 
>  }
> 
> 
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117115): https://edk2.groups.io/g/devel/message/117115
Mute This Topic: https://groups.io/mt/105101992/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][RFC PATCH 1/3] RedfishClientPkg: fix nodes count in GetRedpathNodeByIndex()

2024-03-26 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Saturday, March 23, 2024 8:01 PM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin ; Abner Chang
> ; Igor Kulchytskyy ; Nickle Wang
> 
> Subject: [edk2-redfish-client][RFC PATCH 1/3] RedfishClientPkg: fix nodes 
> count
> in GetRedpathNodeByIndex()
> 
> External email: Use caution opening links or attachments
> 
> 
> This patch fixes work of GetRedpathNodeByIndex() function with non zero Index
> argument. NumberNodes value was not changed after the new node found. This
> means that before this patch modified function worked only in case of Index = 
> 0.
> 
> Debug output for the initial case:
> 
>  @Redfish.Settings found:/redfish/v1/Systems/system/Bios/Settings
>  GetNumberOfRedpathNodes:6
>  GetRedpathNodeByIndex[0]:/redfish/v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[1]:
>  GetRedpathNodeByIndex[2]:
>  GetRedpathNodeByIndex[3]:
>  GetRedpathNodeByIndex[4]:
>  GetRedpathNodeByIndex[5]:
> 
> After this patch the output is as following:
> 
>  @Redfish.Settings found:/redfish/v1/Systems/system/Bios/Settings
>  GetNumberOfRedpathNodes:6
>  GetRedpathNodeByIndex[0]:/redfish/v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[1]:v1/Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[2]:Systems/system/Bios/Settings
>  GetRedpathNodeByIndex[3]:system/Bios/Settings
>  GetRedpathNodeByIndex[4]:Bios/Settings
>  GetRedpathNodeByIndex[5]:
> 
> Note: it is supposed that caller will set terminating '\0' explicitly at the 
> next
> position pointed by returned EndOfNodePtr value.
> 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nickle Wang 
> Signed-off-by: Mike Maslenkin 
> ---
>  .../Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c  | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> index cc2b37b79605..3231ef883379 100644
> ---
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUt
> +++ ilityLib.c
> @@ -1320,6 +1320,7 @@ GetRedpathNodeByIndex (
>  return NodeStart;
> 
>} else {
> 
>  NodeStart = NodeString + StringIndex + 1;
> 
> +NumberNodes++;
> 
>}
> 
>  }
> 
> 
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117114): https://edk2.groups.io/g/devel/message/117114
Mute This Topic: https://groups.io/mt/105101991/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 V5 2/2] RedfishClientPkg/FeatureDriver: Use SetRedfishSettingsObjectsUri

2024-03-26 Thread Nickle Wang via groups.io


Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Friday, March 22, 2024 10:41 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [edk2-redfish-client][PATCH V5 2/2] RedfishClientPkg/FeatureDriver:
> Use SetRedfishSettingsObjectsUri
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Use SetRedfishSettingsObjectsUri to set the config language for SettingsObject
> URI.
> 
> Signed-off-by: Abner Chang 
> Co-authored-by: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c  | 1 +
>  RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c  | 1 +
>  .../Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c  | 1 +
>  .../Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c   | 1 +
>  RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c  | 1 +
>  5 files changed, 5 insertions(+)
> 
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> index 1ca920640a..bb64ef8625 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> @@ -141,6 +141,7 @@ RedfishResourceConsumeResource (
>  );
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n",
> __func__, PendingSettingUri));
> +SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
>  Private->Uri = PendingSettingUri;
>  ExpectedResponse = &PendingSettingResponse;
>} else {
> diff --git a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> index 7501c1a975..5a66fe59e0 100644
> --- a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> +++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> @@ -130,6 +130,7 @@ RedfishResourceConsumeResource (
>   );
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: @Redfish.Settings
> found: %s\n", __func__, PendingSettingUri));
> +SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
>  Private->Uri = PendingSettingUri;
>  ExpectedResponse = &PendingSettingResponse;
>} else {
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD
> xe.c
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD
> xe.c
> index 1235760a18..a0c71212b3 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD
> xe.c
> +++ b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSyste
> +++ mDxe.c
> @@ -133,6 +133,7 @@ RedfishResourceConsumeResource (
>   );
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n",
> __func__, PendingSettingUri));
> +SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
>  Private->Uri = PendingSettingUri;
>  ExpectedResponse = &PendingSettingResponse;
>} else {
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.c
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.c
> index 5207362dac..494bf59dfc 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.c
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystem
> +++ Dxe.c
> @@ -134,6 +134,7 @@ RedfishResourceConsumeResource (
>   );
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n",
> __func__, PendingSettingUri));
> +SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
>  Private->Uri = PendingSettingUri;
>  ExpectedResponse = &PendingSettingResponse;
>} else {
> diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> index c4a363cdf5..f2c0a7735b 100644
> --- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> +++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> @@ -134,6 +134,7 @@ RedfishResourceConsumeResource (
>   );
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n",
> __func__, PendingSettingUri));
> +SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
>  Private->Uri = PendingSettingUri;
>  ExpectedResponse = &PendingSettingResponse;
>} else {
> --
> 2.37.1.windows.1



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

Re: [edk2-devel] [edk2-redfish-client][PATCH V5 1/2] RedfishClientPkg: Set SettingsObject URI as the config language

2024-03-26 Thread Nickle Wang via groups.io
Thanks for working on this, Abner.


Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Friday, March 22, 2024 10:41 PM
> To: devel@edk2.groups.io
> Cc: Igor Kulchytskyy ; Nickle Wang 
> Subject: [edk2-redfish-client][PATCH V5 1/2] RedfishClientPkg: Set 
> SettingsObject
> URI as the config language
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Set SettingsObject URI in @Redfish.Settings resource as the config language
> which is the same as the config language of parent URI that mandates
> @Redfish.Settings.
> With this, we can find the config language of the properties in 
> SettingsObject URI.
> 
> Signed-off-by: Abner Chang 
> Cc: Igor Kulchytskyy 
> Co-authored-by: Nickle Wang 
> ---
>  .../Library/RedfishFeatureUtilityLib.h| 17 
>  .../RedfishFeatureUtilityLib.c| 89 ---
>  .../RedfishConfigLangMapDxe.c | 15 +++-
>  3 files changed, 104 insertions(+), 17 deletions(-)
> 
> diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> index ba9ea01501..3c5f248eb7 100644
> --- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> +++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> @@ -369,6 +369,23 @@ RedfishSetRedfishUri (
>INEFI_STRING  Uri
>);
> 
> +/**
> +
> +  Save Redfish SettingsObject URI in database for further use.
> +
> +  @param[in]ParentUri Parent URI of @Redfish.Settings property.
> +  @param[in]SettingObjectUri  Redfish SettingsObject Uri to save.
> +
> +  @retval  EFI_INVALID_PARAMETER  SystemId is NULL or EMPTY
> +  @retval  EFI_SUCCESSRedfish uri is saved
> +
> +**/
> +EFI_STATUS
> +SetRedfishSettingsObjectsUri (
> +  IN EFI_STRING  ParentUri,
> +  IN EFI_STRING  SettingObjectUri
> +  );
> +
>  /**
> 
>Get the property name by given Configure Language.
> diff --git
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> index cc2b37b796..dda80c4608 100644
> ---
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUt
> +++ ilityLib.c
> @@ -2082,7 +2082,6 @@ GetConfigureLang (
>EFI_STRING  ResultStr;
>EFI_STRING  UnicodeUri;
>EFI_STATUS  Status;
> -  EFI_STRING  StrFound;
> 
>if (IS_EMPTY_STRING (Uri)) {
>  return NULL;
> @@ -2101,18 +2100,6 @@ GetConfigureLang (
>}
> 
>ConfigLang = RedfishGetConfigLanguage (UnicodeUri);
> -  if (ConfigLang == NULL) {
> -//
> -// @Redfish.Settings share the same schema as its parent.
> -// Remove "Settings" and try again.
> -//
> -StrFound = StrStr (UnicodeUri, L"/Settings");
> -if (StrFound != NULL) {
> -  StrFound[0] = L'\0';
> -  DEBUG ((REDFISH_DEBUG_TRACE, "%a: \"Settings\" found in URI, try: 
> %s\n",
> __func__, UnicodeUri));
> -  ConfigLang = RedfishGetConfigLanguage (UnicodeUri);
> -}
> -  }
> 
>FreePool (UnicodeUri);
> 
> @@ -2172,6 +2159,64 @@ RedfishSetRedfishUri (
>return mConfigLangMapProtocol->Set (mConfigLangMapProtocol, ConfigLang,
> Uri);  }
> 
> +/**
> +
> +  Save Redfish SettingsObject URI in database for further use.
> +
> +  @param[in]ParentUri Parent URI of @Redfish.Settings property.
> +  @param[in]SettingObjectUri  Redfish SettingsObject Uri to save.
> +
> +  @retval  EFI_INVALID_PARAMETER  ParentUri or SettingObjectUri is NULL.
> +  @retval  EFI_NOT_FOUND  Config language for ParentUri is not found.
> +  @retval  EFI_SUCCESSRedfish URI is saved with corresponding
> +  config language.
> +
> +**/
> +EFI_STATUS
> +SetRedfishSettingsObjectsUri (
> +  IN EFI_STRING  ParentUri,
> +  IN EFI_STRING  SettingObjectUri
> +  )
> +{
> +  EFI_STATUS  Status;
> +  EFI_STRING  ConfigLang;
> +
> +  if ((ParentUri == NULL) || (SettingObjectUri == NULL)) {
> +return EFI_INVALID_PARAMETER;
> +  }
> +
> +  //
> +  // Check if the SettingsObject URI already in the database.
> +  //
> +  Status = EFI_SUCCESS;
> +  ConfigLang = RedfishGetConfigLanguage (SettingObjectUri);  if
> + (ConfigLang == NULL) {
> +//
> +// No config language of SettingsObject URI is found.
> +// Get the config language of parent URI because the data model of
> +// SettingsObject URI resource is the same as the data model of parent 
> URI.
> +//
> +ConfigLang = RedfishGetConfigLanguage (ParentUri);
> +if (ConfigLang == NULL) {
> +  DEBUG ((DEBUG_ERROR, "%a: Failed to get the config language of parent
> URI that mandates SettingsObject - %s.\n", __func__, ParentUri));
> +  Status = EFI_NOT_FOUND;
> +} else {
> +
> +  // Set the config language of settings URI using parent's U

Re: [edk2-devel] [PATCH edk2-platforms v2 1/1] Maintainers.txt: add myself as QemuSbsa maintainer

2024-03-26 Thread Ard Biesheuvel
On Tue, 26 Mar 2024 at 14:11, Marcin Juszkiewicz
 wrote:
>
> With all changes going around sbsa-ref/QemuSbsa platform Leif suggested
> that I should become maintainer as well.
>
> My GitHub account name is "hrw".
>
> Signed-off-by: Marcin Juszkiewicz 

Welcome!

Reviewed-by: Ard Biesheuvel 

> ---
>  Maintainers.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Maintainers.txt b/Maintainers.txt
> index e57c32f16a05..ca36aa679470 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -383,8 +383,8 @@ F: Platform/Qemu/SbsaQemu/
>  F: Silicon/Qemu/SbsaQemu/
>  M: Ard Biesheuvel 
>  M: Leif Lindholm 
> +M: Marcin Juszkiewicz  [hrw]
>  R: Graeme Gregory 
> -R: Marcin Juszkiewicz 
>
>  Raspberry Pi platforms and silicon
>  F: Platform/RaspberryPi/
> --
> 2.44.0
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117111): https://edk2.groups.io/g/devel/message/117111
Mute This Topic: https://groups.io/mt/105156582/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 v2 1/1] Maintainers.txt: add myself as QemuSbsa maintainer

2024-03-26 Thread Marcin Juszkiewicz
With all changes going around sbsa-ref/QemuSbsa platform Leif suggested
that I should become maintainer as well.

My GitHub account name is "hrw".

Signed-off-by: Marcin Juszkiewicz 
---
 Maintainers.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index e57c32f16a05..ca36aa679470 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -383,8 +383,8 @@ F: Platform/Qemu/SbsaQemu/
 F: Silicon/Qemu/SbsaQemu/
 M: Ard Biesheuvel 
 M: Leif Lindholm 
+M: Marcin Juszkiewicz  [hrw]
 R: Graeme Gregory 
-R: Marcin Juszkiewicz 
 
 Raspberry Pi platforms and silicon
 F: Platform/RaspberryPi/
-- 
2.44.0



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




Re: [edk2-devel] [PATCH 0/5] [PATCH 0/5] Config language searching algorithm enhancement and the bug fixes

2024-03-26 Thread Nickle Wang via groups.io
Thanks for working on Redfish performance improvements, Abner. Per offline 
discussion, I have updated this patch series to support menu path reporting for 
BIOS attribute registry.

Please send version 2 patch series if you are ok with my modifications.

Thanks,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Friday, March 22, 2024 5:43 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [PATCH 0/5] [PATCH 0/5] Config language searching algorithm
> enhancement and the bug fixes
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> PR # 5491
> 
> In this patch set,
> 1 We enhance the config language searching algorithm.
>   As the performance of searching config language using HII GetString is
>   pretty slow. For the example, 1800 HII BIOS options takes over 30 mins
>   to build up the metadata required for Redfish BIOS resource. With this
>   improvement, it only takes 4 seconds.
> 
> 2.Introduce the Redfish debug framework, there are three edk2 Redfish
>   debug scopes.
>   a. PcdDebugPrintErrorLevel, DEBUG_MANAGEABILITY to enable debug message
>  for edk2 Redfish.
>   b. PcdRedfishDebugCategory, enablement of individule edk2 Redfish
>  component. Currently we only support RedfishPlatformConfigDxe
>  module.
>   c. PcdRedfishPlatformConfigDebugProperty, edk2 Redfish module debug
>  scope. This PCD is used by RedfishPlatformConfigDxe debug enablement.
> 
> 3 This patch set also fixes an issue that deletes HII string unexpectedly.
> 
> Signed-off-by: Abner Chang 
> Co-authored-by: Nickle Wang 
> Cc: Igor Kulchytskyy 
> 
> Abner Chang (4):
>   RedfishPkg/RedfishDebugLib: Introduce Redfish DEBUG macro
>   RedfishPkg/RedfishPlatformConfigDxe:Add RefishDebugLib support
>   RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted
> unexpectedly
>   EmulatorPkg/Redfish: Use edk2 Redfish debug PCDs
> 
> abnchang (1):
>   RedfishPkg/RedfishPlatformConfigDxe: Config language searching
> optimization
> 
>  RedfishPkg/RedfishPkg.dec |  24 +
>  EmulatorPkg/EmulatorPkg.dsc   |  21 +
>  .../RedfishDebugLib/RedfishDebugLib.inf   |   4 +
>  .../RedfishPlatformConfigDxe.inf  |   8 +
>  RedfishPkg/Include/Library/RedfishDebugLib.h  |  43 +-
>  .../RedfishPlatformConfigDxe.h|  46 +-
>  .../RedfishPlatformConfigImpl.h   | 131 ++-
>  .../Library/RedfishDebugLib/RedfishDebugLib.c |  55 +-
>  .../RedfishPlatformConfigCapability.c |  52 +
>  .../RedfishPlatformConfigDxe.c|  89 +-
>  .../RedfishPlatformConfigImpl.c   | 894 --
>  11 files changed, 1196 insertions(+), 171 deletions(-)  create mode 100644
> RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigCapability.c
> 
> --
> 2.37.1.windows.1



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




Re: [edk2-devel] [PATCH edk2-platforms 1/1] Maintainers.txt: add myself as QemuSbsa maintainer

2024-03-26 Thread Leif Lindholm
On Tue, Mar 26, 2024 at 12:24:10 +0100, Marcin Juszkiewicz wrote:
> With all changes going around sbsa-ref/QemuSbsa platform Leif suggested
> that I should become maintainer as well.
> 
> My GitHub account name is "hrw".
> 
> Signed-off-by: Marcin Juszkiewicz 
> ---
>  Maintainers.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index e57c32f16a05..a37fc9e60723 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -383,8 +383,8 @@ F: Platform/Qemu/SbsaQemu/
>  F: Silicon/Qemu/SbsaQemu/
>  M: Ard Biesheuvel 
>  M: Leif Lindholm 
> +M: Marcin Juszkiewicz 

Ah - could you add your github username in [] after the email?
I see now we haven't added that to other maintainers in this file, but
we need to info to give you the access privileges.

/
Leif

>  R: Graeme Gregory 
> -R: Marcin Juszkiewicz 
>  
>  Raspberry Pi platforms and silicon
>  F: Platform/RaspberryPi/
> -- 
> 2.44.0
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117108): https://edk2.groups.io/g/devel/message/117108
Mute This Topic: https://groups.io/mt/105155999/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 1/1] Maintainers.txt: add myself as QemuSbsa maintainer

2024-03-26 Thread Marcin Juszkiewicz
With all changes going around sbsa-ref/QemuSbsa platform Leif suggested
that I should become maintainer as well.

My GitHub account name is "hrw".

Signed-off-by: Marcin Juszkiewicz 
---
 Maintainers.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index e57c32f16a05..a37fc9e60723 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -383,8 +383,8 @@ F: Platform/Qemu/SbsaQemu/
 F: Silicon/Qemu/SbsaQemu/
 M: Ard Biesheuvel 
 M: Leif Lindholm 
+M: Marcin Juszkiewicz 
 R: Graeme Gregory 
-R: Marcin Juszkiewicz 
 
 Raspberry Pi platforms and silicon
 F: Platform/RaspberryPi/
-- 
2.44.0



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




[edk2-devel] [PATCH] ShellPkg: Update smbiosview type 4 with SMBIOS 3.6 fields

2024-03-26 Thread Lien, HoraceX
From: HoraceX Lien 

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

update smbiosview type 4 related fileds.

Signed-off-by: HoraceX Lien 
Cc: Zhichao Gao 
---
 .../Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index f96317b314..48b4488215 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -520,6 +520,10 @@ SmbiosPrintStructure (
 ShellPrintEx (-1, -1, L"Thread Count 2: %u\n", 
Struct->Type4->ThreadCount2);
   }
 
+  if (AE_SMBIOS_VERSION (0x3, 0x6) && (Struct->Hdr->Length > 0x2E)) {
+ShellPrintEx (-1, -1, L"Thead Enable: %u\n", 
Struct->Type4->ThreadEnabled);
+  }
+
   break;
 
 //
-- 
2.43.0.windows.1



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




Re: [edk2-devel] [PATCH V1 1/1] OvmfPkg/QemuBootOrderLib: Measure the etc/boot-menu-wait

2024-03-26 Thread sunceping
On Friday, March 22, 2024 5:06 PM Gerd Hoffmann wrote:
> 
> > > But then you have to find and update all callsites (or at least the
> > > ones where we care about measurement).
> > In your solution,  if we cache all items that need to be measured, we
> > would have to add a new API (example: QemuFwCfgGetDataFromCache ())  to
> get the data from cache.
> 
> No, we only need to update QemuFwCfgSelectItem + QemuFwCfgReadBytes to
> support reading from the cache.
Do you mean the existing API (QemuFwCfgSelectItem + QemuFwCfgReadBytes) need to 
be changed to support reading from the cache?

If that is the case,  there are some concerns as below:
1:  One or more new parameters (of QemuFwCfgReadBytes())  need to be added to 
search 
the item in cache, which is equivalent to adding a new API.

2:  The current QemuFwCfgReadBytes can read in chunks from qemu (example 
etc/e820) 
If we call QemuFwCfgReadBytes to get data from cache , we also need to support 
reading in chunks.
Then we have to add more parameters ( to set offset). This will make the API 
more and more complicated.

> QemuFwCfgGetDataFromCache() can be added as additional API, and callsites 
> have the option to either switch over, or continue to use the existing API.
Base above concerns, we think QemuFwCfgGetDataFromCache is must.

Thanks
Ceping




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




[edk2-devel] [PATCH v2 1/1] MdeModulePkg/AcpiTableDxe: PCD switch to avoid using ACPI reclaim memory

2024-03-26 Thread Aaron Li
UEFI spec defined ACPI Tables at boot time can be contained in memory of
type EfiACPIReclaimMemory or EfiAcpiMemoryNVS, although InstallAcpiTable
with AcpiTableProtocol will only allocate memory with type
EfiACPIReclaimMemory (Except FACS).

This patch provides an optional method controlled by PCD to avoid using
EfiACPIReclaimMemory, by setting the PCD PcdNoACPIReclaimMemory to TRUE,
all ACPI allocated memory will use EfiAcpiMemoryNVS instead.

Cc: Zhiguang Liu 
Cc: Dandan Bi 
Cc: Liming Gao 
Cc: Liu Yun 
Cc: Jiewen Yao 
Cc: Ray Ni 
Cc: Michael D Kinney 
Signed-off-by: Aaron Li 
---
 MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c | 37 
+++-
 MdeModulePkg/MdeModulePkg.dec|  7 
 MdeModulePkg/MdeModulePkg.uni|  8 +
 MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf|  1 +
 4 files changed, 45 insertions(+), 8 deletions(-)

diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c 
b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
index e09bc9b704f5..080768033cfa 100644
--- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
+++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
@@ -340,6 +340,7 @@ ReallocateAcpiTableBuffer (
   EFI_ACPI_TABLE_INSTANCE  TempPrivateData;
   EFI_STATUS   Status;
   UINT64   CurrentData;
+  EFI_MEMORY_TYPE  AcpiAllocateMemoryType;
 
   CopyMem (&TempPrivateData, AcpiTableInstance, sizeof 
(EFI_ACPI_TABLE_INSTANCE));
   //
@@ -359,6 +360,12 @@ ReallocateAcpiTableBuffer (
  NewMaxTableNumber * sizeof (UINT32);
   }
 
+  if (PcdGetBool (PcdNoACPIReclaimMemory)) {
+AcpiAllocateMemoryType = EfiACPIMemoryNVS;
+  } else {
+AcpiAllocateMemoryType = EfiACPIReclaimMemory;
+  }
+
   if (mAcpiTableAllocType != AllocateAnyPages) {
 //
 // Allocate memory in the lower 32 bit of address range for
@@ -372,13 +379,13 @@ ReallocateAcpiTableBuffer (
 PageAddress = 0x;
 Status  = gBS->AllocatePages (
  mAcpiTableAllocType,
- EfiACPIReclaimMemory,
+ AcpiAllocateMemoryType,
  EFI_SIZE_TO_PAGES (TotalSize),
  &PageAddress
  );
   } else {
 Status = gBS->AllocatePool (
-EfiACPIReclaimMemory,
+AcpiAllocateMemoryType,
 TotalSize,
 (VOID **)&Pointer
 );
@@ -512,6 +519,7 @@ AddTableToList (
   EFI_PHYSICAL_ADDRESS  AllocPhysAddress;
   UINT64Buffer64;
   BOOLEAN   AddToRsdt;
+  EFI_MEMORY_TYPE   AcpiAllocateMemoryType;
 
   //
   // Check for invalid input parameters
@@ -550,6 +558,12 @@ AddTableToList (
   CurrentTableList->TableSize  = CurrentTableSize;
   CurrentTableList->PoolAllocation = FALSE;
 
+  if (PcdGetBool (PcdNoACPIReclaimMemory)) {
+AcpiAllocateMemoryType = EfiACPIMemoryNVS;
+  } else {
+AcpiAllocateMemoryType = EfiACPIReclaimMemory;
+  }
+
   //
   // Allocation memory type depends on the type of the table
   //
@@ -585,7 +599,7 @@ AddTableToList (
 // such as AArch64 that allocate multiples of 64 KB
 //
 Status = gBS->AllocatePool (
-EfiACPIReclaimMemory,
+AcpiAllocateMemoryType,
 CurrentTableList->TableSize,
 (VOID **)&CurrentTableList->Table
 );
@@ -596,7 +610,7 @@ AddTableToList (
 //
 Status = gBS->AllocatePages (
 mAcpiTableAllocType,
-EfiACPIReclaimMemory,
+AcpiAllocateMemoryType,
 EFI_SIZE_TO_PAGES (CurrentTableList->TableSize),
 &AllocPhysAddress
 );
@@ -1944,6 +1958,7 @@ AcpiTableAcpiTableConstructor (
   UINTN RsdpTableSize;
   UINT8 *Pointer;
   EFI_PHYSICAL_ADDRESS  PageAddress;
+  EFI_MEMORY_TYPE   AcpiAllocateMemoryType;
 
   //
   // Check for invalid input parameters
@@ -1978,17 +1993,23 @@ AcpiTableAcpiTableConstructor (
 RsdpTableSize += sizeof (EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER);
   }
 
+  if (PcdGetBool (PcdNoACPIReclaimMemory)) {
+AcpiAllocateMemoryType = EfiACPIMemoryNVS;
+  } else {
+AcpiAllocateMemoryType = EfiACPIReclaimMemory;
+  }
+
   if (mAcpiTableAllocType != AllocateAnyPages) {
 PageAddress = 0x;
 Status  = gBS->AllocatePages (
  mAcpiTableAllocType,
- EfiACPIReclaimMemory,
+ AcpiAllocateMemoryType,
  EFI_SIZE_TO_PAGES (RsdpTableSize),
  &PageAddress
  );
   } else {
 Status = gBS->AllocatePool (
-EfiACPIReclaimMemory,
+AcpiAllo