public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch V3 0/2] Fix the length and PldHeader for UniversalPayload ExtraData
@ 2021-07-13  7:19 duntan
  2021-07-13  7:19 ` [Patch V3 1/2] MdeModulePkg: Change the PldHeader to Header in ExtraData.h duntan
  2021-07-13  7:19 ` [Patch V3 2/2] UefiPayloadPkg: Assign the length of UniversalPayload ExtraData duntan
  0 siblings, 2 replies; 7+ messages in thread
From: duntan @ 2021-07-13  7:19 UTC (permalink / raw)
  To: devel

Change PldHeader to Header in ExtraData.h
Assign the length and revision of UniversalPayload ExtraData

duntan (2):
  MdeModulePkg: Change the PldHeader to Header in ExtraData.h
  UefiPayloadPkg: Assign the length of UniversalPayload ExtraData

 MdeModulePkg/Include/UniversalPayload/ExtraData.h    | 4 +++-
 UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c | 6 +++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

-- 
2.31.1.windows.1


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

* [Patch V3 1/2] MdeModulePkg: Change the PldHeader to Header in ExtraData.h
  2021-07-13  7:19 [Patch V3 0/2] Fix the length and PldHeader for UniversalPayload ExtraData duntan
@ 2021-07-13  7:19 ` duntan
  2021-07-13  7:44   ` Ni, Ray
  2021-07-13  7:19 ` [Patch V3 2/2] UefiPayloadPkg: Assign the length of UniversalPayload ExtraData duntan
  1 sibling, 1 reply; 7+ messages in thread
From: duntan @ 2021-07-13  7:19 UTC (permalink / raw)
  To: devel; +Cc: Zhiguang Liu, Ray Ni, Jian J Wang, Hao A Wu, DunTan

Change the PldHeader to Header in UNIVERSAL_PAYLOAD_EXTRA_DATA
The meaning of Pld is too general

Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>

Signed-off-by: DunTan <dun.tan@intel.com>
---
 MdeModulePkg/Include/UniversalPayload/ExtraData.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Include/UniversalPayload/ExtraData.h b/MdeModulePkg/Include/UniversalPayload/ExtraData.h
index 146ec845f6..1128f5f47b 100644
--- a/MdeModulePkg/Include/UniversalPayload/ExtraData.h
+++ b/MdeModulePkg/Include/UniversalPayload/ExtraData.h
@@ -18,11 +18,13 @@ typedef struct {
 } UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY;
 
 typedef struct {
-  UNIVERSAL_PAYLOAD_GENERIC_HEADER   PldHeader;
+  UNIVERSAL_PAYLOAD_GENERIC_HEADER   Header;
   UINT32                             Count;
   UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY Entry[0];
 } UNIVERSAL_PAYLOAD_EXTRA_DATA;
 
 #pragma pack()
 
+#define UNIVERSAL_PAYLOAD_EXTRA_DATA_REVISION 1
+
 #endif
-- 
2.31.1.windows.1


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

* [Patch V3 2/2] UefiPayloadPkg: Assign the length of UniversalPayload ExtraData
  2021-07-13  7:19 [Patch V3 0/2] Fix the length and PldHeader for UniversalPayload ExtraData duntan
  2021-07-13  7:19 ` [Patch V3 1/2] MdeModulePkg: Change the PldHeader to Header in ExtraData.h duntan
@ 2021-07-13  7:19 ` duntan
  2021-07-13  7:28   ` Ni, Ray
                     ` (2 more replies)
  1 sibling, 3 replies; 7+ messages in thread
From: duntan @ 2021-07-13  7:19 UTC (permalink / raw)
  To: devel; +Cc: Guo Dong, Ray Ni, Maurice Ma, Benjamin You, DunTan

V1: Assign the length and revision of UniversalPayload ExtraData
V2: Force int to UINT16
V3: Create a local variable to hold the size of ExtraData

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>

Signed-off-by: DunTan <dun.tan@intel.com>
---
 UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
index c619470dbb..141ce86b46 100644
--- a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
+++ b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
@@ -56,6 +56,7 @@ PeiLoadFileLoadPayload (
   UINTN                         Size;
   UINT32                        ExtraDataCount;
   UINTN                         Instance;
+  UINTN                         Length;
 
   //
   // ELF is added to file as RAW section for EDKII bootloader.
@@ -105,11 +106,14 @@ PeiLoadFileLoadPayload (
   //
   // Report the additional PLD sections through HOB.
   //
+  Length = sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA) + ExtraDataCount * sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY);
   ExtraData = BuildGuidHob (
                &gUniversalPayloadExtraDataGuid,
-               sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA) + ExtraDataCount * sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY)
+               Length
                );
   ExtraData->Count = ExtraDataCount;
+  ExtraData->Header.Revision = UNIVERSAL_PAYLOAD_EXTRA_DATA_REVISION;
+  ExtraData->Header.Length = (UINT16) Length;
   if (ExtraDataCount != 0) {
     for (ExtraDataIndex = 0, Index = 0; Index < Context.ShNum; Index++) {
       Status = GetElfSectionName (&Context, Index, &SectionName);
-- 
2.31.1.windows.1


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

* Re: [Patch V3 2/2] UefiPayloadPkg: Assign the length of UniversalPayload ExtraData
  2021-07-13  7:19 ` [Patch V3 2/2] UefiPayloadPkg: Assign the length of UniversalPayload ExtraData duntan
@ 2021-07-13  7:28   ` Ni, Ray
  2021-07-13  7:44   ` Ni, Ray
  2021-07-13 21:00   ` Guo Dong
  2 siblings, 0 replies; 7+ messages in thread
From: Ni, Ray @ 2021-07-13  7:28 UTC (permalink / raw)
  To: Tan, Dun, devel@edk2.groups.io; +Cc: Dong, Guo, Ma, Maurice, You, Benjamin

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

-----Original Message-----
From: Tan, Dun <dun.tan@intel.com> 
Sent: Tuesday, July 13, 2021 3:19 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>; Tan, Dun <dun.tan@intel.com>
Subject: [Patch V3 2/2] UefiPayloadPkg: Assign the length of UniversalPayload ExtraData

V1: Assign the length and revision of UniversalPayload ExtraData
V2: Force int to UINT16
V3: Create a local variable to hold the size of ExtraData

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>

Signed-off-by: DunTan <dun.tan@intel.com>
---
 UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
index c619470dbb..141ce86b46 100644
--- a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
+++ b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
@@ -56,6 +56,7 @@ PeiLoadFileLoadPayload (
   UINTN                         Size;
   UINT32                        ExtraDataCount;
   UINTN                         Instance;
+  UINTN                         Length;
 
   //
   // ELF is added to file as RAW section for EDKII bootloader.
@@ -105,11 +106,14 @@ PeiLoadFileLoadPayload (
   //
   // Report the additional PLD sections through HOB.
   //
+  Length = sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA) + ExtraDataCount * sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY);
   ExtraData = BuildGuidHob (
                &gUniversalPayloadExtraDataGuid,
-               sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA) + ExtraDataCount * sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY)
+               Length
                );
   ExtraData->Count = ExtraDataCount;
+  ExtraData->Header.Revision = UNIVERSAL_PAYLOAD_EXTRA_DATA_REVISION;
+  ExtraData->Header.Length = (UINT16) Length;
   if (ExtraDataCount != 0) {
     for (ExtraDataIndex = 0, Index = 0; Index < Context.ShNum; Index++) {
       Status = GetElfSectionName (&Context, Index, &SectionName);
-- 
2.31.1.windows.1


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

* Re: [Patch V3 1/2] MdeModulePkg: Change the PldHeader to Header in ExtraData.h
  2021-07-13  7:19 ` [Patch V3 1/2] MdeModulePkg: Change the PldHeader to Header in ExtraData.h duntan
@ 2021-07-13  7:44   ` Ni, Ray
  0 siblings, 0 replies; 7+ messages in thread
From: Ni, Ray @ 2021-07-13  7:44 UTC (permalink / raw)
  To: Tan, Dun, devel@edk2.groups.io; +Cc: Liu, Zhiguang, Wang, Jian J, Wu, Hao A

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

-----Original Message-----
From: Tan, Dun <dun.tan@intel.com> 
Sent: Tuesday, July 13, 2021 3:19 PM
To: devel@edk2.groups.io
Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Ni, Ray <ray.ni@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Tan, Dun <dun.tan@intel.com>
Subject: [Patch V3 1/2] MdeModulePkg: Change the PldHeader to Header in ExtraData.h

Change the PldHeader to Header in UNIVERSAL_PAYLOAD_EXTRA_DATA The meaning of Pld is too general

Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>

Signed-off-by: DunTan <dun.tan@intel.com>
---
 MdeModulePkg/Include/UniversalPayload/ExtraData.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Include/UniversalPayload/ExtraData.h b/MdeModulePkg/Include/UniversalPayload/ExtraData.h
index 146ec845f6..1128f5f47b 100644
--- a/MdeModulePkg/Include/UniversalPayload/ExtraData.h
+++ b/MdeModulePkg/Include/UniversalPayload/ExtraData.h
@@ -18,11 +18,13 @@ typedef struct {
 } UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY;
 
 typedef struct {
-  UNIVERSAL_PAYLOAD_GENERIC_HEADER   PldHeader;
+  UNIVERSAL_PAYLOAD_GENERIC_HEADER   Header;
   UINT32                             Count;
   UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY Entry[0];  } UNIVERSAL_PAYLOAD_EXTRA_DATA;
 
 #pragma pack()
 
+#define UNIVERSAL_PAYLOAD_EXTRA_DATA_REVISION 1
+
 #endif
--
2.31.1.windows.1


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

* Re: [Patch V3 2/2] UefiPayloadPkg: Assign the length of UniversalPayload ExtraData
  2021-07-13  7:19 ` [Patch V3 2/2] UefiPayloadPkg: Assign the length of UniversalPayload ExtraData duntan
  2021-07-13  7:28   ` Ni, Ray
@ 2021-07-13  7:44   ` Ni, Ray
  2021-07-13 21:00   ` Guo Dong
  2 siblings, 0 replies; 7+ messages in thread
From: Ni, Ray @ 2021-07-13  7:44 UTC (permalink / raw)
  To: Tan, Dun, devel@edk2.groups.io; +Cc: Dong, Guo, Ma, Maurice, You, Benjamin

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

-----Original Message-----
From: Tan, Dun <dun.tan@intel.com> 
Sent: Tuesday, July 13, 2021 3:19 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>; Tan, Dun <dun.tan@intel.com>
Subject: [Patch V3 2/2] UefiPayloadPkg: Assign the length of UniversalPayload ExtraData

V1: Assign the length and revision of UniversalPayload ExtraData
V2: Force int to UINT16
V3: Create a local variable to hold the size of ExtraData

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>

Signed-off-by: DunTan <dun.tan@intel.com>
---
 UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
index c619470dbb..141ce86b46 100644
--- a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
+++ b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
@@ -56,6 +56,7 @@ PeiLoadFileLoadPayload (
   UINTN                         Size;
   UINT32                        ExtraDataCount;
   UINTN                         Instance;
+  UINTN                         Length;
 
   //
   // ELF is added to file as RAW section for EDKII bootloader.
@@ -105,11 +106,14 @@ PeiLoadFileLoadPayload (
   //
   // Report the additional PLD sections through HOB.
   //
+  Length = sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA) + ExtraDataCount * sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY);
   ExtraData = BuildGuidHob (
                &gUniversalPayloadExtraDataGuid,
-               sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA) + ExtraDataCount * sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY)
+               Length
                );
   ExtraData->Count = ExtraDataCount;
+  ExtraData->Header.Revision = UNIVERSAL_PAYLOAD_EXTRA_DATA_REVISION;
+  ExtraData->Header.Length = (UINT16) Length;
   if (ExtraDataCount != 0) {
     for (ExtraDataIndex = 0, Index = 0; Index < Context.ShNum; Index++) {
       Status = GetElfSectionName (&Context, Index, &SectionName);
-- 
2.31.1.windows.1


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

* Re: [Patch V3 2/2] UefiPayloadPkg: Assign the length of UniversalPayload ExtraData
  2021-07-13  7:19 ` [Patch V3 2/2] UefiPayloadPkg: Assign the length of UniversalPayload ExtraData duntan
  2021-07-13  7:28   ` Ni, Ray
  2021-07-13  7:44   ` Ni, Ray
@ 2021-07-13 21:00   ` Guo Dong
  2 siblings, 0 replies; 7+ messages in thread
From: Guo Dong @ 2021-07-13 21:00 UTC (permalink / raw)
  To: Tan, Dun, devel@edk2.groups.io; +Cc: Ni, Ray, Ma, Maurice, You, Benjamin


Signed-off-by: Guo Dong <guo.dong@intel.com>

> -----Original Message-----
> From: Tan, Dun <dun.tan@intel.com>
> Sent: Tuesday, July 13, 2021 12:19 AM
> 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>; Tan, Dun <dun.tan@intel.com>
> Subject: [Patch V3 2/2] UefiPayloadPkg: Assign the length of
> UniversalPayload ExtraData
> 
> V1: Assign the length and revision of UniversalPayload ExtraData
> V2: Force int to UINT16
> V3: Create a local variable to hold the size of ExtraData
> 
> 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>
> 
> Signed-off-by: DunTan <dun.tan@intel.com>
> ---
>  UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
> b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
> index c619470dbb..141ce86b46 100644
> --- a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
> +++ b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
> @@ -56,6 +56,7 @@ PeiLoadFileLoadPayload (
>    UINTN                         Size;
>    UINT32                        ExtraDataCount;
>    UINTN                         Instance;
> +  UINTN                         Length;
> 
>    //
>    // ELF is added to file as RAW section for EDKII bootloader.
> @@ -105,11 +106,14 @@ PeiLoadFileLoadPayload (
>    //
>    // Report the additional PLD sections through HOB.
>    //
> +  Length = sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA) + ExtraDataCount *
> sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY);
>    ExtraData = BuildGuidHob (
>                 &gUniversalPayloadExtraDataGuid,
> -               sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA) + ExtraDataCount *
> sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY)
> +               Length
>                 );
>    ExtraData->Count = ExtraDataCount;
> +  ExtraData->Header.Revision =
> UNIVERSAL_PAYLOAD_EXTRA_DATA_REVISION;
> +  ExtraData->Header.Length = (UINT16) Length;
>    if (ExtraDataCount != 0) {
>      for (ExtraDataIndex = 0, Index = 0; Index < Context.ShNum; Index++) {
>        Status = GetElfSectionName (&Context, Index, &SectionName);
> --
> 2.31.1.windows.1


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

end of thread, other threads:[~2021-07-13 21:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-13  7:19 [Patch V3 0/2] Fix the length and PldHeader for UniversalPayload ExtraData duntan
2021-07-13  7:19 ` [Patch V3 1/2] MdeModulePkg: Change the PldHeader to Header in ExtraData.h duntan
2021-07-13  7:44   ` Ni, Ray
2021-07-13  7:19 ` [Patch V3 2/2] UefiPayloadPkg: Assign the length of UniversalPayload ExtraData duntan
2021-07-13  7:28   ` Ni, Ray
2021-07-13  7:44   ` Ni, Ray
2021-07-13 21:00   ` Guo Dong

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