Re: [PATCH] UefiPayloadPkg: Fix the build failure


Ma, Maurice <maurice.ma@...>
 

Reviewed-by: Maurice Ma <maurice.ma@...>

-Maurice

-----Original Message-----
From: Dong, Guo <guo.dong@...>
Sent: Wednesday, June 30, 2021 15:51
To: devel@edk2.groups.io
Cc: Ma, Maurice <maurice.ma@...>; You, Benjamin
<benjamin.you@...>
Subject: [edk2-devel] [PATCH] UefiPayloadPkg: Fix the build failure

For non-universal payload, HandoffHobTable is used without initialization.
This patch fixed this failure.

Signed-off-by: Guo Dong <guo.dong@...>
---
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 3 +--
UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 4 +---
2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
index ed956c447c..ae16f25c7c 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
@@ -559,7 +559,6 @@ PayloadEntry (
{
EFI_STATUS Status;
PHYSICAL_ADDRESS DxeCoreEntryPoint;
- EFI_HOB_HANDOFF_INFO_TABLE *HandoffHobTable;
UINTN MemBase;
UINTN HobMemBase;
UINTN HobMemTop;
@@ -603,7 +602,7 @@ PayloadEntry (
IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);
IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF);

- Hob.HandoffInformationTable = HandoffHobTable;
+ Hob.HandoffInformationTable = (EFI_HOB_HANDOFF_INFO_TABLE *)
GetFirstHob(EFI_HOB_TYPE_HANDOFF);
HandOffToDxeCore (DxeCoreEntryPoint, Hob);

// Should not get here
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
index a67653eb11..7a00a56ab9 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
@@ -364,7 +364,6 @@ _ModuleEntryPoint (
{
EFI_STATUS Status;
PHYSICAL_ADDRESS DxeCoreEntryPoint;
- EFI_HOB_HANDOFF_INFO_TABLE *HandoffHobTable;
EFI_PEI_HOB_POINTERS Hob;
EFI_FIRMWARE_VOLUME_HEADER *DxeFv;

@@ -393,8 +392,7 @@ _ModuleEntryPoint (
IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);
IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF);

- HandoffHobTable = (EFI_HOB_HANDOFF_INFO_TABLE *)
GetFirstHob(EFI_HOB_TYPE_HANDOFF);
- Hob.HandoffInformationTable = HandoffHobTable;
+ Hob.HandoffInformationTable = (EFI_HOB_HANDOFF_INFO_TABLE *)
GetFirstHob(EFI_HOB_TYPE_HANDOFF);
HandOffToDxeCore (DxeCoreEntryPoint, Hob);

// Should not get here
--
2.16.2.windows.1

Join devel@edk2.groups.io to automatically receive all group messages.