]> xenbits.xensource.com Git - ovmf.git/commitdiff
MdeModulePkg/Core/Pei: set AprioriCount=0 before walking through next FV master edk2-stable202305
authorWendy Liao <wendy.liao@insyde.com>
Wed, 3 May 2023 03:04:12 +0000 (11:04 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 24 May 2023 12:59:54 +0000 (12:59 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4438

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 through
to a scaned FV, even the peim is not set in APRIORI file.

Cc: Leon Chen <leon.chen@insyde.com>
Cc: Tim Lewis <tim.lewis@insyde.com>
Reported-by: Esther Lee <esther.lee@insyde.com>
Signed-off-by: Wendy Liao <wendy.liao@insyde.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c

index d8284f9f4f34baf283d5d8276b08f56da5355ddc..5f32ebb560ae792b51b7f52960c015d563f109aa 100644 (file)
@@ -1630,6 +1630,7 @@ PeiDispatcher (
       Private->CurrentFileHandle    = NULL;\r
       Private->CurrentPeimCount     = 0;\r
       Private->CurrentFvFileHandles = NULL;\r
       Private->CurrentFileHandle    = NULL;\r
       Private->CurrentPeimCount     = 0;\r
       Private->CurrentFvFileHandles = NULL;\r
+      Private->AprioriCount         = 0;\r
     }\r
 \r
     //\r
     }\r
 \r
     //\r