From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from walk.intel-email.com (walk.intel-email.com [101.227.64.242]) by mx.groups.io with SMTP id smtpd.web11.9126.1684200236738030016 for ; Mon, 15 May 2023 18:23:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@byosoft.com.cn header.s=cloud-union header.b=kYdZVKaG; spf=pass (domain: byosoft.com.cn, ip: 101.227.64.242, mailfrom: gaoliming@byosoft.com.cn) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 36EC0CD1F6C5 for ; Tue, 16 May 2023 09:23:54 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=byosoft.com.cn; s=cloud-union; t=1684200234; bh=JISekosMvOD3azr/niPQbJ1PjXt9v3iCsoUE9OP+q4o=; h=From:To:Cc:References:In-Reply-To:Subject:Date; b=kYdZVKaGOfvfKMXdY42eoyYhJ4x3gX6vOUiuo5FbluoRb2NNMCvTqxGY5bTeOTPkK VG4G4MHlrlRbCA6JqGtBvmqIJluTN5SXYL7g9UerrIotyOMfFNOF7pImPKE6yAdH4S KgN23hpx4A82F2iR6L7t67/clWm03/PeRh/umnLw= Received: from localhost (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 326B7CD1F6BB for ; Tue, 16 May 2023 09:23:54 +0800 (CST) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 0723BCD1F631 for ; Tue, 16 May 2023 09:23:54 +0800 (CST) Authentication-Results: walk.intel-email.com; none Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by walk.intel-email.com (Postfix) with SMTP id 93DDCCD1F65C for ; Tue, 16 May 2023 09:23:51 +0800 (CST) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Tue, 16 May 2023 09:23:42 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , Cc: "'Leon Chen'" , "'Tim Lewis'" , "'Michael D Kinney'" , "'Andrew Fish'" , "'Demeter, Miki'" , "'Leif Lindholm'" References: <009501d983a8$6295f740$27c1e5c0$@byosoft.com.cn> <50fc03ee-969b-49aa-3edd-e05c049c0b2e@insyde.com> <00cb01d983b3$d02f3680$708da380$@byosoft.com.cn> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiDlm57lpI06IOWbnuWkjTogW2VkazItc3RhYmxlMjAyMzA1XSBbUEFUQ0hdIE1kZU1vZHVsZVBrZy9Db3JlL1BlaTogc2V0IEFwcmlvcmlDb3VudD0wIGJlZm9yZSB3YWxraW5nIHRocm91Z2ggbmV4dCBGVg==?= Date: Tue, 16 May 2023 09:23:44 +0800 Message-ID: <001101d98795$0ebc2b30$2c348190$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdmHlIwtKvj0Xf7aTBGtHcSB37snlg== Sender: "gaoliming" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Wendy: I agree this is bug fix in PeiCore to support more than one FV images tho= se all have apriori list. If no other comments, I will merge it for this stable tag 202305.=20 Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io = =E4=BB=A3=E8=A1=A8 Wendy Liao > via groups.io > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2023=E5=B9=B45=E6=9C=8815=E6=97=A5 = 13:18 > =E6=94=B6=E4=BB=B6=E4=BA=BA: gaoliming ; devel@= edk2.groups.io > =E6=8A=84=E9=80=81: 'Leon Chen' ; 'Tim Lewis' > > =E4=B8=BB=E9=A2=98: Re: =E5=9B=9E=E5=A4=8D: =E5=9B=9E=E5=A4=8D: [edk2-dev= el] [PATCH] MdeModulePkg/Core/Pei: set > AprioriCount=3D0 before walking through next FV >=20 > Hi Liming, >=20 > Merged https://github.com/tianocore/edk2/pull/4397 > Thank you. >=20 > Best Regards, >=20 > Wendy Liao > Insyde Software Corp. > Phone: +886-2-6608-3688 Ext.8731 >=20 > gaoliming =E6=96=BC 2023/05/11 =E4=B8=8A=E5=8D=88 10:53 =E5=AF=AB=E9=81= =93: > > Wendy: > > I understand the problem now. Your fix is correct. Reviewed-by: Limi= ng > Gao > > > > This is a bug fix. I suggest to merge it for this stable tag 202305. > > > > Thanks > > Liming > >> -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > >> =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io =E4=BB=A3=E8=A1=A8 Wendy > Liao > >> via groups.io > >> =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2023=E5=B9=B45=E6=9C=8811=E6=97= =A5 10:23 > >> =E6=94=B6=E4=BB=B6=E4=BA=BA: gaoliming ; dev= el@edk2.groups.io > >> =E6=8A=84=E9=80=81: 'Leon Chen' ; 'Tim Lewis' > >> > >> =E4=B8=BB=E9=A2=98: Re: =E5=9B=9E=E5=A4=8D: [edk2-devel] [PATCH] MdeMo= dulePkg/Core/Pei: set > >> AprioriCount=3D0 before walking through next FV > >> > >> Hi gaoliming, > >> > >> DiscoverPeimsAndOrderWithApriori () will not reset Private->AprioriCou= nt > >> to Zero when CoreFileHandle->ScanFv =3D TRUE. > >> DiscoverPeimsAndOrderWithApriori () { > >> ... > >> if (CoreFileHandle->ScanFv) { > >> Private->CurrentFvFileHandles =3D CoreFileHandle->FvFileHandles; > >> return; > >> } > >> ... > >> } > >> After go through all FV and the last FV has one or more Apriori Peim, > >> Private->AprioriCount will not be reset to 0 anymore. > >> > >> Scan loop 1 > >> [FV1] > >> Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount =3D= 0, > >> CoreFileHandle->ScanFv =3D FALSE > >> After DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount = =3D > >> 2, CoreFileHandle->ScanFv =3D TRUE > >> [FV2] > >> Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount =3D= 2, > >> CoreFileHandle->ScanFv =3D FALSE > >> After DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount = =3D > >> 0, CoreFileHandle->ScanFv =3D TRUE > >> ... > >> [FVn] > >> Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount =3D= 0, > >> CoreFileHandle->ScanFv =3D FALSE > >> After DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount = =3D > >> 1, CoreFileHandle->ScanFv =3D TRUE > >> > >> Scan loop 2 > >> [FV1] > >> Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount =3D= 1, > >> CoreFileHandle->ScanFv =3D TRUE > >> After DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount = =3D > >> 1, CoreFileHandle->ScanFv =3D TRUE > >> > >> Best Regards, > >> > >> Wendy Liao > >> Insyde Software Corp. > >> Phone: +886-2-6608-3688 Ext.8731 > >> > >> gaoliming =E6=96=BC 2023/05/11 =E4=B8=8A=E5=8D=88 09:32 =E5=AF=AB=E9= =81=93: > >>> Wendy: > >>> DiscoverPeimsAndOrderWithApriori () has the logic to reset > >> Private->AprioriCount as zero. > >>> It will set the real AprioriCount for each FV when this FV first = scans, > >> then dispatch the peims in the apriori list. > >>> So, I don't think there is the issue here. Do you find the real > >> functionality issue? > >>> Thanks > >>> Liming > >>>> -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > >>>> =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io =E4=BB=A3=E8=A1=A8 Wendy > >> Liao > >>>> via groups.io > >>>> =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2023=E5=B9=B45=E6=9C=8810=E6= =97=A5 14:23 > >>>> =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > >>>> =E6=8A=84=E9=80=81: Leon Chen ; Tim Lewis > >>>> > >>>> =E4=B8=BB=E9=A2=98: [edk2-devel] [PATCH] MdeModulePkg/Core/Pei: set > AprioriCount=3D0 > >>>> before walking through next FV > >>>> > >>>> > >>>> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D4438 > >>>> > >>>> The main dispatch loop in PeiDispatcher() goes through each FV and > >>>> calls DiscoverPeimsAndOrderWithApriori() to search Apriori file to > >>>> reorder all PEIMs then do the PEIM dispatched. > >>>> > >>>> DiscoverPeimsAndOrderWithApriori() calculates Apriori file count for > >>>> every FV once and set Private->AprioriCount, but Private->AprioriCou= nt > >>>> doesn't be set to 0 before dispatch loop walking through the next FV= . > >>>> > >>>> It causes the peim which sort on less than Private->AprioriCount and > >>>> depex is not satisfied would be dispatched when dispatch loop go > through > >>>> to a scaned FV, even the peim is not set in APRIORI file. > >>>> > >>>> Cc: Leon Chen > >>>> Cc: Tim Lewis > >>>> Reported-by: Esther Lee > >>>> Signed-off-by: Wendy Liao > >>>> > >>>> --- > >>>> MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 1 + > >>>> 1 file changed, 1 insertion(+) > >>>> > >>>> diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c > >>>> b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c > >>>> index d8284f9f4f..5f32ebb560 100644 > >>>> --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c > >>>> +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c > >>>> @@ -1630,6 +1630,7 @@ PeiDispatcher ( > >>>> Private->CurrentFileHandle =3D NULL; > >>>> Private->CurrentPeimCount =3D 0; > >>>> Private->CurrentFvFileHandles =3D NULL; > >>>> + Private->AprioriCount =3D 0; > >>>> } > >>>> > >>>> // > >>>> -- > >>>> 2.29.2.windows.2 > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>> > >> > >> > >> > > > > >=20 >=20 >=20 >=20