Re: [edk2-devel] [edk2-platforms][PATCH v3 1/5] MdeModulePkg: Allow dynamic generation of HEST ACPI table

2024-04-08 Thread Dhaval Sharma
Hi,
Is there any plan to upstream these HEST/ACPI patches? They seem to be arch 
agnostic.


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




Re: [edk2-devel] [edk2-platforms][PATCH v3 1/5] MdeModulePkg: Allow dynamic generation of HEST ACPI table

2021-10-04 Thread Sami Mujawar

Hi Omkar,

Please find my feedback inline marked [SAMI].

Regards,

Sami Mujawar


On 24/08/2021 06:33 AM, Omkar Anand Kulkarni wrote:

Introduce the HEST table generation protocol that allows platforms to
build the table with multiple error source descriptors and install the
table. The protocol provides two interfaces. The first interface allows
for adding multiple error source descriptors into the HEST table. The
second interface can then be used to dynamically install the fully
populated HEST table. This allows multiple drivers and/or libraries to
dynamically register error source descriptors into the HEST table.

Co-authored-by: Thomas Abraham 
Signed-off-by: Omkar Anand Kulkarni 
---
  MdeModulePkg/MdeModulePkg.dec   |   3 +
  MdeModulePkg/Universal/Apei/HestDxe/HestDxe.inf |  49 +++
  MdeModulePkg/Include/Protocol/HestTable.h   |  71 +
  MdeModulePkg/Universal/Apei/HestDxe/HestDxe.c   | 318 
  4 files changed, 441 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index ad84421cf3f7..2cb4ba69d6bf 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -663,6 +663,9 @@
## Include/Protocol/VariablePolicy.h
gEdkiiVariablePolicyProtocolGuid = { 0x81D1675C, 0x86F6, 0x48DF, { 0xBD, 
0x95, 0x9A, 0x6E, 0x4F, 0x09, 0x25, 0xC3 } }
  
+  ## Arm Platform HEST table generation protocol

+  gHestTableProtocolGuid = { 0x705bdcd9, 0x8c47, 0x457e, { 0xad, 0x0d, 0xf7, 
0x86, 0xf3, 0x4a, 0x0d, 0x63 } }
+
  [PcdsFeatureFlag]
## Indicates if the platform can support update capsule across a system 
reset.
#   TRUE  - Supports update capsule across a system reset.
diff --git a/MdeModulePkg/Universal/Apei/HestDxe/HestDxe.inf 
b/MdeModulePkg/Universal/Apei/HestDxe/HestDxe.inf
new file mode 100644
index ..91c7385bf7ff
--- /dev/null
+++ b/MdeModulePkg/Universal/Apei/HestDxe/HestDxe.inf
@@ -0,0 +1,49 @@
+## @file
+#  Dxe driver that creates and publishes the HEST table.
+#
+#  This driver creates HEST header and provides protocol service to append
+#  and install the HEST table.
+#
+#  Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001001A

[SAMI] Use latest INF version.

+  BASE_NAME  = HestDxe
+  FILE_GUID  = 933099a2-ef71-4e00-82aa-a79b1e0a3b38
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= HestInitialize
+
+[Sources.Common]
+  HestDxe.c
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MdePkg/MdePkg.dec
+  Platform/ARM/SgiPkg/SgiPlatform.dec

[SAMI] Is SgiPlatform.dec, ArmPkg.dec and ArmPlatformPkg.dec needed here?

+
+[LibraryClasses]
+  ArmLib

[SAMI] Is ArmLib needed here?

+  BaseMemoryLib
+  DebugLib
+  UefiDriverEntryPoint
+  UefiLib
+
+[Protocols]
+  gEfiAcpiTableProtocolGuid ## PROTOCOL ALWAYS_CONSUMED
+  gHestTableProtocolGuid## PRODUCES
+
+[FixedPcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
+
+[Depex]
+  TRUE
diff --git a/MdeModulePkg/Include/Protocol/HestTable.h 
b/MdeModulePkg/Include/Protocol/HestTable.h
new file mode 100644
index ..3b2e1f7d9203
--- /dev/null
+++ b/MdeModulePkg/Include/Protocol/HestTable.h

[SAMI] Should this file be renamed to HestTableProtocol.h?

@@ -0,0 +1,71 @@
+/** @file
+  Builds and installs the HEST ACPI table.
+
+  Define the protocol interface that allows HEST ACPI table to be created,
+  populated with error record descriptions and installation of the HEST ACPI
+  table.
+
+  Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef HEST_TABLE_H_
+#define HEST_TABLE_H_
+
+#define HEST_TABLE_PROTOCOL_GUID \
+  { \
+0x705bdcd9, 0x8c47, 0x457e, \
+{ 0xad, 0x0d, 0xf7, 0x86, 0xf3, 0x4a, 0x0d, 0x63 } \
+  }
+
+/**
+  Append HEST error source descriptor protocol service.
+
+  Protocol service used to append newly collected error source descriptors to
+  to an already created HEST table.
+
+  @param[in]  ErrorSourceDescriptorList  List of Error Source Descriptors.
+  @param[in]  ErrorSourceDescriptorListSize  Total Size of Error Source
+ Descriptors.
+  @param[in]  ErrorSourceDescriptorCount Total count of error source
+ descriptors.
+
+  @retval  EFI_SUCCESSAppending the error source descriptors
+  successful.
+  @retval  EFI_OUT_OF_RESOURCES   Buffer reallocation failed 

[edk2-devel] [edk2-platforms][PATCH v3 1/5] MdeModulePkg: Allow dynamic generation of HEST ACPI table

2021-08-23 Thread Omkar Anand Kulkarni
Introduce the HEST table generation protocol that allows platforms to
build the table with multiple error source descriptors and install the
table. The protocol provides two interfaces. The first interface allows
for adding multiple error source descriptors into the HEST table. The
second interface can then be used to dynamically install the fully
populated HEST table. This allows multiple drivers and/or libraries to
dynamically register error source descriptors into the HEST table.

Co-authored-by: Thomas Abraham 
Signed-off-by: Omkar Anand Kulkarni 
---
 MdeModulePkg/MdeModulePkg.dec   |   3 +
 MdeModulePkg/Universal/Apei/HestDxe/HestDxe.inf |  49 +++
 MdeModulePkg/Include/Protocol/HestTable.h   |  71 +
 MdeModulePkg/Universal/Apei/HestDxe/HestDxe.c   | 318 
 4 files changed, 441 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index ad84421cf3f7..2cb4ba69d6bf 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -663,6 +663,9 @@
   ## Include/Protocol/VariablePolicy.h
   gEdkiiVariablePolicyProtocolGuid = { 0x81D1675C, 0x86F6, 0x48DF, { 0xBD, 
0x95, 0x9A, 0x6E, 0x4F, 0x09, 0x25, 0xC3 } }
 
+  ## Arm Platform HEST table generation protocol
+  gHestTableProtocolGuid = { 0x705bdcd9, 0x8c47, 0x457e, { 0xad, 0x0d, 0xf7, 
0x86, 0xf3, 0x4a, 0x0d, 0x63 } }
+
 [PcdsFeatureFlag]
   ## Indicates if the platform can support update capsule across a system 
reset.
   #   TRUE  - Supports update capsule across a system reset.
diff --git a/MdeModulePkg/Universal/Apei/HestDxe/HestDxe.inf 
b/MdeModulePkg/Universal/Apei/HestDxe/HestDxe.inf
new file mode 100644
index ..91c7385bf7ff
--- /dev/null
+++ b/MdeModulePkg/Universal/Apei/HestDxe/HestDxe.inf
@@ -0,0 +1,49 @@
+## @file
+#  Dxe driver that creates and publishes the HEST table.
+#
+#  This driver creates HEST header and provides protocol service to append
+#  and install the HEST table.
+#
+#  Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001001A
+  BASE_NAME  = HestDxe
+  FILE_GUID  = 933099a2-ef71-4e00-82aa-a79b1e0a3b38
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= HestInitialize
+
+[Sources.Common]
+  HestDxe.c
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MdePkg/MdePkg.dec
+  Platform/ARM/SgiPkg/SgiPlatform.dec
+
+[LibraryClasses]
+  ArmLib
+  BaseMemoryLib
+  DebugLib
+  UefiDriverEntryPoint
+  UefiLib
+
+[Protocols]
+  gEfiAcpiTableProtocolGuid ## PROTOCOL ALWAYS_CONSUMED
+  gHestTableProtocolGuid## PRODUCES
+
+[FixedPcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
+
+[Depex]
+  TRUE
diff --git a/MdeModulePkg/Include/Protocol/HestTable.h 
b/MdeModulePkg/Include/Protocol/HestTable.h
new file mode 100644
index ..3b2e1f7d9203
--- /dev/null
+++ b/MdeModulePkg/Include/Protocol/HestTable.h
@@ -0,0 +1,71 @@
+/** @file
+  Builds and installs the HEST ACPI table.
+
+  Define the protocol interface that allows HEST ACPI table to be created,
+  populated with error record descriptions and installation of the HEST ACPI
+  table.
+
+  Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef HEST_TABLE_H_
+#define HEST_TABLE_H_
+
+#define HEST_TABLE_PROTOCOL_GUID \
+  { \
+0x705bdcd9, 0x8c47, 0x457e, \
+{ 0xad, 0x0d, 0xf7, 0x86, 0xf3, 0x4a, 0x0d, 0x63 } \
+  }
+
+/**
+  Append HEST error source descriptor protocol service.
+
+  Protocol service used to append newly collected error source descriptors to
+  to an already created HEST table.
+
+  @param[in]  ErrorSourceDescriptorList  List of Error Source Descriptors.
+  @param[in]  ErrorSourceDescriptorListSize  Total Size of Error Source
+ Descriptors.
+  @param[in]  ErrorSourceDescriptorCount Total count of error source
+ descriptors.
+
+  @retval  EFI_SUCCESSAppending the error source descriptors
+  successful.
+  @retval  EFI_OUT_OF_RESOURCES   Buffer reallocation failed for the Hest
+  table.
+  @retval  EFI_INVALID_PARAMETER  Null ErrorSourceDescriptorList param or
+**/
+typedef
+EFI_STATUS
+(EFIAPI *APPEND_ERROR_SOURCE_DESCRIPTOR) (
+  IN CONST VOID *ErrorSourceDescriptorList,
+  IN UINTN  ErrorSourceDescriptorListSize,
+  IN UINTN  ErrorSourceDescriptorCount
+  );
+
+/**
+