public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch V2 0/2] Fix bug in dump guid HOB info funcs and dump info from a new GUID HOB
@ 2021-08-31  5:38 duntan
  2021-08-31  5:38 ` [Patch V2 1/2] UefiPayloadPkg: Fix the bug in dump guid HOB info functions duntan
  2021-08-31  5:38 ` [Patch V2 2/2] UefiPayloadPkg: Dump hob info from gEdkiiBootManagerMenuFileGuid duntan
  0 siblings, 2 replies; 7+ messages in thread
From: duntan @ 2021-08-31  5:38 UTC (permalink / raw)
  To: devel

Fix the bug in dump guid HOB info functions
Dump hob info from gEdkiiBootManagerMenuFileGuid

duntan (2):
  UefiPayloadPkg: Fix the bug in dump guid HOB info functions
  UefiPayloadPkg: Dump hob info from gEdkiiBootManagerMenuFileGuid

 UefiPayloadPkg/UefiPayloadEntry/PrintHob.c                | 35 +++++++++++++++++++++++++++++++----
 UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf |  1 +
 2 files changed, 32 insertions(+), 4 deletions(-)

-- 
2.31.1.windows.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Patch V2 1/2] UefiPayloadPkg: Fix the bug in dump guid HOB info functions
  2021-08-31  5:38 [Patch V2 0/2] Fix bug in dump guid HOB info funcs and dump info from a new GUID HOB duntan
@ 2021-08-31  5:38 ` duntan
  2021-09-09  1:58   ` Zhiguang Liu
  2021-09-09 12:22   ` Ni, Ray
  2021-08-31  5:38 ` [Patch V2 2/2] UefiPayloadPkg: Dump hob info from gEdkiiBootManagerMenuFileGuid duntan
  1 sibling, 2 replies; 7+ messages in thread
From: duntan @ 2021-08-31  5:38 UTC (permalink / raw)
  To: devel; +Cc: Guo Dong, Ray Ni, Maurice Ma, Benjamin You, Zhiguang Liu, DunTan

The input HobLength of PrintHandler should be data size instead of whole length of HOB

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: DunTan <dun.tan@intel.com>
---
 UefiPayloadPkg/UefiPayloadEntry/PrintHob.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
index 5fb638d4a4..f93aeec472 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
@@ -317,9 +317,11 @@ PrintPciRootBridgeInfoGuidHob (
 {
   UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *PciRootBridges;
   UINTN                              Index;
+  UINTN                              Length;
   Index = 0;
   PciRootBridges = (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *) GET_GUID_HOB_DATA (HobRaw);
-  ASSERT (HobLength >= sizeof (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES));
+  Length = sizeof (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES) + PciRootBridges->Count * sizeof (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE);
+  ASSERT (HobLength >= Length);
   DEBUG ((DEBUG_INFO, "   Revision         = 0x%x\n", PciRootBridges->Header.Revision));
   DEBUG ((DEBUG_INFO, "   Length           = 0x%x\n", PciRootBridges->Header.Length));
   DEBUG ((DEBUG_INFO, "   Count            = 0x%x\n", PciRootBridges->Count));
@@ -369,10 +371,12 @@ PrintExtraDataGuidHob (
 {
   UNIVERSAL_PAYLOAD_EXTRA_DATA *ExtraData;
   UINTN                        Index;
+  UINTN                        Length;
 
   Index     = 0;
   ExtraData = (UNIVERSAL_PAYLOAD_EXTRA_DATA *) GET_GUID_HOB_DATA (HobRaw);
-  ASSERT (HobLength >= ExtraData->Header.Length);
+  Length = sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA) + ExtraData->Count * sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY);
+  ASSERT (HobLength >= Length);
   DEBUG ((DEBUG_INFO, "   Revision  = 0x%x\n", ExtraData->Header.Revision));
   DEBUG ((DEBUG_INFO, "   Length    = 0x%x\n", ExtraData->Header.Length));
   DEBUG ((DEBUG_INFO, "   Count     = 0x%x\n", ExtraData->Count));
@@ -443,7 +447,7 @@ PrintGuidHob (
   for (Index = 0; Index < ARRAY_SIZE (GuidHobPrintHandleTable); Index++) {
     if (CompareGuid (&Hob.Guid->Name, GuidHobPrintHandleTable[Index].Guid)) {
       DEBUG ((DEBUG_INFO, "   Guid   = %a\n", GuidHobPrintHandleTable[Index].GuidName));
-      Status = GuidHobPrintHandleTable[Index].PrintHandler (Hob.Raw, Hob.Header->HobLength);
+      Status = GuidHobPrintHandleTable[Index].PrintHandler (Hob.Raw, GET_GUID_HOB_DATA_SIZE (Hob.Raw));
       return Status;
     }
   }
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Patch V2 2/2] UefiPayloadPkg: Dump hob info from gEdkiiBootManagerMenuFileGuid
  2021-08-31  5:38 [Patch V2 0/2] Fix bug in dump guid HOB info funcs and dump info from a new GUID HOB duntan
  2021-08-31  5:38 ` [Patch V2 1/2] UefiPayloadPkg: Fix the bug in dump guid HOB info functions duntan
@ 2021-08-31  5:38 ` duntan
  2021-09-09  1:59   ` [edk2-devel] " Zhiguang Liu
  2021-09-09 12:22   ` Ni, Ray
  1 sibling, 2 replies; 7+ messages in thread
From: duntan @ 2021-08-31  5:38 UTC (permalink / raw)
  To: devel; +Cc: Guo Dong, Ray Ni, Maurice Ma, Benjamin You, Zhiguang Liu, DunTan

V1: Dump this hob infomation from gEdkiiBootManagerMenuFileGuid
V2: Delete the duplicated assertions

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: DunTan <dun.tan@intel.com>
---
 UefiPayloadPkg/UefiPayloadEntry/PrintHob.c                | 25 ++++++++++++++++++++++++-
 UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf |  1 +
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
index f93aeec472..b5ea9a17a2 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
@@ -10,6 +10,7 @@
 #include <UniversalPayload/ExtraData.h>
 #include <Guid/MemoryTypeInformation.h>
 #include <Guid/AcpiBoardInfoGuid.h>
+#include <Guid/BootManagerMenu.h>
 
 #define ROW_LIMITER 16
 
@@ -410,6 +411,27 @@ PrintMemoryTypeInfoGuidHob (
   return EFI_SUCCESS;
 }
 
+/**
+  Print the information in EdkiiBootManagerMenuFileGuid.
+  @param[in] HobRaw          A pointer to the start of gEdkiiBootManagerMenuFileGuid HOB.
+  @retval EFI_SUCCESS        If it completed successfully.
+**/
+EFI_STATUS
+PrintBootManagerMenuGuidHob (
+  IN  UINT8          *HobRaw,
+  IN  UINT16         HobLength
+  )
+{
+  UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU *BootManagerMenuFile;
+
+  BootManagerMenuFile = (UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU *) GET_GUID_HOB_DATA (HobRaw);
+  ASSERT (HobLength >= sizeof (*BootManagerMenuFile));
+  DEBUG ((DEBUG_INFO, "   Revision  = 0x%x\n", BootManagerMenuFile->Header.Revision));
+  DEBUG ((DEBUG_INFO, "   Length    = 0x%x\n", BootManagerMenuFile->Header.Length));
+  DEBUG ((DEBUG_INFO, "   FileName  = %g\n",   &BootManagerMenuFile->FileName));
+  return EFI_SUCCESS;
+}
+
 //
 // Mappint table for dump Guid Hob information.
 // This table can be easily extented.
@@ -422,7 +444,8 @@ GUID_HOB_PRINT_HANDLE GuidHobPrintHandleTable[] = {
   {&gUefiAcpiBoardInfoGuid,                 PrintAcpiBoardInfoGuidHob,     "gUefiAcpiBoardInfoGuid(Acpi Guid)"},
   {&gUniversalPayloadPciRootBridgeInfoGuid, PrintPciRootBridgeInfoGuidHob, "gUniversalPayloadPciRootBridgeInfoGuid(Pci Guid)"},
   {&gEfiMemoryTypeInformationGuid,          PrintMemoryTypeInfoGuidHob,    "gEfiMemoryTypeInformationGuid(Memory Type Information Guid)"},
-  {&gUniversalPayloadExtraDataGuid,         PrintExtraDataGuidHob,         "gUniversalPayloadExtraDataGuid(PayLoad Extra Data Guid)"}
+  {&gUniversalPayloadExtraDataGuid,         PrintExtraDataGuidHob,         "gUniversalPayloadExtraDataGuid(PayLoad Extra Data Guid)"},
+  {&gEdkiiBootManagerMenuFileGuid,          PrintBootManagerMenuGuidHob,   "gEdkiiBootManagerMenuFileGuid(Boot Manager Menu File Guid)"}
 };
 
 /**
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
index 416a620598..3ee449219d 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
@@ -70,6 +70,7 @@
   gUniversalPayloadAcpiTableGuid
   gUniversalPayloadPciRootBridgeInfoGuid
   gUniversalPayloadSmbios3TableGuid
+  gEdkiiBootManagerMenuFileGuid
 
 [FeaturePcd.IA32]
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode      ## CONSUMES
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Patch V2 1/2] UefiPayloadPkg: Fix the bug in dump guid HOB info functions
  2021-08-31  5:38 ` [Patch V2 1/2] UefiPayloadPkg: Fix the bug in dump guid HOB info functions duntan
@ 2021-09-09  1:58   ` Zhiguang Liu
  2021-09-09 12:22   ` Ni, Ray
  1 sibling, 0 replies; 7+ messages in thread
From: Zhiguang Liu @ 2021-09-09  1:58 UTC (permalink / raw)
  To: Tan, Dun, devel@edk2.groups.io
  Cc: Dong, Guo, Ni, Ray, Ma, Maurice, You, Benjamin

[-- Attachment #1: Type: text/plain, Size: 3265 bytes --]

Thank Dun for the fix.
Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>

________________________________
From: Tan, Dun <dun.tan@intel.com>
Sent: Tuesday, August 31, 2021 13:38
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Ma, Maurice <maurice.ma@intel.com>; You, Benjamin <benjamin.you@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Tan, Dun <dun.tan@intel.com>
Subject: [Patch V2 1/2] UefiPayloadPkg: Fix the bug in dump guid HOB info functions

The input HobLength of PrintHandler should be data size instead of whole length of HOB

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: DunTan <dun.tan@intel.com>
---
 UefiPayloadPkg/UefiPayloadEntry/PrintHob.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
index 5fb638d4a4..f93aeec472 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
@@ -317,9 +317,11 @@ PrintPciRootBridgeInfoGuidHob (
 {
   UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *PciRootBridges;
   UINTN                              Index;
+  UINTN                              Length;
   Index = 0;
   PciRootBridges = (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *) GET_GUID_HOB_DATA (HobRaw);
-  ASSERT (HobLength >= sizeof (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES));
+  Length = sizeof (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES) + PciRootBridges->Count * sizeof (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE);
+  ASSERT (HobLength >= Length);
   DEBUG ((DEBUG_INFO, "   Revision         = 0x%x\n", PciRootBridges->Header.Revision));
   DEBUG ((DEBUG_INFO, "   Length           = 0x%x\n", PciRootBridges->Header.Length));
   DEBUG ((DEBUG_INFO, "   Count            = 0x%x\n", PciRootBridges->Count));
@@ -369,10 +371,12 @@ PrintExtraDataGuidHob (
 {
   UNIVERSAL_PAYLOAD_EXTRA_DATA *ExtraData;
   UINTN                        Index;
+  UINTN                        Length;

   Index     = 0;
   ExtraData = (UNIVERSAL_PAYLOAD_EXTRA_DATA *) GET_GUID_HOB_DATA (HobRaw);
-  ASSERT (HobLength >= ExtraData->Header.Length);
+  Length = sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA) + ExtraData->Count * sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY);
+  ASSERT (HobLength >= Length);
   DEBUG ((DEBUG_INFO, "   Revision  = 0x%x\n", ExtraData->Header.Revision));
   DEBUG ((DEBUG_INFO, "   Length    = 0x%x\n", ExtraData->Header.Length));
   DEBUG ((DEBUG_INFO, "   Count     = 0x%x\n", ExtraData->Count));
@@ -443,7 +447,7 @@ PrintGuidHob (
   for (Index = 0; Index < ARRAY_SIZE (GuidHobPrintHandleTable); Index++) {
     if (CompareGuid (&Hob.Guid->Name, GuidHobPrintHandleTable[Index].Guid)) {
       DEBUG ((DEBUG_INFO, "   Guid   = %a\n", GuidHobPrintHandleTable[Index].GuidName));
-      Status = GuidHobPrintHandleTable[Index].PrintHandler (Hob.Raw, Hob.Header->HobLength);
+      Status = GuidHobPrintHandleTable[Index].PrintHandler (Hob.Raw, GET_GUID_HOB_DATA_SIZE (Hob.Raw));
       return Status;
     }
   }
--
2.31.1.windows.1


[-- Attachment #2: Type: text/html, Size: 5811 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [Patch V2 2/2] UefiPayloadPkg: Dump hob info from gEdkiiBootManagerMenuFileGuid
  2021-08-31  5:38 ` [Patch V2 2/2] UefiPayloadPkg: Dump hob info from gEdkiiBootManagerMenuFileGuid duntan
@ 2021-09-09  1:59   ` Zhiguang Liu
  2021-09-09 12:22   ` Ni, Ray
  1 sibling, 0 replies; 7+ messages in thread
From: Zhiguang Liu @ 2021-09-09  1:59 UTC (permalink / raw)
  To: devel@edk2.groups.io, Tan, Dun
  Cc: Dong, Guo, Ni, Ray, Ma, Maurice, You, Benjamin

[-- Attachment #1: Type: text/plain, Size: 4093 bytes --]

Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>

________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of duntan <dun.tan@intel.com>
Sent: Tuesday, August 31, 2021 13:38
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Ma, Maurice <maurice.ma@intel.com>; You, Benjamin <benjamin.you@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Tan, Dun <dun.tan@intel.com>
Subject: [edk2-devel] [Patch V2 2/2] UefiPayloadPkg: Dump hob info from gEdkiiBootManagerMenuFileGuid

V1: Dump this hob infomation from gEdkiiBootManagerMenuFileGuid
V2: Delete the duplicated assertions

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: DunTan <dun.tan@intel.com>
---
 UefiPayloadPkg/UefiPayloadEntry/PrintHob.c                | 25 ++++++++++++++++++++++++-
 UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf |  1 +
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
index f93aeec472..b5ea9a17a2 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
@@ -10,6 +10,7 @@
 #include <UniversalPayload/ExtraData.h>
 #include <Guid/MemoryTypeInformation.h>
 #include <Guid/AcpiBoardInfoGuid.h>
+#include <Guid/BootManagerMenu.h>

 #define ROW_LIMITER 16

@@ -410,6 +411,27 @@ PrintMemoryTypeInfoGuidHob (
   return EFI_SUCCESS;
 }

+/**
+  Print the information in EdkiiBootManagerMenuFileGuid.
+  @param[in] HobRaw          A pointer to the start of gEdkiiBootManagerMenuFileGuid HOB.
+  @retval EFI_SUCCESS        If it completed successfully.
+**/
+EFI_STATUS
+PrintBootManagerMenuGuidHob (
+  IN  UINT8          *HobRaw,
+  IN  UINT16         HobLength
+  )
+{
+  UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU *BootManagerMenuFile;
+
+  BootManagerMenuFile = (UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU *) GET_GUID_HOB_DATA (HobRaw);
+  ASSERT (HobLength >= sizeof (*BootManagerMenuFile));
+  DEBUG ((DEBUG_INFO, "   Revision  = 0x%x\n", BootManagerMenuFile->Header.Revision));
+  DEBUG ((DEBUG_INFO, "   Length    = 0x%x\n", BootManagerMenuFile->Header.Length));
+  DEBUG ((DEBUG_INFO, "   FileName  = %g\n",   &BootManagerMenuFile->FileName));
+  return EFI_SUCCESS;
+}
+
 //
 // Mappint table for dump Guid Hob information.
 // This table can be easily extented.
@@ -422,7 +444,8 @@ GUID_HOB_PRINT_HANDLE GuidHobPrintHandleTable[] = {
   {&gUefiAcpiBoardInfoGuid,                 PrintAcpiBoardInfoGuidHob,     "gUefiAcpiBoardInfoGuid(Acpi Guid)"},
   {&gUniversalPayloadPciRootBridgeInfoGuid, PrintPciRootBridgeInfoGuidHob, "gUniversalPayloadPciRootBridgeInfoGuid(Pci Guid)"},
   {&gEfiMemoryTypeInformationGuid,          PrintMemoryTypeInfoGuidHob,    "gEfiMemoryTypeInformationGuid(Memory Type Information Guid)"},
-  {&gUniversalPayloadExtraDataGuid,         PrintExtraDataGuidHob,         "gUniversalPayloadExtraDataGuid(PayLoad Extra Data Guid)"}
+  {&gUniversalPayloadExtraDataGuid,         PrintExtraDataGuidHob,         "gUniversalPayloadExtraDataGuid(PayLoad Extra Data Guid)"},
+  {&gEdkiiBootManagerMenuFileGuid,          PrintBootManagerMenuGuidHob,   "gEdkiiBootManagerMenuFileGuid(Boot Manager Menu File Guid)"}
 };

 /**
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
index 416a620598..3ee449219d 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
@@ -70,6 +70,7 @@
   gUniversalPayloadAcpiTableGuid
   gUniversalPayloadPciRootBridgeInfoGuid
   gUniversalPayloadSmbios3TableGuid
+  gEdkiiBootManagerMenuFileGuid

 [FeaturePcd.IA32]
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode      ## CONSUMES
--
2.31.1.windows.1







[-- Attachment #2: Type: text/html, Size: 6486 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Patch V2 1/2] UefiPayloadPkg: Fix the bug in dump guid HOB info functions
  2021-08-31  5:38 ` [Patch V2 1/2] UefiPayloadPkg: Fix the bug in dump guid HOB info functions duntan
  2021-09-09  1:58   ` Zhiguang Liu
@ 2021-09-09 12:22   ` Ni, Ray
  1 sibling, 0 replies; 7+ messages in thread
From: Ni, Ray @ 2021-09-09 12:22 UTC (permalink / raw)
  To: Tan, Dun, devel@edk2.groups.io
  Cc: Dong, Guo, Ma, Maurice, You, Benjamin, Liu, Zhiguang

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Tan, Dun <dun.tan@intel.com>
> Sent: Tuesday, August 31, 2021 1:38 PM
> To: devel@edk2.groups.io
> Cc: Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Ma, Maurice <maurice.ma@intel.com>; You, Benjamin
> <benjamin.you@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Tan, Dun <dun.tan@intel.com>
> Subject: [Patch V2 1/2] UefiPayloadPkg: Fix the bug in dump guid HOB info functions
> 
> The input HobLength of PrintHandler should be data size instead of whole length of HOB
> 
> Cc: Guo Dong <guo.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Maurice Ma <maurice.ma@intel.com>
> Cc: Benjamin You <benjamin.you@intel.com>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Signed-off-by: DunTan <dun.tan@intel.com>
> ---
>  UefiPayloadPkg/UefiPayloadEntry/PrintHob.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
> index 5fb638d4a4..f93aeec472 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
> +++ b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
> @@ -317,9 +317,11 @@ PrintPciRootBridgeInfoGuidHob (
>  {
>    UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *PciRootBridges;
>    UINTN                              Index;
> +  UINTN                              Length;
>    Index = 0;
>    PciRootBridges = (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *) GET_GUID_HOB_DATA (HobRaw);
> -  ASSERT (HobLength >= sizeof (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES));
> +  Length = sizeof (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES) + PciRootBridges->Count * sizeof
> (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE);
> +  ASSERT (HobLength >= Length);
>    DEBUG ((DEBUG_INFO, "   Revision         = 0x%x\n", PciRootBridges->Header.Revision));
>    DEBUG ((DEBUG_INFO, "   Length           = 0x%x\n", PciRootBridges->Header.Length));
>    DEBUG ((DEBUG_INFO, "   Count            = 0x%x\n", PciRootBridges->Count));
> @@ -369,10 +371,12 @@ PrintExtraDataGuidHob (
>  {
>    UNIVERSAL_PAYLOAD_EXTRA_DATA *ExtraData;
>    UINTN                        Index;
> +  UINTN                        Length;
> 
>    Index     = 0;
>    ExtraData = (UNIVERSAL_PAYLOAD_EXTRA_DATA *) GET_GUID_HOB_DATA (HobRaw);
> -  ASSERT (HobLength >= ExtraData->Header.Length);
> +  Length = sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA) + ExtraData->Count * sizeof
> (UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY);
> +  ASSERT (HobLength >= Length);
>    DEBUG ((DEBUG_INFO, "   Revision  = 0x%x\n", ExtraData->Header.Revision));
>    DEBUG ((DEBUG_INFO, "   Length    = 0x%x\n", ExtraData->Header.Length));
>    DEBUG ((DEBUG_INFO, "   Count     = 0x%x\n", ExtraData->Count));
> @@ -443,7 +447,7 @@ PrintGuidHob (
>    for (Index = 0; Index < ARRAY_SIZE (GuidHobPrintHandleTable); Index++) {
>      if (CompareGuid (&Hob.Guid->Name, GuidHobPrintHandleTable[Index].Guid)) {
>        DEBUG ((DEBUG_INFO, "   Guid   = %a\n", GuidHobPrintHandleTable[Index].GuidName));
> -      Status = GuidHobPrintHandleTable[Index].PrintHandler (Hob.Raw, Hob.Header->HobLength);
> +      Status = GuidHobPrintHandleTable[Index].PrintHandler (Hob.Raw, GET_GUID_HOB_DATA_SIZE (Hob.Raw));
>        return Status;
>      }
>    }
> --
> 2.31.1.windows.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [Patch V2 2/2] UefiPayloadPkg: Dump hob info from gEdkiiBootManagerMenuFileGuid
  2021-08-31  5:38 ` [Patch V2 2/2] UefiPayloadPkg: Dump hob info from gEdkiiBootManagerMenuFileGuid duntan
  2021-09-09  1:59   ` [edk2-devel] " Zhiguang Liu
@ 2021-09-09 12:22   ` Ni, Ray
  1 sibling, 0 replies; 7+ messages in thread
From: Ni, Ray @ 2021-09-09 12:22 UTC (permalink / raw)
  To: devel@edk2.groups.io, Tan, Dun
  Cc: Dong, Guo, Ma, Maurice, You, Benjamin, Liu, Zhiguang

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of duntan
> Sent: Tuesday, August 31, 2021 1:38 PM
> To: devel@edk2.groups.io
> Cc: Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Ma, Maurice <maurice.ma@intel.com>; You, Benjamin
> <benjamin.you@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Tan, Dun <dun.tan@intel.com>
> Subject: [edk2-devel] [Patch V2 2/2] UefiPayloadPkg: Dump hob info from gEdkiiBootManagerMenuFileGuid
> 
> V1: Dump this hob infomation from gEdkiiBootManagerMenuFileGuid
> V2: Delete the duplicated assertions
> 
> Cc: Guo Dong <guo.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Maurice Ma <maurice.ma@intel.com>
> Cc: Benjamin You <benjamin.you@intel.com>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Signed-off-by: DunTan <dun.tan@intel.com>
> ---
>  UefiPayloadPkg/UefiPayloadEntry/PrintHob.c                | 25 ++++++++++++++++++++++++-
>  UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf |  1 +
>  2 files changed, 25 insertions(+), 1 deletion(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
> index f93aeec472..b5ea9a17a2 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
> +++ b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
> @@ -10,6 +10,7 @@
>  #include <UniversalPayload/ExtraData.h>
>  #include <Guid/MemoryTypeInformation.h>
>  #include <Guid/AcpiBoardInfoGuid.h>
> +#include <Guid/BootManagerMenu.h>
> 
>  #define ROW_LIMITER 16
> 
> @@ -410,6 +411,27 @@ PrintMemoryTypeInfoGuidHob (
>    return EFI_SUCCESS;
>  }
> 
> +/**
> +  Print the information in EdkiiBootManagerMenuFileGuid.
> +  @param[in] HobRaw          A pointer to the start of gEdkiiBootManagerMenuFileGuid HOB.
> +  @retval EFI_SUCCESS        If it completed successfully.
> +**/
> +EFI_STATUS
> +PrintBootManagerMenuGuidHob (
> +  IN  UINT8          *HobRaw,
> +  IN  UINT16         HobLength
> +  )
> +{
> +  UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU *BootManagerMenuFile;
> +
> +  BootManagerMenuFile = (UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU *) GET_GUID_HOB_DATA (HobRaw);
> +  ASSERT (HobLength >= sizeof (*BootManagerMenuFile));
> +  DEBUG ((DEBUG_INFO, "   Revision  = 0x%x\n", BootManagerMenuFile->Header.Revision));
> +  DEBUG ((DEBUG_INFO, "   Length    = 0x%x\n", BootManagerMenuFile->Header.Length));
> +  DEBUG ((DEBUG_INFO, "   FileName  = %g\n",   &BootManagerMenuFile->FileName));
> +  return EFI_SUCCESS;
> +}
> +
>  //
>  // Mappint table for dump Guid Hob information.
>  // This table can be easily extented.
> @@ -422,7 +444,8 @@ GUID_HOB_PRINT_HANDLE GuidHobPrintHandleTable[] = {
>    {&gUefiAcpiBoardInfoGuid,                 PrintAcpiBoardInfoGuidHob,     "gUefiAcpiBoardInfoGuid(Acpi Guid)"},
>    {&gUniversalPayloadPciRootBridgeInfoGuid, PrintPciRootBridgeInfoGuidHob, "gUniversalPayloadPciRootBridgeInfoGuid(Pci
> Guid)"},
>    {&gEfiMemoryTypeInformationGuid,          PrintMemoryTypeInfoGuidHob,    "gEfiMemoryTypeInformationGuid(Memory Type
> Information Guid)"},
> -  {&gUniversalPayloadExtraDataGuid,         PrintExtraDataGuidHob,         "gUniversalPayloadExtraDataGuid(PayLoad Extra Data
> Guid)"}
> +  {&gUniversalPayloadExtraDataGuid,         PrintExtraDataGuidHob,         "gUniversalPayloadExtraDataGuid(PayLoad Extra Data
> Guid)"},
> +  {&gEdkiiBootManagerMenuFileGuid,          PrintBootManagerMenuGuidHob,   "gEdkiiBootManagerMenuFileGuid(Boot
> Manager Menu File Guid)"}
>  };
> 
>  /**
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
> b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
> index 416a620598..3ee449219d 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
> @@ -70,6 +70,7 @@
>    gUniversalPayloadAcpiTableGuid
>    gUniversalPayloadPciRootBridgeInfoGuid
>    gUniversalPayloadSmbios3TableGuid
> +  gEdkiiBootManagerMenuFileGuid
> 
>  [FeaturePcd.IA32]
>    gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode      ## CONSUMES
> --
> 2.31.1.windows.1
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-09 12:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-31  5:38 [Patch V2 0/2] Fix bug in dump guid HOB info funcs and dump info from a new GUID HOB duntan
2021-08-31  5:38 ` [Patch V2 1/2] UefiPayloadPkg: Fix the bug in dump guid HOB info functions duntan
2021-09-09  1:58   ` Zhiguang Liu
2021-09-09 12:22   ` Ni, Ray
2021-08-31  5:38 ` [Patch V2 2/2] UefiPayloadPkg: Dump hob info from gEdkiiBootManagerMenuFileGuid duntan
2021-09-09  1:59   ` [edk2-devel] " Zhiguang Liu
2021-09-09 12:22   ` Ni, Ray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox