From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 745292034A877 for ; Thu, 26 Oct 2017 18:35:09 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP; 26 Oct 2017 18:38:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,302,1505804400"; d="scan'208";a="167672075" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 26 Oct 2017 18:38:55 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 26 Oct 2017 18:38:54 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.175]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Fri, 27 Oct 2017 09:38:53 +0800 From: "Dong, Eric" To: Laszlo Ersek , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" Thread-Topic: [edk2] [Patch] UefiCpuPkg/MpInitLib: Keep compatible with former solution. Thread-Index: AQHTTh+8ng9xZ6oWB0KEFy/Pbf0FAaL1RawAgAGmf8A= Date: Fri, 27 Oct 2017 01:38:52 +0000 Message-ID: References: <1508997586-2492-1-git-send-email-eric.dong@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] UefiCpuPkg/MpInitLib: Keep compatible with former solution. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Oct 2017 01:35:09 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Laszlo, Update both and pushed the change at 86121874. Thanks, Eric > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Laszlo Ersek > Sent: Thursday, October 26, 2017 4:26 PM > To: Dong, Eric ; edk2-devel@lists.01.org > Cc: Ni, Ruiyu > Subject: Re: [edk2] [Patch] UefiCpuPkg/MpInitLib: Keep compatible with > former solution. >=20 > On 10/26/17 07:59, Eric Dong wrote: > > For some special platforms (such as Ovmf), it is possible that, some > > APs start up *and finish* before the remaining APs not start up *at > > all*. In this case, the enhance >=20 > (1) I think the word "not" should be removed from the above line, so that= we > get: "some APs start up *and finish* before the remaining APs [] start up= *at > all*". >=20 > (2) For the subject line: can we add "AP counting" or "AP collection" > somehow? For example: >=20 > UefiCpuPkg/MpInitLib: Keep compatible with former AP counting solution. >=20 >=20 > I don't insist, but I think these changes would improve the commit messag= e. > They can be implemented before pushing. Either way, >=20 > Reviewed-by: Laszlo Ersek >=20 > Thank you for the quick update, Eric and Jeff! > Laszlo >=20 > > solution by changes 0594ec41 not works as expected. > > > > This change remove check CpuMpData->CpuCount logic to let old solution > > still workable if platform owner still set a long time for > > PcdCpuApInitTimeOutInMicroSeconds. It's platform owner's response to > > decide which solution to use. > > > > Cc: Ruiyu Ni > > Cc: Laszlo Ersek > > Cc: Jeff Fan > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Eric Dong > > --- > > UefiCpuPkg/Library/MpInitLib/MpLib.c | 21 +++++++++++++-------- > > 1 file changed, 13 insertions(+), 8 deletions(-) > > > > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c > > b/UefiCpuPkg/Library/MpInitLib/MpLib.c > > index 48f930b..18060fd 100644 > > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c > > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c > > @@ -936,15 +936,20 @@ WakeUpAP ( > > } > > if (CpuMpData->InitFlag =3D=3D ApInitConfig) { > > // > > - // Wait for one potential AP waken up in one specified period > > + // Here support two methods to collect AP count through adjust > > + // PcdCpuApInitTimeOutInMicroSeconds values. > > // > > - if (CpuMpData->CpuCount =3D=3D 0) { > > - TimedWaitForApFinish ( > > - CpuMpData, > > - PcdGet32 (PcdCpuMaxLogicalProcessorNumber) - 1, > > - PcdGet32 (PcdCpuApInitTimeOutInMicroSeconds) > > - ); > > - } > > + // one way is set a value to just let the first AP to start the > > + // initialization, then through the later while loop to wait all= Aps > > + // finsh the initialization. > > + // The other way is set a value to let all APs finished the init= ialzation. > > + // In this case, the later while loop is useless. > > + // > > + TimedWaitForApFinish ( > > + CpuMpData, > > + PcdGet32 (PcdCpuMaxLogicalProcessorNumber) - 1, > > + PcdGet32 (PcdCpuApInitTimeOutInMicroSeconds) > > + ); > > > > while (CpuMpData->MpCpuExchangeInfo->NumApsExecuting !=3D 0) { > > CpuPause(); > > >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel