From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg/DebugPrintErrorLevelLibHob To: Ning Feng ,devel@edk2.groups.io From: "Ning Feng" X-Originating-Location: CN (192.102.204.51) X-Originating-Platform: Windows Chrome 108 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Sun, 08 Jan 2023 17:43:51 -0800 References: In-Reply-To: Message-ID: <17862.1673228631374126366@groups.io> Content-Type: multipart/alternative; boundary="cZqAXnvF3RyZju1Tk6sG" --cZqAXnvF3RyZju1Tk6sG Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable fix debug print error level hob not save correct debugprinterrorlevel should cover the case: Header.Lenth =3D=3DUNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD () Change-Id: Ibebe29fe8057e24448b31a8caa7ab6eb8054c39b BugZilla: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4264 Signed-off-by: Ning Feng < ning.feng@intel.com > --- .../DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c=C2=A0=C2=A0=C2= =A0=C2=A0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintEr= rorLevelLibHob.c b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugP= rintErrorLevelLibHob.c index 4f6b4ef1fb..10bdbe2bbc 100644 --- a/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLeve= lLibHob.c +++ b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorL +++ evelLibHob.c @@ -46,7 +46,7 @@ GetDebugPrintErrorLevel ( {=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (GenericHeader->Revisi= on =3D=3D UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION) {=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DebugPrintErrorLevel =3D=C2= =A0 (UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL *)GET_GUID_HOB_DATA (GuidHob);-= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (DebugPrintErrorL= evel->Header.Length > UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD (UEFI_PAYLOAD_= DEBUG_PRINT_ERROR_LEVEL, ErrorLevel)) {+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 if (DebugPrintErrorLevel->Header.Length >=3D UNIVERSA= L_PAYLOAD_SIZEOF_THROUGH_FIELD (UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL, Error= Level)) {=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 gDebugPrintErrorLevel =3D DebugPrintErrorLevel->ErrorLevel;=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0}=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 }-- 2.25.1 --cZqAXnvF3RyZju1Tk6sG Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

fix debug print error level = hob not save correct debugprinterrorlevel

 

should cover the case:

 

Header.Lenth =3D=3DUNIVERSAL= _PAYLOAD_SIZEOF_THROUGH_FIELD ()

 

Change-Id: Ibebe29fe8057e244= 48b31a8caa7ab6eb8054c39b

BugZilla: https://bugzilla.tianocore.= org/show_bug.cgi?id=3D4264

Signed-off-by: Ning Feng <= ;ning.feng@intel.com><= /p>

---

 .../DebugPrintErrorLev= elLibHob/DebugPrintErrorLevelLibHob.c     | 2 +-=

 1 file changed, 1 inse= rtion(+), 1 deletion(-)

 

diff --git a/UefiPayloadPkg/= Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c b/UefiPaylo= adPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c

index 4f6b4ef1fb..10bdbe2bbc= 100644

--- a/UefiPayloadPkg/Library= /DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c

+++ b/UefiPayloadPkg/Library= /DebugPrintErrorLevelLibHob/DebugPrintErrorL

+++ evelLibHob.c

@@ -46,7 +46,7 @@ GetDebugPr= intErrorLevel (

    &nbs= p;  {         if (GenericHeade= r->Revision =3D=3D UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION) { = ;          DebugPrintErrorLeve= l =3D  (UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL *)GET_GUID_HOB_DATA (Guid= Hob);-          if (DebugPrint= ErrorLevel->Header.Length > UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD (U= EFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL, ErrorLevel)) {+    = ;      if (DebugPrintErrorLevel->Header.Length = >=3D UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD (UEFI_PAYLOAD_DEBUG_PRINT_ER= ROR_LEVEL, ErrorLevel)) {        &n= bsp;    gDebugPrintErrorLevel =3D DebugPrintErrorLevel->E= rrorLevel;           }&nb= sp;        }--

2.25.1

--cZqAXnvF3RyZju1Tk6sG--