From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from cxsh.intel-email.com (cxsh.intel-email.com [121.46.250.151]) by mx.groups.io with SMTP id smtpd.web11.37543.1683773636484955449 for ; Wed, 10 May 2023 19:53:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@byosoft.com.cn header.s=cloud-union header.b=S3O6cgB6; spf=pass (domain: byosoft.com.cn, ip: 121.46.250.151, mailfrom: gaoliming@byosoft.com.cn) Received: from cxsh.intel-email.com (localhost [127.0.0.1]) by cxsh.intel-email.com (Postfix) with ESMTP id B6D56DDA795 for ; Thu, 11 May 2023 10:53:53 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=byosoft.com.cn; s=cloud-union; t=1683773633; bh=lxRROASwuBKisl5FUeLuaUFGFoFLkmmUPJTSY8sLpWM=; h=From:To:Cc:References:In-Reply-To:Subject:Date; b=S3O6cgB6AcxLc/xKyN5VsLWoUZoDkLi3qMqY9XPNhN1BPly8HPWJA5/q0GdzCPHRG JctC8mH5oA+CAlUKT0V463kSXywPFfbs1n1u5KfFAU9b68/DMCzTgjgv1Dr+PsCwvs 0QzvPumQU33Uq+/7DmKyGRhgA2YTTilhKFcUDYSk= Received: from localhost (localhost [127.0.0.1]) by cxsh.intel-email.com (Postfix) with ESMTP id B217DDDA7C0 for ; Thu, 11 May 2023 10:53:53 +0800 (CST) Received: from cxsh.intel-email.com (localhost [127.0.0.1]) by cxsh.intel-email.com (Postfix) with ESMTP id 81905DDA7BF for ; Thu, 11 May 2023 10:53:53 +0800 (CST) Authentication-Results: cxsh.intel-email.com; none Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by cxsh.intel-email.com (Postfix) with SMTP id 1170DDDA798 for ; Thu, 11 May 2023 10:53:50 +0800 (CST) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Thu, 11 May 2023 10:53:46 +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'" References: <009501d983a8$6295f740$27c1e5c0$@byosoft.com.cn> <50fc03ee-969b-49aa-3edd-e05c049c0b2e@insyde.com> In-Reply-To: <50fc03ee-969b-49aa-3edd-e05c049c0b2e@insyde.com> Subject: =?UTF-8?B?5Zue5aSNOiDlm57lpI06IFtlZGsyLWRldmVsXSBbUEFUQ0hdIE1kZU1vZHVsZVBrZy9Db3JlL1BlaTogc2V0IEFwcmlvcmlDb3VudD0wIGJlZm9yZSB3YWxraW5nIHRocm91Z2ggbmV4dCBGVg==?= Date: Thu, 11 May 2023 10:53:49 +0800 Message-ID: <00cb01d983b3$d02f3680$708da380$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQH2yNGBCnpIRGUa2a6teZxJdqoDyQLxgwbTAidLtIau8Q2EUA== Sender: "gaoliming" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Wendy: I understand the problem now. Your fix is correct. Reviewed-by: Liming Ga= o This is a bug fix. I suggest to 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=8811=E6=97=A5 = 10:23 > =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: [edk2-devel] [PATCH] MdeModul= ePkg/Core/Pei: set > AprioriCount=3D0 before walking through next FV >=20 > Hi gaoliming, >=20 > DiscoverPeimsAndOrderWithApriori () will not reset Private->AprioriCount > 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. >=20 > 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 >=20 > Scan loop 2 > [FV1] > Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount =3D 1, > CoreFileHandle->ScanFv =3D TRUE > After DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount =3D > 1, CoreFileHandle->ScanFv =3D TRUE >=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 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 sca= ns, > 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 Ap= rioriCount=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->AprioriCount > >> 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 throu= gh > >> 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