Re: [edk2-devel] [PATCH v1 10/13] OvmfPkg/PlatformInitLib: Create gEfiAcpiVariableGuid

2024-04-11 Thread Ni, Ray
Which patch removes this HOB creation from SmmAccess driver?

Thanks,
Ray

From: Wu, Jiaxin 
Sent: Wednesday, April 10, 2024 21:57
To: devel@edk2.groups.io 
Cc: Ard Biesheuvel ; Yao, Jiewen 
; Gerd Hoffmann ; Ni, Ray 

Subject: [PATCH v1 10/13] OvmfPkg/PlatformInitLib: Create gEfiAcpiVariableGuid

This patch is for OVMF to create the gEfiAcpiVariableGuid
since it has been removed from the SmmAccess driver.

Cc: Ard Biesheuvel 
Cc: Jiewen Yao 
Cc: Gerd Hoffmann 
Cc: Ray Ni 
Signed-off-by: Jiaxin Wu 
---
 OvmfPkg/Library/PlatformInitLib/MemDetect.c | 9 +
 OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf | 1 +
 2 files changed, 10 insertions(+)

diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c 
b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
index 8b98256225..f451c9d80c 100644
--- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c
+++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
@@ -41,10 +41,11 @@ Module Name:
 #include 
 #include 

 #include 

+#include 
 #include 

 #define MEGABYTE_SHIFT  20

 VOID
@@ -1050,10 +1051,11 @@ PlatformQemuInitializeRam (
 UINT32  TsegSize;
 UINTN   BufferSize;
 UINT8   SmramRanges;
 EFI_PEI_HOB_POINTERSHob;
 EFI_SMRAM_HOB_DESCRIPTOR_BLOCK  *SmramHobDescriptorBlock;
+VOID*GuidHob;

 TsegSize = PlatformInfoHob->Q35TsegMbytes * SIZE_1MB;
 PlatformAddMemoryRangeHob (BASE_1MB, PlatformInfoHob->LowMemory - 
TsegSize);
 PlatformAddReservedMemoryBaseSizeHob (
   PlatformInfoHob->LowMemory - TsegSize,
@@ -1080,10 +1082,17 @@ PlatformQemuInitializeRam (
 SmramHobDescriptorBlock->Descriptor[0].PhysicalStart = 
PlatformInfoHob->LowMemory - TsegSize;
 SmramHobDescriptorBlock->Descriptor[0].CpuStart  = 
PlatformInfoHob->LowMemory - TsegSize;
 SmramHobDescriptorBlock->Descriptor[0].PhysicalSize  = EFI_PAGE_SIZE;
 SmramHobDescriptorBlock->Descriptor[0].RegionState   = EFI_SMRAM_CLOSED | 
EFI_CACHEABLE | EFI_ALLOCATED;

+//
+// Create gEfiAcpiVariableGuid
+//
+GuidHob = BuildGuidHob (&gEfiAcpiVariableGuid, sizeof 
(EFI_SMRAM_DESCRIPTOR));
+ASSERT (GuidHob != NULL);
+CopyMem (GuidHob, &SmramHobDescriptorBlock->Descriptor[0], sizeof 
(EFI_SMRAM_DESCRIPTOR));
+
 //
 // Create second SMRAM descriptor, which is free and will be used by SMM 
foundation.
 //
 SmramHobDescriptorBlock->Descriptor[1].PhysicalStart = 
SmramHobDescriptorBlock->Descriptor[0].PhysicalStart + EFI_PAGE_SIZE;
 SmramHobDescriptorBlock->Descriptor[1].CpuStart  = 
SmramHobDescriptorBlock->Descriptor[0].CpuStart + EFI_PAGE_SIZE;
diff --git a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf 
b/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
index 2bb1c0296f..21e6efa5e0 100644
--- a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
+++ b/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
@@ -56,10 +56,11 @@
 [LibraryClasses.X64]
   TdxLib

 [Guids]
   gEfiSmmSmramMemoryGuid
+  gEfiAcpiVariableGuid

 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
   gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable

--
2.16.2.windows.1



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




[edk2-devel] [PATCH v1 10/13] OvmfPkg/PlatformInitLib: Create gEfiAcpiVariableGuid

2024-04-10 Thread Wu, Jiaxin
This patch is for OVMF to create the gEfiAcpiVariableGuid
since it has been removed from the SmmAccess driver.

Cc: Ard Biesheuvel 
Cc: Jiewen Yao 
Cc: Gerd Hoffmann 
Cc: Ray Ni 
Signed-off-by: Jiaxin Wu 
---
 OvmfPkg/Library/PlatformInitLib/MemDetect.c | 9 +
 OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf | 1 +
 2 files changed, 10 insertions(+)

diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c 
b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
index 8b98256225..f451c9d80c 100644
--- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c
+++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
@@ -41,10 +41,11 @@ Module Name:
 #include 
 #include 
 
 #include 
 
+#include 
 #include 
 
 #define MEGABYTE_SHIFT  20
 
 VOID
@@ -1050,10 +1051,11 @@ PlatformQemuInitializeRam (
 UINT32  TsegSize;
 UINTN   BufferSize;
 UINT8   SmramRanges;
 EFI_PEI_HOB_POINTERSHob;
 EFI_SMRAM_HOB_DESCRIPTOR_BLOCK  *SmramHobDescriptorBlock;
+VOID*GuidHob;
 
 TsegSize = PlatformInfoHob->Q35TsegMbytes * SIZE_1MB;
 PlatformAddMemoryRangeHob (BASE_1MB, PlatformInfoHob->LowMemory - 
TsegSize);
 PlatformAddReservedMemoryBaseSizeHob (
   PlatformInfoHob->LowMemory - TsegSize,
@@ -1080,10 +1082,17 @@ PlatformQemuInitializeRam (
 SmramHobDescriptorBlock->Descriptor[0].PhysicalStart = 
PlatformInfoHob->LowMemory - TsegSize;
 SmramHobDescriptorBlock->Descriptor[0].CpuStart  = 
PlatformInfoHob->LowMemory - TsegSize;
 SmramHobDescriptorBlock->Descriptor[0].PhysicalSize  = EFI_PAGE_SIZE;
 SmramHobDescriptorBlock->Descriptor[0].RegionState   = EFI_SMRAM_CLOSED | 
EFI_CACHEABLE | EFI_ALLOCATED;
 
+//
+// Create gEfiAcpiVariableGuid
+//
+GuidHob = BuildGuidHob (&gEfiAcpiVariableGuid, sizeof 
(EFI_SMRAM_DESCRIPTOR));
+ASSERT (GuidHob != NULL);
+CopyMem (GuidHob, &SmramHobDescriptorBlock->Descriptor[0], sizeof 
(EFI_SMRAM_DESCRIPTOR));
+
 //
 // Create second SMRAM descriptor, which is free and will be used by SMM 
foundation.
 //
 SmramHobDescriptorBlock->Descriptor[1].PhysicalStart = 
SmramHobDescriptorBlock->Descriptor[0].PhysicalStart + EFI_PAGE_SIZE;
 SmramHobDescriptorBlock->Descriptor[1].CpuStart  = 
SmramHobDescriptorBlock->Descriptor[0].CpuStart + EFI_PAGE_SIZE;
diff --git a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf 
b/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
index 2bb1c0296f..21e6efa5e0 100644
--- a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
+++ b/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
@@ -56,10 +56,11 @@
 [LibraryClasses.X64]
   TdxLib
 
 [Guids]
   gEfiSmmSmramMemoryGuid
+  gEfiAcpiVariableGuid
 
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
   gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable
 
-- 
2.16.2.windows.1



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