From: Wendy Liao Date: Wed, 3 May 2023 03:04:12 +0000 (+0800) Subject: MdeModulePkg/Core/Pei: set AprioriCount=0 before walking through next FV X-Git-Tag: edk2-stable202305 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ba91d0292e593df8528b66f99c1b0b14fadc8e16;p=ovmf.git MdeModulePkg/Core/Pei: set AprioriCount=0 before walking through next FV 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 Cc: Tim Lewis Reported-by: Esther Lee Signed-off-by: Wendy Liao Reviewed-by: Liming Gao --- 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 = NULL; Private->CurrentPeimCount = 0; Private->CurrentFvFileHandles = NULL; + Private->AprioriCount = 0; } //