Re: [edk2-devel] [PATCH v4 0/8] Adjust the QemuFwCfgLibMmio and add PEI stage

2024-04-28 Thread Ard Biesheuvel
On Mon, 29 Apr 2024 at 03:17, Chao Li  wrote:
>
> Hi Ard and Gerd and other maintainers,
>
> Could you review this version and give your suggestions?
>

This looks ok to me now, modulo a few minor tweaks (see below) that I
will apply when merging.

I also changed the type signatures to

extern
VOID
(EFIAPI *InternalQemuFwCfgReadBytes) (
  IN UINTN  Size,
  IN VOID   *Buffer  OPTIONAL
  );

Note that the EFIAPI applies to the function itself, not the pointer
so it needs to be inside the ()



--- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgMmioPei.c
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgMmioPei.c
@@ -104,7 +104,6 @@ QemuFwCfgInitialize (
   UINT64FwCfgDmaAddress;
   UINT64FwCfgDmaSize;
   QEMU_FW_CFG_RESOURCE  *FwCfgResource;
-  VOID  *Buffer;

   //
   // Check whether the Qemu firmware configure resources HOB has been created,
@@ -125,11 +124,8 @@ QemuFwCfgInitialize (
   //
   // Create resouce memory
   //
-  Buffer = AllocatePages(EFI_SIZE_TO_PAGES (sizeof (QEMU_FW_CFG_RESOURCE)));
-  ASSERT (Buffer != NULL);
-  ZeroMem (Buffer, sizeof (QEMU_FW_CFG_RESOURCE));
-
-  FwCfgResource = (QEMU_FW_CFG_RESOURCE *)Buffer;
+  FwCfgResource = AllocateZeroPool (sizeof (QEMU_FW_CFG_RESOURCE));
+  ASSERT (FwCfgResource != NULL);

   for (Prev = 0; ; Prev = Node) {
 Node = fdt_next_node (DeviceTreeBase, Prev, NULL);
@@ -141,7 +137,7 @@ QemuFwCfgInitialize (
 // Check for memory node
 //
 Type = fdt_getprop (DeviceTreeBase, Node, "compatible", &Len);
-if ((Type) &&
+if ((Type != NULL) &&
 (AsciiStrnCmp (Type, "qemu,fw-cfg-mmio", Len) == 0))
 {
   //


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118376): https://edk2.groups.io/g/devel/message/118376
Mute This Topic: https://groups.io/mt/105746786/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] Maintainers.txt: Update StandaloneMmPkg and UefiCpuPkg Reviewer

2024-04-28 Thread Ard Biesheuvel
On Mon, 29 Apr 2024 at 07:32, Jiaxin Wu  wrote:
>
> This is to update StandaloneMmPkg and UefiCpuPkg Reviewer.
>
> Cc: Ray Ni 
> Cc: Ard Biesheuvel 
> Cc: Sami Mujawar 
> Cc: Rahul Kumar 
> Cc: Gerd Hoffmann 
> Signed-off-by: Jiaxin Wu 

Thanks for helping out.

I am going to queue this up.

> ---
>  Maintainers.txt | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 7d9cdca611..6fccbb6788 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -624,17 +624,19 @@ W: 
> https://github.com/tianocore/tianocore.github.io/wiki/SourceLevelDebugPkg
>  StandaloneMmPkg
>  F: StandaloneMmPkg/
>  M: Ard Biesheuvel  [ardbiesheuvel]
>  M: Sami Mujawar  [samimujawar]
>  M: Ray Ni  [niruiyu]
> +R: Jiaxin Wu  [jiaxinwu]
>
>  UefiCpuPkg
>  F: UefiCpuPkg/
>  W: https://github.com/tianocore/tianocore.github.io/wiki/UefiCpuPkg
>  M: Ray Ni  [niruiyu]
>  R: Rahul Kumar  [rahul1-kumar]
>  R: Gerd Hoffmann  [kraxel]
> +R: Jiaxin Wu  [jiaxinwu]
>
>  UefiCpuPkg: Sec related modules
>  F: UefiCpuPkg/SecCore/
>  F: UefiCpuPkg/ResetVector/
>  R: Catharine West  [catharine-intl]
> --
> 2.16.2.windows.1
>


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




[edk2-devel] [RESEND PATCH v4 5/5] DynamicTablesPkg: Adds X64 arch MADT Table generator

2024-04-28 Thread Abdul Lateef Attar via groups.io
Adds X64 architecture specific MADT/APIC Table generator.
Register/Deregister MADT table.
Adds X64 architecture namespace objects.

Cc: Sami Mujawar 
Cc: Pierre Gondois 
Signed-off-by: Abdul Lateef Attar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc|   6 +
 .../Include/ConfigurationManagerObject.h  |   1 +
 .../Include/X64NameSpaceObjects.h |  48 +++
 .../X64/AcpiMadtLibX64/AcpiMadtLibX64.inf |  27 ++
 .../Acpi/X64/AcpiMadtLibX64/MadtGenerator.c   | 375 ++
 5 files changed, 457 insertions(+)
 create mode 100644 DynamicTablesPkg/Include/X64NameSpaceObjects.h
 create mode 100644 
DynamicTablesPkg/Library/Acpi/X64/AcpiMadtLibX64/AcpiMadtLibX64.inf
 create mode 100644 
DynamicTablesPkg/Library/Acpi/X64/AcpiMadtLibX64/MadtGenerator.c

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index fc2ac5962e..19034e6f65 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -39,6 +39,11 @@
   DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf
 
 [Components.IA32, Components.X64]
+  #
+  # Generators
+  #
+  DynamicTablesPkg/Library/Acpi/X64/AcpiMadtLibX64/AcpiMadtLibX64.inf
+
   #
   # Dynamic Table Factory Dxe
   #
@@ -48,6 +53,7 @@
   NULL|DynamicTablesPkg/Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf
   NULL|DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/AcpiWsmtLib.inf
   NULL|DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf
+  NULL|DynamicTablesPkg/Library/Acpi/X64/AcpiMadtLibX64/AcpiMadtLibX64.inf
   }
 
 [Components.ARM, Components.AARCH64]
diff --git a/DynamicTablesPkg/Include/ConfigurationManagerObject.h 
b/DynamicTablesPkg/Include/ConfigurationManagerObject.h
index f2cfadf3d4..31197eb019 100644
--- a/DynamicTablesPkg/Include/ConfigurationManagerObject.h
+++ b/DynamicTablesPkg/Include/ConfigurationManagerObject.h
@@ -110,6 +110,7 @@ typedef enum ObjectNameSpaceID {
   EObjNameSpaceStandard,  ///< Standard Objects Namespace
   EObjNameSpaceArm,   ///< ARM Objects Namespace
   EObjNameSpaceArch,  ///< Arch Objects Namespace
+  EObjNameSpaceX64,   ///< X64 Objects Namespace
   EObjNameSpaceOem = 0x8, ///< OEM Objects Namespace
   EObjNameSpaceMax
 } EOBJECT_NAMESPACE_ID;
diff --git a/DynamicTablesPkg/Include/X64NameSpaceObjects.h 
b/DynamicTablesPkg/Include/X64NameSpaceObjects.h
new file mode 100644
index 00..cd5c1ff43c
--- /dev/null
+++ b/DynamicTablesPkg/Include/X64NameSpaceObjects.h
@@ -0,0 +1,48 @@
+/** @file
+
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+- X64- X64 processor architecture
+  **/
+
+#ifndef X64_NAMESPACE_OBJECT_H_
+#define X64_NAMESPACE_OBJECT_H_
+
+/** The EX64_OBJECT_ID enum describes the Object IDs
+in the X64 Namespace
+*/
+typedef enum X64ObjectID {
+  EX64ObjReserved, ///<  0 - Reserved
+  EX64ObjMadtLocalInterruptInfo,   ///<  1 - MADT Local Interrupt 
Information
+  EX64ObjMadtProcessorLocalApicX2ApicInfo, ///<  2 - MADT Local APIC/x2APIC 
Controller Information
+  EX64ObjMadtIoApicInfo,   ///<  3 - MADT IOAPIC Information
+  EX64ObjMadtLocalApicX2ApicNmiInfo,   ///<  4 - MADT Local APIC/x2APIC 
NMI Information
+  EX64ObjMadtInterruptSourceOverrideInfo,  ///<  5 - MADT Interrupt Override 
Information
+  EX64ObjMax
+} E_X64_OBJECT_ID;
+
+/** A structure that describes the
+MADT Local Interrupt Information for the Platform.
+
+ID: EX64ObjMadtLocalInterruptInfo
+*/
+typedef struct CmX64MadtLocalInterruptInfo {
+  UINT32LocalApicAddress; ///< Local Interrupt Controller Address
+  UINT32Flags;///< Flags
+} CM_X64_MADT_LOCAL_INTERRUPT_INFO;
+
+/** A structure that describes the
+MADT Interrupt controller type information for the platform.
+
+ID: EX64ObjMadtInterruptControllerTypeInfo
+*/
+typedef struct CmX64MadtInterruptControllerTypeInfo {
+  VOID *InterruptControllerTypeInfo; ///< Interrupt Controller Type 
Information
+  UINTNSize; ///< Size of the Interrupt Controller 
Type Information
+} CM_X64_MADT_INTERRUPT_CONTROLLER_TYPE_INFO;
+#endif
diff --git 
a/DynamicTablesPkg/Library/Acpi/X64/AcpiMadtLibX64/AcpiMadtLibX64.inf 
b/DynamicTablesPkg/Library/Acpi/X64/AcpiMadtLibX64/AcpiMadtLibX64.inf
new file mode 100644
index 00..4d59e9023c
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/X64/AcpiMadtLibX64/AcpiMadtLibX64.inf
@@ -0,0 +1,27 @@
+## @file
+#  MADT Acpi table generator
+#
+#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[Defines]
+  INF_VERSION = 1.27
+  BASE_NAME   = AcpiMadtLibX64
+  FILE_GUID   = BF8A63EC-21B9-4531-9866-F3F1593282EC
+  VERSION_STRING  = 1.0
+  MODULE_TYPE

[edk2-devel] [RESEND PATCH v4 4/5] DynamicTablesPkg: Adds ACPI SSDT HPET Table generator

2024-04-28 Thread Abdul Lateef Attar via groups.io
Adds generic ACPI SSDT HPET table generator library.
Register/Deregister HPET table.
Adds ACPI namespace object for HPET device.
Adds Address space for HPET device.

Cc: Sami Mujawar 
Cc: Pierre Gondois 
Signed-off-by: Abdul Lateef Attar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc|   2 +
 DynamicTablesPkg/Include/AcpiTableGenerator.h |   2 +
 .../Acpi/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf  |  32 ++
 .../Acpi/AcpiSsdtHpetLib/SsdtHpetGenerator.c  | 295 ++
 4 files changed, 331 insertions(+)
 create mode 100644 
DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf
 create mode 100644 
DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/SsdtHpetGenerator.c

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 477dc6b6a9..fc2ac5962e 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -36,6 +36,7 @@
   DynamicTablesPkg/Library/Acpi/AcpiFadtLib/AcpiFadtLib.inf
   DynamicTablesPkg/Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf
   DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/AcpiWsmtLib.inf
+  DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf
 
 [Components.IA32, Components.X64]
   #
@@ -46,6 +47,7 @@
   NULL|DynamicTablesPkg/Library/Acpi/AcpiFadtLib/AcpiFadtLib.inf
   NULL|DynamicTablesPkg/Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf
   NULL|DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/AcpiWsmtLib.inf
+  NULL|DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf
   }
 
 [Components.ARM, Components.AARCH64]
diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h 
b/DynamicTablesPkg/Include/AcpiTableGenerator.h
index a32ef46ecb..ef651aa2aa 100644
--- a/DynamicTablesPkg/Include/AcpiTableGenerator.h
+++ b/DynamicTablesPkg/Include/AcpiTableGenerator.h
@@ -1,6 +1,7 @@
 /** @file
 
   Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -101,6 +102,7 @@ typedef enum StdAcpiTableId {
   EStdAcpiTableIdPcct,  ///< PCCT Generator
   EStdAcpiTableIdHpet,  ///< HPET Generator
   EStdAcpiTableIdWsmt,  ///< WSMT Generator
+  EStdAcpiTableIdSsdtHpet,  ///< SSDT HPET Generator
   EStdAcpiTableIdMax
 } ESTD_ACPI_TABLE_ID;
 
diff --git a/DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf 
b/DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf
new file mode 100644
index 00..4dd0a60baf
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf
@@ -0,0 +1,32 @@
+## @file
+#  SSDT HPET Table Generator
+#
+#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[Defines]
+  INF_VERSION= 1.27
+  BASE_NAME  = AcpiSsdtHpetLib
+  FILE_GUID  = 85262912-AD7F-4EE0-8BB1-EE177275A54E
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiSsdtHpetLibConstructor
+  DESTRUCTOR = AcpiSsdtHpetLibDestructor
+
+[Sources]
+  SsdtHpetGenerator.c
+
+[Packages]
+  DynamicTablesPkg/DynamicTablesPkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  AcpiHelperLib
+  AmlLib
+  BaseLib
+  DebugLib
+
diff --git a/DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/SsdtHpetGenerator.c 
b/DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/SsdtHpetGenerator.c
new file mode 100644
index 00..5e4f935af8
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/SsdtHpetGenerator.c
@@ -0,0 +1,295 @@
+/** @file
+  SSDT HPET Table Generator
+
+  Copyright (c) 2017 - 2023, Arm Limited. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+  - ACPI 6.5 Specification, Aug 29, 2022
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** The Creator ID for the ACPI tables generated using
+  the standard ACPI table generators.
+*/
+#define TABLE_GENERATOR_CREATOR_ID_GENERIC  SIGNATURE_32('D', 'Y', 'N', 'T')
+
+#define SB_SCOPE  "\\_SB_"
+
+/** This macro expands to a function that retrieves the
+HPET base address from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArch,
+  EArchObjHpetBaseAddress,
+  CM_ARCH_HPET_BASE_ADDRESS
+  );
+
+/** Construct the SSDT HPET devices Table.
+
+  This function invokes the Configuration Manager protocol interface
+  to get the required hardware information for generating the ACPI
+  table if required.
+
+  If this function allocates any resources then they must be freed
+  in the FreeTableResources function.
+
+  @param [in]  This   Pointer to the table generator.
+  @param [

[edk2-devel] [RESEND PATCH v4 3/5] DynamicTablesPkg: Adds ACPI WSMT Table generator

2024-04-28 Thread Abdul Lateef Attar via groups.io
Adds generic ACPI WSMT table generator library.
Register/Deregister WSMT table.
Update the WSMT table during boot as per specification.

Cc: Sami Mujawar 
Cc: Pierre Gondois 
Signed-off-by: Abdul Lateef Attar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc|   2 +
 DynamicTablesPkg/Include/AcpiTableGenerator.h |   1 +
 .../Include/ArchNameSpaceObjects.h|  11 +
 .../Library/Acpi/AcpiWsmtLib/AcpiWsmtLib.inf  |  30 +++
 .../Library/Acpi/AcpiWsmtLib/WsmtGenerator.c  | 243 ++
 5 files changed, 287 insertions(+)
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/AcpiWsmtLib.inf
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/WsmtGenerator.c

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index b2ef36eb8a..477dc6b6a9 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -35,6 +35,7 @@
   #
   DynamicTablesPkg/Library/Acpi/AcpiFadtLib/AcpiFadtLib.inf
   DynamicTablesPkg/Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf
+  DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/AcpiWsmtLib.inf
 
 [Components.IA32, Components.X64]
   #
@@ -44,6 +45,7 @@
 
   NULL|DynamicTablesPkg/Library/Acpi/AcpiFadtLib/AcpiFadtLib.inf
   NULL|DynamicTablesPkg/Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf
+  NULL|DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/AcpiWsmtLib.inf
   }
 
 [Components.ARM, Components.AARCH64]
diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h 
b/DynamicTablesPkg/Include/AcpiTableGenerator.h
index 18b5f99f47..a32ef46ecb 100644
--- a/DynamicTablesPkg/Include/AcpiTableGenerator.h
+++ b/DynamicTablesPkg/Include/AcpiTableGenerator.h
@@ -100,6 +100,7 @@ typedef enum StdAcpiTableId {
   EStdAcpiTableIdSsdtPciExpress,///< SSDT Pci Express Generator
   EStdAcpiTableIdPcct,  ///< PCCT Generator
   EStdAcpiTableIdHpet,  ///< HPET Generator
+  EStdAcpiTableIdWsmt,  ///< WSMT Generator
   EStdAcpiTableIdMax
 } ESTD_ACPI_TABLE_ID;
 
diff --git a/DynamicTablesPkg/Include/ArchNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArchNameSpaceObjects.h
index b90e573a88..8b16056ba1 100644
--- a/DynamicTablesPkg/Include/ArchNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchNameSpaceObjects.h
@@ -40,6 +40,7 @@ typedef enum ArchObjectID {
   EArchObjFadtHypervisorVendorId, ///< 12 - Hypervisor vendor identity 
information
   EArchObjFadtMiscInfo,   ///< 13 - Legacy fields; RTC, latency, flush 
stride, etc
   EArchObjHpetBaseAddress,///< 14 - HPET Base Address
+  EArchObjWsmtProtectionFlags,///< 15 - WSMT protection flags
   EArchObjMax
 } E_ARCH_OBJECT_ID;
 
@@ -223,4 +224,14 @@ typedef struct CmArchFadtMiscInfo {
 typedef struct CmArchHpetBaseAddress {
   UINT64BaseAddress;
 } CM_ARCH_HPET_BASE_ADDRESS;
+
+/** A structure that describes the
+protection flags for the WSMT fields information.
+
+ID: EArchObjWsmtProtectionFlags
+*/
+typedef struct CmArchWsmtProtectionFlags {
+  UINT32ProtectionFlags;
+} CM_ARCH_WSMT_PROTECTION_FLAGS;
+
 #endif
diff --git a/DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/AcpiWsmtLib.inf 
b/DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/AcpiWsmtLib.inf
new file mode 100644
index 00..80ddaf0ab4
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/AcpiWsmtLib.inf
@@ -0,0 +1,30 @@
+## @file
+#  WSMT Table Generator
+#
+#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[Defines]
+  INF_VERSION= 1.27
+  BASE_NAME  = AcpiWsmtLib
+  FILE_GUID  = D6C34086-C914-4F8E-B56A-08329B4D1271
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiWsmtLibConstructor
+  DESTRUCTOR = AcpiWsmtLibDestructor
+
+[Sources]
+  WsmtGenerator.c
+
+[Packages]
+  DynamicTablesPkg/DynamicTablesPkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  BaseLib
+  DebugLib
+
diff --git a/DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/WsmtGenerator.c 
b/DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/WsmtGenerator.c
new file mode 100644
index 00..a63b4b4859
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/WsmtGenerator.c
@@ -0,0 +1,243 @@
+/** @file
+  WSMT Table Generator
+
+  Copyright (c) 2017 - 2023, Arm Limited. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+  - ACPI 6.5 Specification, Aug 29, 2022
+  - WSMT spec, version 1.0, April 18, 2016
+
https://msdn.microsoft.com/windows/hardware/drivers/bringup/acpi-system-description-tables#wsmt
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** The Creator ID for the ACPI tables generated using
+  the standard ACPI table generators.
+*/
+#define TABLE_GENE

[edk2-devel] [RESEND PATCH v4 0/5] DynamicTablesPkg: Adds FADT, HPET, WSMT and MADT Table generators

2024-04-28 Thread Abdul Lateef Attar via groups.io
PR: https://github.com/tianocore/edk2/pull/5500/
V4: delta changes
  Added X64 arch specific MADT table generator.
V3: delta changes
  Restructure the code as the review comments.
  Added sanity check for WSMT flags.
  Added CM object for HPET base address.
V2: delta changes
  Addressed review comments
  Adds ACPI HPET table to add HPET to ACPI namespace
V1:
Adds new space for ArchNameSpaceObjects.
Adds generic FADT table generator.
Adds generic HPET table generator.
Adds generic WSMT table generator.

Cc: Sami Mujawar 
Cc: Pierre Gondois 
Cc: Abdul Lateef Attar 

Abdul Lateef Attar (5):
  DynamicTablesPkg: Adds ACPI FADT Table generator
  DynamicTablesPkg: Adds ACPI HPET Table generator
  DynamicTablesPkg: Adds ACPI WSMT Table generator
  DynamicTablesPkg: Adds ACPI SSDT HPET Table generator
  DynamicTablesPkg: Adds X64 arch MADT Table generator

 DynamicTablesPkg/DynamicTables.dsc.inc|  22 +-
 DynamicTablesPkg/DynamicTablesPkg.ci.yaml |   4 +-
 DynamicTablesPkg/Include/AcpiTableGenerator.h |   4 +
 .../Include/ArchNameSpaceObjects.h| 237 ++
 .../Include/ConfigurationManagerObject.h  |   7 +
 .../Include/X64NameSpaceObjects.h |  48 ++
 .../Library/Acpi/AcpiFadtLib/AcpiFadtLib.inf  |  36 +
 .../Library/Acpi/AcpiFadtLib/Arm/FadtUpdate.c |  39 +
 .../Library/Acpi/AcpiFadtLib/FadtGenerator.c  | 745 ++
 .../Library/Acpi/AcpiFadtLib/FadtUpdate.h |  26 +
 .../Library/Acpi/AcpiFadtLib/X64/FadtUpdate.c |  32 +
 .../Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf  |  31 +
 .../Library/Acpi/AcpiHpetLib/HpetGenerator.c  | 246 ++
 .../Acpi/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf  |  32 +
 .../Acpi/AcpiSsdtHpetLib/SsdtHpetGenerator.c  | 295 +++
 .../Library/Acpi/AcpiWsmtLib/AcpiWsmtLib.inf  |  30 +
 .../Library/Acpi/AcpiWsmtLib/WsmtGenerator.c  | 243 ++
 .../X64/AcpiMadtLibX64/AcpiMadtLibX64.inf |  27 +
 .../Acpi/X64/AcpiMadtLibX64/MadtGenerator.c   | 375 +
 19 files changed, 2477 insertions(+), 2 deletions(-)
 create mode 100644 DynamicTablesPkg/Include/ArchNameSpaceObjects.h
 create mode 100644 DynamicTablesPkg/Include/X64NameSpaceObjects.h
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiFadtLib/AcpiFadtLib.inf
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiFadtLib/Arm/FadtUpdate.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiFadtLib/FadtGenerator.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiFadtLib/FadtUpdate.h
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiFadtLib/X64/FadtUpdate.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiHpetLib/HpetGenerator.c
 create mode 100644 
DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/AcpiSsdtHpetLib.inf
 create mode 100644 
DynamicTablesPkg/Library/Acpi/AcpiSsdtHpetLib/SsdtHpetGenerator.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/AcpiWsmtLib.inf
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiWsmtLib/WsmtGenerator.c
 create mode 100644 
DynamicTablesPkg/Library/Acpi/X64/AcpiMadtLibX64/AcpiMadtLibX64.inf
 create mode 100644 
DynamicTablesPkg/Library/Acpi/X64/AcpiMadtLibX64/MadtGenerator.c

-- 
2.34.1



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




[edk2-devel] [RESEND PATCH v4 1/5] DynamicTablesPkg: Adds ACPI FADT Table generator

2024-04-28 Thread Abdul Lateef Attar via groups.io
Adds generic ACPI FADT table generator library.
Register/Deregister FADT table.
Adds Arch namespace ids.
Update the FADT table during boot as per specification.

Cc: Sami Mujawar 
Cc: Pierre Gondois 
Signed-off-by: Abdul Lateef Attar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc|  10 +-
 DynamicTablesPkg/DynamicTablesPkg.ci.yaml |   4 +-
 .../Include/ArchNameSpaceObjects.h| 217 +
 .../Include/ConfigurationManagerObject.h  |   6 +
 .../Library/Acpi/AcpiFadtLib/AcpiFadtLib.inf  |  36 +
 .../Library/Acpi/AcpiFadtLib/Arm/FadtUpdate.c |  39 +
 .../Library/Acpi/AcpiFadtLib/FadtGenerator.c  | 745 ++
 .../Library/Acpi/AcpiFadtLib/FadtUpdate.h |  26 +
 .../Library/Acpi/AcpiFadtLib/X64/FadtUpdate.c |  32 +
 9 files changed, 1113 insertions(+), 2 deletions(-)
 create mode 100644 DynamicTablesPkg/Include/ArchNameSpaceObjects.h
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiFadtLib/AcpiFadtLib.inf
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiFadtLib/Arm/FadtUpdate.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiFadtLib/FadtGenerator.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiFadtLib/FadtUpdate.h
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiFadtLib/X64/FadtUpdate.c

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 19ca62d6a8..92f3a138e4 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -30,11 +30,19 @@
   #
   DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
 
+  #
+  # Generators
+  #
+  DynamicTablesPkg/Library/Acpi/AcpiFadtLib/AcpiFadtLib.inf
+
 [Components.IA32, Components.X64]
   #
   # Dynamic Table Factory Dxe
   #
-  DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf
+  DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {
+
+  NULL|DynamicTablesPkg/Library/Acpi/AcpiFadtLib/AcpiFadtLib.inf
+  }
 
 [Components.ARM, Components.AARCH64]
   #
diff --git a/DynamicTablesPkg/DynamicTablesPkg.ci.yaml 
b/DynamicTablesPkg/DynamicTablesPkg.ci.yaml
index 42829f393e..1ad5540e24 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.ci.yaml
+++ b/DynamicTablesPkg/DynamicTablesPkg.ci.yaml
@@ -128,7 +128,9 @@
"TABLEEX",
"TNSID",
"Vatos",
-   "WBINVD"
+   "WBINVD",
+   "NAMESPACEID",
+   "aswell"
],   # words to extend to the dictionary for this package
 "IgnoreStandardPaths": [],   # Standard Plugin defined paths that
  # should be ignore
diff --git a/DynamicTablesPkg/Include/ArchNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArchNameSpaceObjects.h
new file mode 100644
index 00..b421c4cd29
--- /dev/null
+++ b/DynamicTablesPkg/Include/ArchNameSpaceObjects.h
@@ -0,0 +1,217 @@
+/** @file
+  ARCH Name space object definations.
+
+  Defines namespace objects which are common across platform.
+  Platform can implements these optional namespace depends on
+  their requirements.
+
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+- Std or STD - Standard
+**/
+
+#ifndef ARCH_NAMESPACE_OBJECTS_H_
+#define ARCH_NAMESPACE_OBJECTS_H_
+
+#include 
+#include 
+
+/** The E_ARCH_OBJECT_ID enum describes the Object IDs
+in the ARCH Namespace
+*/
+typedef enum ArchObjectID {
+  EArchObjReserved,   ///<  0 - Reserved
+  EArchObjFadtPreferredPmProfile, ///<  1 - Preferred Power Management Profile 
Info
+  EArchObjFadtSciInterrupt,   ///<  2 - SCI Interrupt information
+  EArchObjFadtSciCmdInfo, ///<  3 - SCI CMD information
+  EArchObjFadtPmBlockInfo,///<  4 - Power management block info
+  EArchObjFadtGpeBlockInfo,   ///<  5 - GPE block info
+  EArchObjFadtXpmBlockInfo,   ///<  6 - 64-bit Power Management block info
+  EArchObjFadtXgpeBlockInfo,  ///<  7 - 64-bit GPE block info
+  EArchObjFadtSleepBlockInfo, ///<  8 - SLEEP block info
+  EArchObjFadtResetBlockInfo, ///<  9 - Reset block info
+  EArchObjFadtFlags,  ///< 10 - FADT flags
+  EArchObjFadtArmBootArch,///< 11 - ARM boot arch information
+  EArchObjFadtHypervisorVendorId, ///< 12 - Hypervisor vendor identity 
information
+  EArchObjFadtMiscInfo,   ///< 13 - Legacy fields; RTC, latency, flush 
stride, etc
+  EArchObjMax
+} E_ARCH_OBJECT_ID;
+
+/** A structure that describes the
+Power Management Profile Information for the Platform.
+
+ID: EArchObjFadtPreferredPmProfile
+*/
+typedef struct CmArchPreferredPmProfile {
+  /** This is the Preferred_PM_Profile field of the FADT Table
+  described in the ACPI Specification
+  */
+  UINT8PreferredPmProfile;
+} CM_ARCH_FADT_PREFERRED_PM_PROFILE;
+
+/** A structure that describes the

[edk2-devel] [RESEND PATCH v4 2/5] DynamicTablesPkg: Adds ACPI HPET Table generator

2024-04-28 Thread Abdul Lateef Attar via groups.io
Adds generic ACPI HPET table generator library.
Register/Deregister HPET table.
Update the HPET table during boot as per specification.

Cc: Sami Mujawar 
Cc: Pierre Gondois 
Signed-off-by: Abdul Lateef Attar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc|   2 +
 DynamicTablesPkg/Include/AcpiTableGenerator.h |   1 +
 .../Include/ArchNameSpaceObjects.h|   9 +
 .../Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf  |  31 +++
 .../Library/Acpi/AcpiHpetLib/HpetGenerator.c  | 246 ++
 5 files changed, 289 insertions(+)
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf
 create mode 100644 DynamicTablesPkg/Library/Acpi/AcpiHpetLib/HpetGenerator.c

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 92f3a138e4..b2ef36eb8a 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -34,6 +34,7 @@
   # Generators
   #
   DynamicTablesPkg/Library/Acpi/AcpiFadtLib/AcpiFadtLib.inf
+  DynamicTablesPkg/Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf
 
 [Components.IA32, Components.X64]
   #
@@ -42,6 +43,7 @@
   DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {
 
   NULL|DynamicTablesPkg/Library/Acpi/AcpiFadtLib/AcpiFadtLib.inf
+  NULL|DynamicTablesPkg/Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf
   }
 
 [Components.ARM, Components.AARCH64]
diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h 
b/DynamicTablesPkg/Include/AcpiTableGenerator.h
index d0eda011c3..18b5f99f47 100644
--- a/DynamicTablesPkg/Include/AcpiTableGenerator.h
+++ b/DynamicTablesPkg/Include/AcpiTableGenerator.h
@@ -99,6 +99,7 @@ typedef enum StdAcpiTableId {
   EStdAcpiTableIdSsdtCpuTopology,   ///< SSDT Cpu Topology
   EStdAcpiTableIdSsdtPciExpress,///< SSDT Pci Express Generator
   EStdAcpiTableIdPcct,  ///< PCCT Generator
+  EStdAcpiTableIdHpet,  ///< HPET Generator
   EStdAcpiTableIdMax
 } ESTD_ACPI_TABLE_ID;
 
diff --git a/DynamicTablesPkg/Include/ArchNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArchNameSpaceObjects.h
index b421c4cd29..b90e573a88 100644
--- a/DynamicTablesPkg/Include/ArchNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchNameSpaceObjects.h
@@ -39,6 +39,7 @@ typedef enum ArchObjectID {
   EArchObjFadtArmBootArch,///< 11 - ARM boot arch information
   EArchObjFadtHypervisorVendorId, ///< 12 - Hypervisor vendor identity 
information
   EArchObjFadtMiscInfo,   ///< 13 - Legacy fields; RTC, latency, flush 
stride, etc
+  EArchObjHpetBaseAddress,///< 14 - HPET Base Address
   EArchObjMax
 } E_ARCH_OBJECT_ID;
 
@@ -214,4 +215,12 @@ typedef struct CmArchFadtMiscInfo {
   UINT8 Century;
 } CM_ARCH_FADT_MISC_INFO;
 
+/** A structure that describes the
+HPET Base Address.
+
+ID: EArchObjHpetBaseAddress
+*/
+typedef struct CmArchHpetBaseAddress {
+  UINT64BaseAddress;
+} CM_ARCH_HPET_BASE_ADDRESS;
 #endif
diff --git a/DynamicTablesPkg/Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf 
b/DynamicTablesPkg/Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf
new file mode 100644
index 00..f0441107fc
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/AcpiHpetLib/AcpiHpetLib.inf
@@ -0,0 +1,31 @@
+## @file
+#  HPET Table Generator
+#
+#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[Defines]
+  INF_VERSION= 1.27
+  BASE_NAME  = AcpiHpetLib
+  FILE_GUID  = 4E75F653-C356-48B3-B32C-D1B901ECF90A
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiHpetLibConstructor
+  DESTRUCTOR = AcpiHpetLibDestructor
+
+[Sources]
+  HpetGenerator.c
+
+[Packages]
+  DynamicTablesPkg/DynamicTablesPkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  BaseLib
+  DebugLib
+  IoLib
+
diff --git a/DynamicTablesPkg/Library/Acpi/AcpiHpetLib/HpetGenerator.c 
b/DynamicTablesPkg/Library/Acpi/AcpiHpetLib/HpetGenerator.c
new file mode 100644
index 00..937879b7b3
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/AcpiHpetLib/HpetGenerator.c
@@ -0,0 +1,246 @@
+/** @file
+  HPET Table Generator
+
+  Copyright (c) 2017 - 2023, Arm Limited. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+  - ACPI 6.5 Specification, Aug 29, 2022
+  - HPET spec, version 1.0a
+
http://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/software-developers-hpet-spec-1-0a.pdf
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+///
+/// HPET General Register Offsets
+///
+#define HPET_GENERAL_CAPABILITIES_ID_OFFSET  0x000
+
+/** The Creator ID for the ACPI tables generated using
+  the standard ACPI table generators.
+*/
+#define TABL

[edk2-devel] [PATCH v1] Maintainers.txt: Update StandaloneMmPkg and UefiCpuPkg Reviewer

2024-04-28 Thread Wu, Jiaxin
This is to update StandaloneMmPkg and UefiCpuPkg Reviewer.

Cc: Ray Ni 
Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
Cc: Rahul Kumar 
Cc: Gerd Hoffmann 
Signed-off-by: Jiaxin Wu 
---
 Maintainers.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index 7d9cdca611..6fccbb6788 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -624,17 +624,19 @@ W: 
https://github.com/tianocore/tianocore.github.io/wiki/SourceLevelDebugPkg
 StandaloneMmPkg
 F: StandaloneMmPkg/
 M: Ard Biesheuvel  [ardbiesheuvel]
 M: Sami Mujawar  [samimujawar]
 M: Ray Ni  [niruiyu]
+R: Jiaxin Wu  [jiaxinwu]
 
 UefiCpuPkg
 F: UefiCpuPkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/UefiCpuPkg
 M: Ray Ni  [niruiyu]
 R: Rahul Kumar  [rahul1-kumar]
 R: Gerd Hoffmann  [kraxel]
+R: Jiaxin Wu  [jiaxinwu]
 
 UefiCpuPkg: Sec related modules
 F: UefiCpuPkg/SecCore/
 F: UefiCpuPkg/ResetVector/
 R: Catharine West  [catharine-intl]
-- 
2.16.2.windows.1



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




[edk2-devel] [PATCH v1] UefiCpuPkg/Library: Cleanup debug message in LmceSupport

2024-04-28 Thread Wu, Jiaxin
ProcessorNumber 0 is not always BSP. Debug message based on 0
of ProcessorNumber is incorrect.

This patch is to clean the debug message in LmceSupport
directly.

Cc: Ray Ni 
Cc: Zeng Star 
Cc: Gerd Hoffmann 
Cc: Rahul Kumar 
Signed-off-by: Jiaxin Wu 
---
 UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c 
b/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c
index d8b070d9f1..cb569769a1 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c
@@ -1,9 +1,9 @@
 /** @file
   Machine Check features.
 
-  Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
+  Copyright (c) 2017 - 2024, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
 #include "CpuCommonFeatures.h"
@@ -287,13 +287,10 @@ LmceSupport (
   if (!McaSupport (ProcessorNumber, CpuInfo, ConfigData)) {
 return FALSE;
   }
 
   McgCap.Uint64 = AsmReadMsr64 (MSR_IA32_MCG_CAP);
-  if (ProcessorNumber == 0) {
-DEBUG ((DEBUG_INFO, "LMCE enable = %x\n", (BOOLEAN)(McgCap.Bits.MCG_LMCE_P 
!= 0)));
-  }
 
   return (BOOLEAN)(McgCap.Bits.MCG_LMCE_P != 0);
 }
 
 /**
-- 
2.16.2.windows.1



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




[edk2-devel] [PATCH v1] UefiCpuPkg/Library: Cleanup debug message in LmceSupport

2024-04-28 Thread Wu, Jiaxin
ProcessorNumber 0 is not always BSP. Debug message based on 0
of ProcessorNumber is incorrect.

This patch is to clean the debug message in LmceSupport
directly.

Cc: Ray Ni 
Cc: Zeng Star 
Cc: Gerd Hoffmann 
Cc: Rahul Kumar 
Signed-off-by: Jiaxin Wu 
---
 UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c 
b/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c
index d8b070d9f1..cb569769a1 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c
@@ -1,9 +1,9 @@
 /** @file
   Machine Check features.
 
-  Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
+  Copyright (c) 2017 - 2024, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
 #include "CpuCommonFeatures.h"
@@ -287,13 +287,10 @@ LmceSupport (
   if (!McaSupport (ProcessorNumber, CpuInfo, ConfigData)) {
 return FALSE;
   }
 
   McgCap.Uint64 = AsmReadMsr64 (MSR_IA32_MCG_CAP);
-  if (ProcessorNumber == 0) {
-DEBUG ((DEBUG_INFO, "LMCE enable = %x\n", (BOOLEAN)(McgCap.Bits.MCG_LMCE_P 
!= 0)));
-  }
 
   return (BOOLEAN)(McgCap.Bits.MCG_LMCE_P != 0);
 }
 
 /**
-- 
2.16.2.windows.1



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




[edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg: Remove the dependency with MinPlatform

2024-04-28 Thread Chang, Abner via groups.io
From: Abner Chang 

BZ# 4695

Signed-off-by: Abner Chang 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
---
 .../ManageabilityPkg/ManageabilityPkg.dsc | 72 ++-
 1 file changed, 56 insertions(+), 16 deletions(-)

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index 87b32f1182..8608450a3b 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -3,7 +3,7 @@
 # This is the package provides edk2 drivers and libraries
 # those are related to the platform management.
 #
-# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -18,15 +18,7 @@
   BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
   SKUID_IDENTIFIER   = DEFAULT
 
-[Packages]
-  MinPlatformPkg/MinPlatformPkg.dec
-
 [PcdsFeatureFlag]
-  #
-  # MinPlatform common include currently required PCD
-  #
-  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable   
|FALSE
-  gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable  
|FALSE
 
   #
   # Manageability modules
@@ -45,19 +37,67 @@
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityPeiIpmiFrb 
|TRUE
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiBmcAcpi 
|TRUE
 
-#
-# Include common libraries
-#
-!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
-!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
-!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
-
 [Components]
   
ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
   
ManageabilityPkg/Library/ManageabilityTransportMctpLib/Dxe/DxeManageabilityTransportMctp.inf
   ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf
   ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLib.inf
 
+  #
+  # Generic EDKII Lib
+  #
+
+!include MdePkg/MdeLibs.dsc.inc
+
+[LibraryClasses.common]
+
+  #
+  # Entry point
+  #
+  
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
+  PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
+  #
+  # Basic
+  #
+  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
+  BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
+  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
+  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
+  #
+  # UEFI & PI
+  #
+  
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
+  
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
+  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
+  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
+  
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
+  PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
+  DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
+  
DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
+  #
+  # Misc
+  #
+  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+  
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
+  
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
+  
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
+  
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
+
+[LibraryClasses.common.DXE_SMM_DRIVER]
+  
SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
+  MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf
+  
ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf
+  
MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
+
+[LibraryClasses.common.SEC, LibraryClasses.common.PEI_CORE, 
LibraryClasses.common.PEIM]
+  
S3BootScriptLib|MdePkg/Library/BaseS3BootScriptLibNull/BaseS3BootScriptLibNull.inf
+  PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
+  HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
+  
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
+  
ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
+  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibBase.inf
+
 [LibraryClasses]
   
ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
   IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
-- 
2.37.1.windows.1



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

[edk2-devel] [PATCH v1 2/2] IntelFsp2WrapperPkg/FspmWrapperPeim: Migrate FspT/M to permanent memory

2024-04-28 Thread Li, Zhihao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4716

Migrate FSP-T/M binary from temporary RAM to permanent RAM before NEM
tear down. Tcg module will use permanent address of FSP-T/M for
measurement.
1. PeiCore installs mMigrateTempRamPpi if
PcdMigrateTemporaryRamFirmwareVolumes is True
2. FspmWrapperPeim migrate FspT/M binary to permanent
memory and build MigatedFvInfoHob
3. TCG notification checks MigatedFvInfoHob and transmits
DRAM address for measurement

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Duggapu Chinni B 
Cc: Chen Gang C 
Cc: Liming Gao 

Signed-off-by: Zhihao Li 
---
 IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c   | 181 
+++-
 IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf |   4 +-
 2 files changed, 177 insertions(+), 8 deletions(-)

diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
index 7f1deb95426f..101514ee4d17 100644
--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
@@ -3,7 +3,7 @@
   register TemporaryRamDonePpi to call TempRamExit API, and register 
MemoryDiscoveredPpi
   notify to call FspSiliconInit API.
 
-  Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2024, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -33,14 +33,19 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 extern EFI_GUID  gFspHobGuid;
 
+#define FSP_MIGRATED_FSPT  BIT0
+#define FSP_MIGRATED_FSPM  BIT1
+
 /**
   Get the FSP M UPD Data address
 
@@ -260,6 +265,30 @@ EFI_PEI_NOTIFY_DESCRIPTOR  mTcgPpiNotifyDesc = {
   TcgPpiNotify
 };
 
+/**
+  This function is called after temporary ram migration.
+
+  @param[in] PeiServicesPointer to PEI Services Table.
+  @param[in] NotifyDesc Pointer to the descriptor for the Notification 
event that
+caused this function to execute.
+  @param[in] PpiPointer to the PPI data associated with this 
function.
+
+  @retval EFI_STATUSAlways return EFI_SUCCESS
+**/
+EFI_STATUS
+EFIAPI
+MigrateTempRamNotify (
+  IN EFI_PEI_SERVICES   **PeiServices,
+  IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyDesc,
+  IN VOID   *Ppi
+  );
+
+EFI_PEI_NOTIFY_DESCRIPTOR  mMigrateTempRamNotifyDesc = {
+  (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | 
EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+  &gEdkiiPeiMigrateTempRamPpiGuid,
+  MigrateTempRamNotify
+};
+
 /**
   This function is called after TCG installed PPI.
 
@@ -278,18 +307,41 @@ TcgPpiNotify (
   IN VOID   *Ppi
   )
 {
-  UINT32  FspMeasureMask;
+  UINT32  FspMeasureMask;
+  EFI_PHYSICAL_ADDRESSFsptBaseAddress;
+  EFI_PHYSICAL_ADDRESSFspmBaseAddress;
+  EDKII_MIGRATED_FV_INFO  *MigratedFvInfo;
+  EFI_PEI_HOB_POINTERSHob;
 
   DEBUG ((DEBUG_INFO, "TcgPpiNotify FSPM\n"));
 
-  FspMeasureMask = PcdGet32 (PcdFspMeasurementConfig);
+  FspMeasureMask  = PcdGet32 (PcdFspMeasurementConfig);
+  FsptBaseAddress = (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdFsptBaseAddress);
+  FspmBaseAddress = (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdFspmBaseAddress);
+  Hob.Raw = GetFirstGuidHob (&gEdkiiMigratedFvInfoGuid);
+  while (Hob.Raw != NULL) {
+MigratedFvInfo = GET_GUID_HOB_DATA (Hob);
+if ((MigratedFvInfo->FvOrgBase == (UINT32)(UINTN)PcdGet32 
(PcdFsptBaseAddress)) && (MigratedFvInfo->FvDataBase != 0)) {
+  //
+  // Found the migrated FspT raw data
+  //
+  FsptBaseAddress = MigratedFvInfo->FvDataBase;
+}
+
+if ((MigratedFvInfo->FvOrgBase == (UINT32)(UINTN)PcdGet32 
(PcdFspmBaseAddress)) && (MigratedFvInfo->FvDataBase != 0)) {
+  FspmBaseAddress = MigratedFvInfo->FvDataBase;
+}
+
+Hob.Raw = GET_NEXT_HOB (Hob);
+Hob.Raw = GetNextGuidHob (&gEdkiiMigratedFvInfoGuid, Hob.Raw);
+  }
 
   if ((FspMeasureMask & FSP_MEASURE_FSPT) != 0) {
 MeasureFspFirmwareBlob (
   0,
   "FSPT",
-  PcdGet32 (PcdFsptBaseAddress),
-  (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 
(PcdFsptBaseAddress))->FvLength
+  FsptBaseAddress,
+  (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FsptBaseAddress)->FvLength
   );
   }
 
@@ -297,14 +349,126 @@ TcgPpiNotify (
 MeasureFspFirmwareBlob (
   0,
   "FSPM",
-  PcdGet32 (PcdFspmBaseAddress),
-  (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 
(PcdFspmBaseAddress))->FvLength
+  FspmBaseAddress,
+  (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FspmBaseAddress)->FvLength
   );
   }
 
   return EFI_SUCCESS;
 }
 
+/**
+  This function is called after temporary ram migration.
+
+  @param[in] PeiServicesPointer to PEI Services Table.
+  @param[in] NotifyDesc Pointer to the descriptor for the Notification 
event that
+caused this function to execute.
+  @pa

[edk2-devel] [PATCH v1 1/2] MdeModulePkg/Core/Pei: Install MigrateTempRamPpi

2024-04-28 Thread Li, Zhihao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4716

Migrate FSP-T/M binary from temporary RAM to permanent RAM before NEM
tear down. Tcg module will use permanent address of FSP-T/M for
measurement.
1. PeiCore installs mMigrateTempRamPpi if
PcdMigrateTemporaryRamFirmwareVolumes is True
2. FspmWrapperPeim migrate FspT/M binary to permanent
memory and build MigatedFvInfoHob
3. TCG notification checks MigatedFvInfoHob and transmits
DRAM address for measurement

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Duggapu Chinni B 
Cc: Chen Gang C 
Cc: Liming Gao 

Signed-off-by: Zhihao Li 
---
 MdeModulePkg/Core/Pei/PeiMain/PeiMain.c| 10 -
 MdeModulePkg/Core/Pei/PeiMain.h|  3 ++-
 MdeModulePkg/Core/Pei/PeiMain.inf  |  3 ++-
 MdeModulePkg/Include/Guid/MigratedFvInfo.h |  4 ++--
 MdeModulePkg/Include/Ppi/MigrateTempRam.h  | 23 
 MdeModulePkg/MdeModulePkg.dec  |  5 -
 6 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c 
b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
index bf1719d7941a..0e3d9a843816 100644
--- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
+++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
@@ -1,7 +1,7 @@
 /** @file
   Pei Core Main Entry Point
 
-Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2024, Intel Corporation. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -13,6 +13,11 @@ EFI_PEI_PPI_DESCRIPTOR  mMemoryDiscoveredPpi = {
   &gEfiPeiMemoryDiscoveredPpiGuid,
   NULL
 };
+EFI_PEI_PPI_DESCRIPTOR  mMigrateTempRamPpi = {
+  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+  &gEdkiiPeiMigrateTempRamPpiGuid,
+  NULL
+};
 
 ///
 /// Pei service instance
@@ -449,6 +454,9 @@ PeiCore (
   //
   EvacuateTempRam (&PrivateData, SecCoreData);
 
+  Status = PeiServicesInstallPpi (&mMigrateTempRamPpi);
+  ASSERT_EFI_ERROR (Status);
+
   DEBUG ((DEBUG_VERBOSE, "PPI lists after temporary RAM evacuation:\n"));
   DumpPpiList (&PrivateData);
 }
diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h
index 46b6c23014a3..8df0c2d561f7 100644
--- a/MdeModulePkg/Core/Pei/PeiMain.h
+++ b/MdeModulePkg/Core/Pei/PeiMain.h
@@ -1,7 +1,7 @@
 /** @file
   Definition of Pei Core Structures and Services
 
-Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2024, Intel Corporation. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -26,6 +26,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf 
b/MdeModulePkg/Core/Pei/PeiMain.inf
index 893bdc052798..4e545ddab2ab 100644
--- a/MdeModulePkg/Core/Pei/PeiMain.inf
+++ b/MdeModulePkg/Core/Pei/PeiMain.inf
@@ -6,7 +6,7 @@
 # 2) Dispatch PEIM from discovered FV.
 # 3) Handoff control to DxeIpl to load DXE core and enter DXE phase.
 #
-# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2024, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -101,6 +101,7 @@
   gEfiPeiReset2PpiGuid  ## SOMETIMES_CONSUMES
   gEfiSecHobDataPpiGuid ## SOMETIMES_CONSUMES
   gEfiPeiCoreFvLocationPpiGuid  ## SOMETIMES_CONSUMES
+  gEdkiiPeiMigrateTempRamPpiGuid## PRODUCES
 
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize  ## 
CONSUMES
diff --git a/MdeModulePkg/Include/Guid/MigratedFvInfo.h 
b/MdeModulePkg/Include/Guid/MigratedFvInfo.h
index 1c8b0dfefc49..255e278235b1 100644
--- a/MdeModulePkg/Include/Guid/MigratedFvInfo.h
+++ b/MdeModulePkg/Include/Guid/MigratedFvInfo.h
@@ -1,7 +1,7 @@
 /** @file
   Migrated FV information
 
-Copyright (c) 2020, Intel Corporation. All rights reserved.
+Copyright (c) 2020 - 2024, Intel Corporation. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -50,7 +50,7 @@ typedef struct {
 
 typedef struct {
   UINT32FvOrgBase; // original FV address
-  UINT32FvNewBase; // new FV address
+  UINT32FvNewBase; // new FV address, 0 means rebased data is not 
copied
   UINT32FvDataBase;// original FV data, 0 means raw data is not 
copied
   UINT32FvLength;  // Fv Length
 } EDKII_MIGRATED_FV_INFO;
diff --git a/MdeModulePkg/Include/Ppi/MigrateTempRam.h 
b/MdeModulePkg/Include/Ppi/MigrateTempRam.h
new file mode 100644
index ..9bbb55d5cf86
--- /dev/null
+++ b/MdeModulePkg/Include/Ppi/MigrateTempRam.h
@@ -0,0 +1,23 @@
+/** @file
+  This file declares Migrate Temporary Memory PPI.
+
+  This PPI is published by the PEI Foundation when temporary RAM needs to 
evacuate.
+  Its purpose is to be used as a signal for other PEIMs who can register for a
+  notification on its installation.

Re: [edk2-devel] [PATCH v1] Add MmUnblockMemoryLib to MdeLibs.dsc

2024-04-28 Thread Wu, Jiaxin
Reviewed-by: Jiaxin Wu 


> -Original Message-
> From: Zhang, Hongbin1 
> Sent: Monday, April 29, 2024 11:08 AM
> To: devel@edk2.groups.io
> Cc: Zhang, Hongbin1 ; Kinney, Michael D
> ; Ni, Ray ; Liming Gao
> ; Liu, Zhiguang ; Wu,
> Jiaxin ; Xie, Yuanhao 
> Subject: [PATCH v1] Add MmUnblockMemoryLib to MdeLibs.dsc
> 
> It is for unblocking certain data pages to be accessible inside MM environment
> 
> Cc: Michael D Kinney 
> Cc: Ray Ni 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Jiaxin Wu 
> Cc: Yuanhao Xie 
> ---
>  MdePkg/MdeLibs.dsc.inc | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/MdePkg/MdeLibs.dsc.inc b/MdePkg/MdeLibs.dsc.inc
> index d782dbf4ff..ddd27115f5 100644
> --- a/MdePkg/MdeLibs.dsc.inc
> +++ b/MdePkg/MdeLibs.dsc.inc
> @@ -5,7 +5,7 @@
>  # by using "!include MdePkg/MdeLibs.dsc.inc" to specify the library instances
>  # of some EDKII basic/common library classes.
>  #
> -# Copyright (c) 2021 - 2022, Intel Corporation. All rights reserved.
> +# Copyright (c) 2021 - 2024, Intel Corporation. All rights reserved.
>  #
>  #SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -18,3 +18,4 @@
> 
> SmmCpuRendezvousLib|MdePkg/Library/SmmCpuRendezvousLibNull/SmmC
> puRendezvousLibNull.inf
>SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
> 
> SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchroniz
> ationLib.inf
> +
> MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblo
> ckMemoryLibNull.inf
> --
> 2.37.0.windows.1



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




Re: [edk2-devel] [PATCH v4 0/8] Adjust the QemuFwCfgLibMmio and add PEI stage

2024-04-28 Thread Chao Li

Hi Ard and Gerd and other maintainers,

Could you review this version and give your suggestions?


Thanks,
Chao
On 2024/4/26 16:28, Chao Li wrote:

Patch1: Added three PCDs for QemuFwCfgLibMmio
Patch2: Sparate QemuFwCfgLibMmio.c into two files and default as DXE
stage library.
Patch3: Added QemuFwCfgMmiLib PEI version
Patch4: Rename QemuFwCfgLibMmio.inf to QemuFwCfgMmioDxeLib.inf and
enable it in AARCH64 and RISCV64.

V1 -> V2:
1. Use HOBs instead of PCD.
2. The old patch2 is divided into two parts, one is code splitting, and
the other is functional changes.
3. add two patches to keep the safe when change the platform DSC file.

V2 -> V3:
1. Merge three HOBs into a single HOB.
2. Remove the dynamic global variables in PEI.

V3 -> V4:
1. Adjust the HOB content, this version saves all of structual contents
in HOB.
2. Remove the Loongson copyright in separation patch, and add it in the
funciton change patch.
3. Restored some variables as static in DXE version.
4. Added the HOB GUID in OvmfPkg.dec.

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

PR:https://github.com/tianocore/edk2/pull/5568

Cc: Ard Biesheuvel
Cc: Jiewen Yao
Cc: Gerd Hoffmann
Cc: Leif Lindholm
Cc: Sami Mujawar
Cc: Sunil V L
Cc: Andrei Warkentin

Chao Li (8):
   OvmfPkg: Add a GUID for QemuFwCfgLib
   OvmfPkg: Separate QemuFwCfgLibMmio.c into two files
   OvmfPkg: Add the way of HOBs in QemuFwCfgLibMmio
   OvmfPkg: Add the QemuFwCfgMmioLib PEI stage version
   OvmfPkg: Copy the same new INF as QemuFwCfgLibMmio.inf
   ArmVirtPkg: Enable QemuFwCfgMmioDxeLib.inf
   OvmfPkg/RiscVVirt: Enable QemuFwCfgMmioDxeLib.inf
   OvmfPkg: Remove QemuFwCfgLibMmio.inf

  ArmVirtPkg/ArmVirtQemu.dsc|   2 +-
  ArmVirtPkg/ArmVirtQemuKernel.dsc  |   2 +-
  .../Library/QemuFwCfgLib/QemuFwCfgLibMmio.c   | 243 +
  .../QemuFwCfgLib/QemuFwCfgLibMmioInternal.h   | 244 ++
  .../Library/QemuFwCfgLib/QemuFwCfgMmioDxe.c   | 214 +++
  ...CfgLibMmio.inf => QemuFwCfgMmioDxeLib.inf} |   8 +-
  .../Library/QemuFwCfgLib/QemuFwCfgMmioPei.c   | 235 +
  .../QemuFwCfgLib/QemuFwCfgMmioPeiLib.inf  |  52 
  OvmfPkg/OvmfPkg.dec   |   1 +
  OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc   |   2 +-
  10 files changed, 814 insertions(+), 189 deletions(-)
  create mode 100644 OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmioInternal.h
  create mode 100644 OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgMmioDxe.c
  rename OvmfPkg/Library/QemuFwCfgLib/{QemuFwCfgLibMmio.inf => 
QemuFwCfgMmioDxeLib.inf} (78%)
  create mode 100644 OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgMmioPei.c
  create mode 100644 OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgMmioPeiLib.inf




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




[edk2-devel] 回复: [PATCH v6 3/4] MdePkg: Adding support for EFI_CONFORMANCE_PROFILE_TABLE

2024-04-28 Thread gaoliming via groups.io
Sam:
  I don't find EFI_CONFORMANCE_PROFILE_EBBR_2_1_GUID definition in UEFI 2.10
spec. So, what's its definition from?

Thanks
Liming
> -邮件原件-
> 发件人: Sam Kaynor 
> 发送时间: 2024年4月27日 1:53
> 收件人: devel@edk2.groups.io
> 抄送: Michael D Kinney ; Liming Gao
> ; Zhiguang Liu 
> 主题: [PATCH v6 3/4] MdePkg: Adding support for
> EFI_CONFORMANCE_PROFILE_TABLE
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352
> 
> Adding support for EFI_CONFORMANCE_PROFILE_TABLE by adding an
> associated header file and relevant GUIDs to MdePkg.dec as defined
> in the UEFI 2.10 spec.
> This table is needed to address changes being made within ShellPkg.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Signed-off-by: Sam Kaynor 
> ---
> 
> Notes:
> v6:
> - Added patch to address MdePkg changes separately
> 
>  MdePkg/MdePkg.dec |  5 ++
>  MdePkg/Include/Guid/ConformanceProfiles.h | 56 
>  2 files changed, 61 insertions(+)
> 
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> index bf94549cbfbd..2c053a7459f3 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -746,6 +746,11 @@ [Guids]
>## Include/Guid/DeviceAuthentication.h
>gEfiDeviceSignatureDatabaseGuid  = { 0xb9c2b4f4, 0xbf5f, 0x462d, {0x8a,
> 0xdf, 0xc5, 0xc7, 0xa, 0xc3, 0x5d, 0xad }}
> 
> +  ## Include/Guid/ConformanceProfiles.h
> +  gEfiConfProfilesTableGuid= { 0x36122546, 0xf7e7, 0x4c8f, {
0xbd,
> 0x9b, 0xeb, 0x85, 0x25, 0xb5, 0x0c, 0x0b }}
> +  gEfiConfProfilesUefiSpecGuid = { 0x523c91af, 0xa195, 0x4382, {
0x81,
> 0x8d, 0x29, 0x5f, 0xe4, 0x00, 0x64, 0x65 }}
> +  gEfiConfProfilesEbbrSpecGuid = { 0xcce33c35, 0x74ac, 0x4087,
> { 0xbc, 0xe7, 0x8b, 0x29, 0xb0, 0x2e, 0xeb, 0x27 }}
> +
>#
># GUID defined in PI1.0
>#
> diff --git a/MdePkg/Include/Guid/ConformanceProfiles.h
> b/MdePkg/Include/Guid/ConformanceProfiles.h
> new file mode 100644
> index ..c6211d63d79c
> --- /dev/null
> +++ b/MdePkg/Include/Guid/ConformanceProfiles.h
> @@ -0,0 +1,56 @@
> +/** @file
> +  Legal information
> +
> +**/
> +
> +#ifndef __CONFORMANCE_PROFILES_TABLE_GUID_H__
> +#define __CONFORMANCE_PROFILES_TABLE_GUID_H__
> +
> +
> +//
> +// This table allows the platform to advertise its UEFI specification
> conformance
> +// in the form of pre-defined profiles. Each profile is identified by a
GUID,
> with
> +// known profiles listed in the section below.
> +// The absence of this table shall indicate that the platform
implementation
> is
> +// conformant with the UEFI specification requirements, as defined in
> Section 2.6.
> +// This is equivalent to publishing this configuration table with the
> +// EFI_CONFORMANCE_PROFILES_UEFI_SPEC_GUID conformance profile.
> +//
> +#define EFI_CONFORMANCE_PROFILES_TABLE_GUID \
> +  { \
> +0x36122546, 0xf7e7, 0x4c8f, { 0xbd, 0x9b, 0xeb, 0x85, 0x25, 0xb5,
0x0c,
> 0x0b } \
> +  }
> +
> +#pragma pack(1)
> +
> +typedef struct {
> +  ///
> +  /// Version of the table must be 0x1
> +  ///
> +  UINT16 Version;
> +  ///
> +  /// The number of profiles GUIDs present in ConformanceProfiles
> +  ///
> +  UINT16 NumberOfProfiles;
> +  ///
> +  /// An array of conformance profile GUIDs that are supported by this
> system.
> +  /// EFI_GUIDConformanceProfiles[];
> +  ///
> +} EFI_CONFORMANCE_PROFILES_TABLE;
> +
> +#define EFI_CONFORMANCE_PROFILES_TABLE_VERSION 0x1
> +
> +//
> +// GUID defined in spec.
> +//
> +#define EFI_CONFORMANCE_PROFILES_UEFI_SPEC_GUID \
> +{ 0x523c91af, 0xa195, 0x4382, \
> +{ 0x81, 0x8d, 0x29, 0x5f, 0xe4, 0x00, 0x64, 0x65 }}
> +#define EFI_CONFORMANCE_PROFILE_EBBR_2_1_GUID \
> +{ 0xcce33c35, 0x74ac, 0x4087, \
> +{ 0xbc, 0xe7, 0x8b, 0x29, 0xb0, 0x2e, 0xeb, 0x27 }}
> +
> +extern EFI_GUID  gEfiConfProfilesTableGuid;
> +extern EFI_GUID  gEfiConfProfilesUefiSpecGuid;
> +
> +#endif
> --
> 2.34.1





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118360): https://edk2.groups.io/g/devel/message/118360
Mute This Topic: https://groups.io/mt/105793166/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] Subject: [PATCH] MdePkg:Added new SPCR table stucture members as in Rev4.

2024-04-28 Thread gaoliming via groups.io
Praveen:
  I want to know what will happen if the platform doesn't make changes with the 
updated table. 

  According to its impact, we can make direction how and when to merge this 
patch. 

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Praveen
> Sankar N via groups.io
> 发送时间: 2024年4月26日 12:58
> 收件人: gaoliming ; devel@edk2.groups.io
> 抄送: michael.d.kin...@intel.com; zhiguang@intel.com; Felix Polyudov
> ; Srinivasan Mani ; Sundaresan S
> 
> 主题: Re: [edk2-devel] 回复: [PATCH v2 1/1] Subject: [PATCH]
> MdePkg:Added new SPCR table stucture members as in Rev4.
> 
> Hi Liming,
> I am about to resubmit the patch with the changes in the files
> SpcrGenerator.c and Spcr.aslc which are consuming the SPCR structure from
> SerialPortConsoleRedirectionTable.h file and these files seemingly initializes
> the SPCR structure members. So please let me know about your opinion on
> this and I think you mean the incompatible change as these files are affected
> with the initial patch.
> 
> Thanks,
> Praveen Sankar N
> 
> -Original Message-
> From: gaoliming 
> Sent: Tuesday, April 23, 2024 6:47 PM
> To: Praveen Sankar N ; devel@edk2.groups.io
> Cc: michael.d.kin...@intel.com; zhiguang@intel.com; Felix Polyudov
> ; Srinivasan Mani ; Sundaresan S
> 
> Subject: [EXTERNAL] 回复: [PATCH v2 1/1] Subject: [PATCH] MdePkg:Added
> new SPCR table stucture members as in Rev4.
> 
> 
> **CAUTION: The e-mail below is from an external source. Please exercise
> caution before opening attachments, clicking links, or following guidance.**
> 
> Seemly, this is an incompatible change. What's impact with this change?
> 
> Thanks
> Liming
> > -邮件原件-
> > 发件人: Praveen Sankar N 
> > 发送时间: 2024年4月22日 19:26
> > 收件人: devel@edk2.groups.io
> > 抄送: michael.d.kin...@intel.com; gaolim...@byosoft.com.cn;
> > zhiguang@intel.com; Felix Polyudov ; Srinivasan
> > Mani ; Sundaresan S 
> > 主题: [PATCH v2 1/1] Subject: [PATCH] MdePkg:Added new SPCR table
> > stucture members as in Rev4.
> >
> > In SPCR table, 4 structure members have been added newly as per SPCR
> > table Rev4, which has to be added in
> > MdePkg/SerialPortConsoleRedirectionTable.h file.
> >
> > Signed-off-by: Praveen Sankar N praveensank...@ami.com
> > Cc: michael.d.kin...@intel.com
> > Cc: gaolim...@byosoft.com.cn
> > Cc: zhiguang@intel.com
> > Cc: fel...@ami.com
> > Cc: srinivas...@ami.com
> > Cc: sundares...@ami.com
> > ---
> >  .../IndustryStandard/SerialPortConsoleRedirectionTable.h| 6 +-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git
> > a/MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h
> > b/MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h
> > index eb5ae28390..f0001ab137 100644
> > ---
> > a/MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h
> > +++
> > b/MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h
> > @@ -47,7 +47,11 @@ typedef struct {
> >UINT8
> PciFunctionNumber;
> >
> >UINT32PciFlags;
> >
> >UINT8 PciSegment;
> >
> > -  UINT32Reserved3;
> >
> > +  UINT32
> UartClockFrequency;
> >
> > +  UINT32PreciseBaudRate;
> >
> > +  UINT16
> > NameSpaceStrLength;
> >
> > +  UINT16
> > NameSpaceStrOffset;
> >
> > +  CHAR8
> > NameSpaceString[0];
> >
> >  } EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE;
> >
> >
> >
> >  #pragma pack()
> >
> > --
> > 2.38.1.windows.1
> > -The information contained in this message may be confidential and
> > proprietary to American Megatrends (AMI). This communication is
> > intended
> to
> > be read only by the individual or entity to whom it is addressed or by
> their
> > designee. If the reader of this message is not the intended recipient,
> > you
> are
> > on notice that any distribution of this message, in any form, is
> > strictly prohibited. Please promptly notify the sender by reply e-mail
> > or by
> telephone
> > at 770-246-8600, and then delete or destroy all copies of the
> transmission=
> 
> 
> -The information contained in this message may be confidential and
> proprietary to American Megatrends (AMI). This communication is intended to
> be read only by the individual or entity to whom it is addressed or by their
> designee. If the reader of this message is not the intended recipient, you are
> on notice that any distribution of this message, in any form, is strictly
> prohibited. Please promptly notify the sender by reply e-mail or by telephone
> at 770-246-8600, and then delete or destroy all copies of the transmission.
> 
> 
> 
> 





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

Re: [edk2-devel] [PATCH v4 00/10] Add DeviceSecurity feature based on PFP 1.06 spec

2024-04-28 Thread Michael D Kinney
No objections.

For all patches related to adding libspdm submodule:

Reviewed-by: Michael D Kinney 

Mike

> -Original Message-
> From: Yao, Jiewen 
> Sent: Sunday, April 28, 2024 5:33 PM
> To: Hou, Wenxing ; devel@edk2.groups.io; Andrew
> Fish ; Leif Lindholm ;
> Kinney, Michael D ; Liming Gao
> ; Sean Brogan ;
> Joey Vagedes ; Liu, Zhiguang
> ; Kumar, Rahul R 
> Subject: RE: [edk2-devel] [PATCH v4 00/10] Add DeviceSecurity feature
> based on PFP 1.06 spec
> 
> Hi All
> It has been 4 work weeks and this V4 patch resolved previous comments
> and feedbacks.
> 
> If there is no further objection, I plan to merge it tomorrow.
> 
> Thank you
> Yao, Jiewen
> 
> 
> > -Original Message-
> > From: Hou, Wenxing 
> > Sent: Friday, April 26, 2024 9:52 AM
> > To: Yao, Jiewen ; devel@edk2.groups.io; Andrew
> Fish
> > ; Leif Lindholm ; Kinney,
> Michael
> > D ; Liming Gao ;
> > Sean Brogan ; Joey Vagedes
> > ; Liu, Zhiguang ;
> Kumar,
> > Rahul R 
> > Subject: RE: [edk2-devel] [PATCH v4 00/10] Add DeviceSecurity feature
> based on
> > PFP 1.06 spec
> >
> > Hi EDKII stewards,
> >
> > Could you please review the libspdm license?
> >
> > The libspdm(https://github.com/DMTF/libspdm) is a implementation that
> follows
> > the DMTF SPDM(https://www.dmtf.org/standards/spdm) spec.
> >
> > And the libspdm library is under DMTF repo.
> > The license is: https://github.com/DMTF/libspdm/blob/main/LICENSE.md
> >
> >
> >
> > Thanks,
> > Wenxing
> >
> >
> > -Original Message-
> > From: Yao, Jiewen 
> > Sent: Sunday, April 21, 2024 10:31 AM
> > To: Hou, Wenxing ; devel@edk2.groups.io; Andrew
> Fish
> > ; Leif Lindholm ; Kinney,
> Michael
> > D ; Liming Gao ;
> > Sean Brogan ; Joey Vagedes
> > ; Liu, Zhiguang ;
> Kumar,
> > Rahul R 
> > Subject: RE: [edk2-devel] [PATCH v4 00/10] Add DeviceSecurity feature
> based on
> > PFP 1.06 spec
> >
> > All series: Reviewed-by: Jiewen Yao 
> >
> > Dear Steward member
> > Do you have any concern on adding libspdm
> (https://github.com/DMTF/libspdm)
> > as one more submodule?
> >
> > Thank you
> > Yao, Jiewen
> >
> > > -Original Message-
> > > From: Hou, Wenxing 
> > > Sent: Thursday, April 18, 2024 6:16 PM
> > > To: devel@edk2.groups.io; Andrew Fish ; Leif
> Lindholm
> > > ; Kinney, Michael D
> > > ; Liming Gao ;
> > > Sean Brogan ; Joey Vagedes
> > > ; Liu, Zhiguang ;
> > > Kumar, Rahul R ; Yao, Jiewen
> > > 
> > > Subject: RE: [edk2-devel] [PATCH v4 00/10] Add DeviceSecurity
> feature
> > > based on PFP 1.06 spec
> > >
> > > Dear EDKII reviewers:
> > >
> > > Thank you for your previous review of this patch set.
> > > Currently, five patches have been reviewed by.
> > >
> > > But there are five patches need review.
> > >   Patch1:  MdePkg: Add SPDM1.2 support.
> > >   Patch2:  MdePkg: Add TCG PFP 1.06 support.
> > >   Patch4:  MdeModulePkg/Variable: Add TCG SPDM device measurement
> > > update
> > >   Patch8:  .gitmodule: Add libspdm submodule for EDKII
> > >   Patch10: ReadMe.rst: Add libspdm submodule license
> > >
> > > Could you please review the PATCH v4?
> > >
> > > PS: Jiewen has reviewed all the PATCH. And I have fixed his feedback
> in PATCH
> > v4.
> > > Jiewen has no questions about all the patches anymore.
> > >
> > > Thanks,
> > > Wenxing
> > >
> > >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of
> Wenxing
> > > Hou
> > > Sent: Thursday, April 18, 2024 5:28 PM
> > > To: devel@edk2.groups.io
> > > Cc: Andrew Fish ; Leif Lindholm
> > > ; Kinney, Michael D
> > > ; Liming Gao ;
> > > Sean Brogan ; Joey Vagedes
> > > ; Liu, Zhiguang ;
> > > Kumar, Rahul R ; Yao, Jiewen
> > > 
> > > Subject: [edk2-devel] [PATCH v4 00/10] Add DeviceSecurity feature
> > > based on PFP
> > > 1.06 spec
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2479
> > >
> > > In PFP spec 1.06, platform firmware records the device certificate
> and
> > > device measurement for each SPDM responder.
> > > This PATCH set implement the DeviceSecurityLib to support spdm
> device
> > > Authentication and Measurement.
> > >
> > > Libspdm as submodule is to support DeviceSecurity feature:
> > > https://github.com/DMTF/libspdm
> > >
> > > TCG PFP spec 1.06:
> > > https://trustedcomputinggroup.org/resource/pc-client-specific-
> platform
> > > -
> > > firmware-profile-specification/
> > >
> > > The POC branch:
> > > https://github.com/tianocore/edk2-staging/tree/DeviceSecurity
> > >
> > > And the PATCH set has passed the EDKII CI:
> > > https://github.com/tianocore/edk2/pull/5508
> > >
> > > v2 changes:
> > >  - Fix typo: PcdEnableSpdmDeviceAuthenticaion ->
> > > PcdEnableSpdmDeviceAuthentication
> > > v3 changes:
> > >  - Add new patch 10: Update ReadMe.rst for libspdm submodule license
> > > v4 changes:
> > >  - Update submodule libspdm to latest tag
> > >
> > > PATCH 3: Reviewed-by: Liming Gao  PATCH 5:
> > > Reviewed-by: Jiewen Yao  PATCH 6: Reviewed-by:
> > > Jiewen Yao  PATCH 7: Reviewed-by: Joey Vagedes
> > >  PATCH 9: Reviewed-by: Jiewen Yao

Re: [edk2-devel] [PATCH v4 00/10] Add DeviceSecurity feature based on PFP 1.06 spec

2024-04-28 Thread Yao, Jiewen
Hi All
It has been 4 work weeks and this V4 patch resolved previous comments and 
feedbacks.

If there is no further objection, I plan to merge it tomorrow.

Thank you
Yao, Jiewen


> -Original Message-
> From: Hou, Wenxing 
> Sent: Friday, April 26, 2024 9:52 AM
> To: Yao, Jiewen ; devel@edk2.groups.io; Andrew Fish
> ; Leif Lindholm ; Kinney, Michael
> D ; Liming Gao ;
> Sean Brogan ; Joey Vagedes
> ; Liu, Zhiguang ; Kumar,
> Rahul R 
> Subject: RE: [edk2-devel] [PATCH v4 00/10] Add DeviceSecurity feature based on
> PFP 1.06 spec
> 
> Hi EDKII stewards,
> 
> Could you please review the libspdm license?
> 
> The libspdm(https://github.com/DMTF/libspdm) is a implementation that follows
> the DMTF SPDM(https://www.dmtf.org/standards/spdm) spec.
> 
> And the libspdm library is under DMTF repo.
> The license is: https://github.com/DMTF/libspdm/blob/main/LICENSE.md
> 
> 
> 
> Thanks,
> Wenxing
> 
> 
> -Original Message-
> From: Yao, Jiewen 
> Sent: Sunday, April 21, 2024 10:31 AM
> To: Hou, Wenxing ; devel@edk2.groups.io; Andrew Fish
> ; Leif Lindholm ; Kinney, Michael
> D ; Liming Gao ;
> Sean Brogan ; Joey Vagedes
> ; Liu, Zhiguang ; Kumar,
> Rahul R 
> Subject: RE: [edk2-devel] [PATCH v4 00/10] Add DeviceSecurity feature based on
> PFP 1.06 spec
> 
> All series: Reviewed-by: Jiewen Yao 
> 
> Dear Steward member
> Do you have any concern on adding libspdm (https://github.com/DMTF/libspdm)
> as one more submodule?
> 
> Thank you
> Yao, Jiewen
> 
> > -Original Message-
> > From: Hou, Wenxing 
> > Sent: Thursday, April 18, 2024 6:16 PM
> > To: devel@edk2.groups.io; Andrew Fish ; Leif Lindholm
> > ; Kinney, Michael D
> > ; Liming Gao ;
> > Sean Brogan ; Joey Vagedes
> > ; Liu, Zhiguang ;
> > Kumar, Rahul R ; Yao, Jiewen
> > 
> > Subject: RE: [edk2-devel] [PATCH v4 00/10] Add DeviceSecurity feature
> > based on PFP 1.06 spec
> >
> > Dear EDKII reviewers:
> >
> > Thank you for your previous review of this patch set.
> > Currently, five patches have been reviewed by.
> >
> > But there are five patches need review.
> > Patch1:  MdePkg: Add SPDM1.2 support.
> > Patch2:  MdePkg: Add TCG PFP 1.06 support.
> > Patch4:  MdeModulePkg/Variable: Add TCG SPDM device measurement
> > update
> > Patch8:  .gitmodule: Add libspdm submodule for EDKII
> > Patch10: ReadMe.rst: Add libspdm submodule license
> >
> > Could you please review the PATCH v4?
> >
> > PS: Jiewen has reviewed all the PATCH. And I have fixed his feedback in 
> > PATCH
> v4.
> > Jiewen has no questions about all the patches anymore.
> >
> > Thanks,
> > Wenxing
> >
> >
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Wenxing
> > Hou
> > Sent: Thursday, April 18, 2024 5:28 PM
> > To: devel@edk2.groups.io
> > Cc: Andrew Fish ; Leif Lindholm
> > ; Kinney, Michael D
> > ; Liming Gao ;
> > Sean Brogan ; Joey Vagedes
> > ; Liu, Zhiguang ;
> > Kumar, Rahul R ; Yao, Jiewen
> > 
> > Subject: [edk2-devel] [PATCH v4 00/10] Add DeviceSecurity feature
> > based on PFP
> > 1.06 spec
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2479
> >
> > In PFP spec 1.06, platform firmware records the device certificate and
> > device measurement for each SPDM responder.
> > This PATCH set implement the DeviceSecurityLib to support spdm device
> > Authentication and Measurement.
> >
> > Libspdm as submodule is to support DeviceSecurity feature:
> > https://github.com/DMTF/libspdm
> >
> > TCG PFP spec 1.06:
> > https://trustedcomputinggroup.org/resource/pc-client-specific-platform
> > -
> > firmware-profile-specification/
> >
> > The POC branch:
> > https://github.com/tianocore/edk2-staging/tree/DeviceSecurity
> >
> > And the PATCH set has passed the EDKII CI:
> > https://github.com/tianocore/edk2/pull/5508
> >
> > v2 changes:
> >  - Fix typo: PcdEnableSpdmDeviceAuthenticaion ->
> > PcdEnableSpdmDeviceAuthentication
> > v3 changes:
> >  - Add new patch 10: Update ReadMe.rst for libspdm submodule license
> > v4 changes:
> >  - Update submodule libspdm to latest tag
> >
> > PATCH 3: Reviewed-by: Liming Gao  PATCH 5:
> > Reviewed-by: Jiewen Yao  PATCH 6: Reviewed-by:
> > Jiewen Yao  PATCH 7: Reviewed-by: Joey Vagedes
> >  PATCH 9: Reviewed-by: Jiewen Yao
> > 
> >
> > Cc: Andrew Fish 
> > Cc: Leif Lindholm 
> > Cc: Michael D Kinney 
> > Cc: Liming Gao 
> > Cc: Sean Brogan 
> > Cc: Joey Vagedes 
> > Cc: Zhiguang Liu 
> > Cc: Rahul Kumar 
> > Cc: Jiewen Yao 
> > Signed-off-by: Wenxing Hou 
> >
> > Wenxing Hou (10):
> >   MdePkg: Add SPDM1.2 support.
> >   MdePkg: Add TCG PFP 1.06 support.
> >   MdePkg: Add devAuthBoot GlobalVariable
> >   MdeModulePkg/Variable: Add TCG SPDM device measurement update
> >   SecurityPkg: Add TCG PFP 1.06 support.
> >   SecurityPkg: add DeviceSecurity support
> >   .pytool/CISettings.py: add libspdm submodule.
> >   .gitmodule: Add libspdm submodule for EDKII
> >   SecurityPkg: Add libspdm submodule
> >   ReadMe.rst: Add libspdm submodule license
> >
> >  .gitmodules  

[edk2-devel] [Patch V2 1/1] UefiCpuPkg/SmmCpuSyncLib: Add MM_STANDALONE tag.

2024-04-28 Thread Yuanhao Xie
Declares in the .inf file that the current component is an MM_STANDALONE

Signed-off-by: Yuanhao Xie 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Rahul Kumar 
Cc: Gerd Hoffmann 
Cc: Jiaxin Wu 
Reviewed-by: Jiaxin Wu 
---
 UefiCpuPkg/Library/SmmCpuSyncLib/SmmCpuSyncLib.inf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/UefiCpuPkg/Library/SmmCpuSyncLib/SmmCpuSyncLib.inf 
b/UefiCpuPkg/Library/SmmCpuSyncLib/SmmCpuSyncLib.inf
index 6b0d49c30a..2199b7948d 100644
--- a/UefiCpuPkg/Library/SmmCpuSyncLib/SmmCpuSyncLib.inf
+++ b/UefiCpuPkg/Library/SmmCpuSyncLib/SmmCpuSyncLib.inf
@@ -3,7 +3,7 @@
 #
 # This is SMM CPU Synchronization lib used for SMM CPU sync operations.
 #
-# Copyright (c) 2023, Intel Corporation. All rights reserved.
+# Copyright (c) 2023 - 2024, Intel Corporation. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -13,7 +13,7 @@
   BASE_NAME  = SmmCpuSyncLib
   FILE_GUID  = 1ca1bc1a-16a4-46ef-956a-ca500fd3381f
   MODULE_TYPE= DXE_SMM_DRIVER
-  LIBRARY_CLASS  = SmmCpuSyncLib|DXE_SMM_DRIVER
+  LIBRARY_CLASS  = SmmCpuSyncLib|DXE_SMM_DRIVER MM_STANDALONE
 
 [Sources]
   SmmCpuSyncLib.c
-- 
2.39.1.windows.1



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




[edk2-devel] [Patch V2 0/1] Add MM_STANDALONE tag.

2024-04-28 Thread Yuanhao Xie
Declares in the .inf file that the current component is an MM_STANDALONE

xieyuanh (1):
  UefiCpuPkg/SmmCpuSyncLib: Add MM_STANDALONE tag.

 UefiCpuPkg/Library/SmmCpuSyncLib/SmmCpuSyncLib.inf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.39.1.windows.1



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




[edk2-devel] Event: Tools, CI, Code base construction meeting series - Monday, April 29, 2024 #cal-reminder

2024-04-28 Thread Group Notification
*Reminder: Tools, CI, Code base construction meeting series*

*When:*
Monday, April 29, 2024
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://teams.microsoft.com/l/meetup-join/19%3ameeting_ZDI2ZDg4NmMtMjI1My00MzI5LWFmYjAtMGQyNjUzNTBjZGYw%40thread.v2/0?context=%7b%22Tid%22%3a%2272f988bf-86f1-41af-91ab-2d7cd011db47%22%2c%22Oid%22%3a%2223af6561-6e1c-450d-b917-d9d674eb3cb6%22%7d

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

*Description:*

TianoCore community,

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

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

Anyone is welcome to join.

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

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


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




[edk2-devel] [PATCH 1/1] MdeModulePkg/RamDiskDxe: fix memory leak.

2024-04-28 Thread Mike Maslenkin
Cc: Ray Ni 
Cc: Zhichao Gao 
Cc: Liming Gao 
Signed-off-by: Mike Maslenkin 
---
 MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c 
b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c
index 60cf3c8c4a79..2dac121c478c 100644
--- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c
+++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c
@@ -404,7 +404,8 @@ HiiCreateRamDisk (
   );
   } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
 
-  return EFI_DEVICE_ERROR;
+  Status = EFI_DEVICE_ERROR;
+  goto ErrorExit;
 }
   }
 
@@ -431,7 +432,7 @@ HiiCreateRamDisk (
 );
 } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
 
-return Status;
+goto ErrorExit;
   }
 
   //
@@ -442,6 +443,10 @@ HiiCreateRamDisk (
   PrivateData->CreateMethod = RamDiskCreateHii;
 
   return EFI_SUCCESS;
+
+ErrorExit:
+  gBS->FreePool (StartingAddr);
+  return Status;
 }
 
 /**
-- 
2.32.0 (Apple Git-132)



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