From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: System hang by loading FmpDxexxx.efi. To: devel@edk2.groups.io From: gordontcp@gmail.com X-Originating-Location: Hsinchu, TW (61.222.87.235) X-Originating-Platform: Windows Chrome 101 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Thu, 26 May 2022 22:29:30 -0700 Message-ID: <8iFG.1653629370550878412.9A2c@groups.io> Content-Type: multipart/alternative; boundary="34Xx2pMO8U7I0k2o9g5d" --34Xx2pMO8U7I0k2o9g5d Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable System hang by loading FmpDxexxx.efi. Hi all, I built FmpDevicePkg in tianocore/edk2. Then, I load FmpDxexxx.eif in Emula= torX64 and Minnow Board. It both crashed. I traced the code and found out i= t hang at follows: 1. PcdGetBool (PcdTestKeyUsed); 2. PcdSetBoolS (PcdTestKeyUsed, TRUE); Detail as follows: \edk2\FmpDevicePkg\FmpDxe\ DetectTestKey.c DetectTestKey ( VOID ) { =E2=80=A6. // If PcdTestKeyUsed is already TRUE, then skip test key detection // TestKeyUsed =3D PcdGetBool (PcdTestKeyUsed);=C2=A0 --> system hang .. // If test key detected or an error occurred checking for the test key, the= n // set PcdTestKeyUsed to TRUE. // if (TestKeyUsed) { DEBUG ((DEBUG_INFO, "FmpDxe(%s): Test key detected in PcdFmpDevicePkcs7Cert= BufferXdr.\n", mImageIdName)); PcdSetBoolS (PcdTestKeyUsed, TRUE); --> system hang I modified \MdeModulePkg\MdeModulePkg.dec from [PcdsDynamic, PcdsDynamicEx] gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed|FALSE|BOOLEAN|0x00030003 as below: [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed|FALSE|BOOLEAN|0x00030003 It worked fine. Is it a bug of edk2? --34Xx2pMO8U7I0k2o9g5d Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

System hang by loading FmpDxexxx.efi.

Hi all,

I built FmpDevicePkg in tia= nocore/edk2. Then, I load FmpDxexxx.eif in EmulatorX64 and Minnow Board. It both crashed. I traced the code = and found out it hang at follows:

1.=C2=A0=C2=A0=C2=A0=C2=A0 PcdGetBoo= l (PcdTestKeyUsed);

2.=C2=A0=C2=A0=C2=A0=C2=A0 PcdSetBoo= lS (PcdTestKeyUsed, TRUE);=C2=A0 =

=C2=A0

Detail as follows:

\ed= k2\FmpDevicePkg\FmpDxe\ DetectTestKey.c

=C2=A0 DetectTestKey (

=C2=A0 VOID

=C2=A0 )

=C2=A0 {

=C2=A0=C2=A0 =E2=80=A6.

=C2=A0 // If PcdTestKeyUsed is alrea= dy TRUE, then skip test key detection

=C2=A0 //

=C2=A0 TestKeyUsed =3D PcdGetBool (P= cdTestKeyUsed);=C2=A0 -->syste= m hang

=C2=A0 ..

// = If test key detected or an error occurred checking for the test key, then

=C2=A0 // set PcdTestKeyUsed to TRUE= .

=C2=A0 //

=C2=A0 if (TestKeyUsed) {

=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_INFO, "FmpDxe(%s): Tes= t key detected in PcdFmpDevicePkcs7CertBufferXdr.\n", mImageIdName));

=C2=A0=C2=A0=C2=A0 PcdSetBoolS (PcdT= estKeyUsed, TRUE);=C2=A0 =C2=A0-->=C2=A0system hang

=C2= =A0

I m= odified \MdeModulePkg\MdeModulePkg.dec = =C2=A0from

[Pc= dsDynamic, PcdsDynamicEx]

=C2=A0 gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed|FALSE|= BOOLEAN|0x00030003

as = below:

[Pc= dsPatchableInModule, PcdsDynamic, PcdsDynamicEx]

=C2=A0 gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed|FALSE|= BOOLEAN|0x00030003

=C2=A0

It worked fine.

Is it a bug of edk2?

--34Xx2pMO8U7I0k2o9g5d--