From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 05CE0209603D4 for ; Tue, 15 May 2018 19:17:45 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2018 19:17:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,404,1520924400"; d="scan'208";a="41581203" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga008.jf.intel.com with ESMTP; 15 May 2018 19:17:44 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 15 May 2018 19:17:44 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 15 May 2018 19:17:44 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.79]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.40]) with mapi id 14.03.0319.002; Wed, 16 May 2018 10:17:32 +0800 From: "Zeng, Star" To: "Gao, Liming" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [Patch] MdeModulePkg PeiCore: FvCount to be checked for the registered for shadow PEIM Thread-Index: AQHT7LYkJ+/n8egGokmKq8L0qRnaRqQxnoQQ Date: Wed, 16 May 2018 02:17:32 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BAEC70F@shsmsx102.ccr.corp.intel.com> References: <20180516013501.3472-1-liming.gao@intel.com> In-Reply-To: <20180516013501.3472-1-liming.gao@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] MdeModulePkg PeiCore: FvCount to be checked for the registered for shadow PEIM X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 02:17:46 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng Thanks, Star -----Original Message----- From: Gao, Liming=20 Sent: Wednesday, May 16, 2018 9:35 AM To: edk2-devel@lists.01.org Cc: Zeng, Star Subject: [Patch] MdeModulePkg PeiCore: FvCount to be checked for the regist= ered for shadow PEIM The PEIM in all cached FV image may be in registered for shadow status. Current logic CurrentPeimFvCount is not enough. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao Cc: Star Zeng --- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/C= ore/Pei/Dispatcher/Dispatcher.c index 027176d872..0ac3fdde6a 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -976,7 +976,7 @@ PeiDispatcher ( SaveCurrentFvCount =3D Private->CurrentPeimFvCount; SaveCurrentFileHandle =3D Private->CurrentFileHandle; =20 - for (Index1 =3D 0; Index1 <=3D SaveCurrentFvCount; Index1++) { + for (Index1 =3D 0; Index1 < Private->FvCount; Index1++) { for (Index2 =3D 0; (Index2 < PcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (= Private->Fv[Index1].FvFileHandles[Index2] !=3D NULL); Index2++) { if (Private->Fv[Index1].PeimState[Index2] =3D=3D PEIM_STATE_REGIST= ER_FOR_SHADOW) { PeimFileHandle =3D Private->Fv[Index1].FvFileHandles[Index2]; --=20 2.16.2.windows.1