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=ruiyu.ni@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 DB172210C2791 for ; Wed, 25 Jul 2018 22:23:12 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2018 22:23:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,403,1526367600"; d="scan'208";a="60777981" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga006.jf.intel.com with ESMTP; 25 Jul 2018 22:23:08 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 25 Jul 2018 22:23:03 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 25 Jul 2018 22:23:02 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.81]) by shsmsx102.ccr.corp.intel.com ([169.254.2.124]) with mapi id 14.03.0319.002; Thu, 26 Jul 2018 13:23:00 +0800 From: "Ni, Ruiyu" To: "Dong, Eric" , "edk2-devel@lists.01.org" CC: Laszlo Ersek Thread-Topic: [edk2] [Patch v3 2/3] UefiCpuPkg/MpInitLib: Remove StartCount and volatile definition. Thread-Index: AQHUI+xXwM7DMxmbPEigGZJicso10KSg+ZOQ Date: Thu, 26 Jul 2018 05:22:51 +0000 Deferred-Delivery: Thu, 26 Jul 2018 05:23:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BD8C1CA@SHSMSX104.ccr.corp.intel.com> References: <20180725075020.240-1-eric.dong@intel.com> <20180725075020.240-3-eric.dong@intel.com> In-Reply-To: <20180725075020.240-3-eric.dong@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch v3 2/3] UefiCpuPkg/MpInitLib: Remove StartCount and volatile definition. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2018 05:23:13 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni Thanks/Ray > -----Original Message----- > From: edk2-devel On Behalf Of Eric Dong > Sent: Wednesday, July 25, 2018 3:50 PM > To: edk2-devel@lists.01.org > Cc: Ni, Ruiyu ; Laszlo Ersek > Subject: [edk2] [Patch v3 2/3] UefiCpuPkg/MpInitLib: Remove StartCount an= d > volatile definition. >=20 > The StartCount is duplicated with RunningCount, replace it with RunningCo= unt. > Also the volatile for RunningCount is not needed. >=20 > Cc: Laszlo Ersek > Cc: Ruiyu Ni > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Eric Dong > --- > UefiCpuPkg/Library/MpInitLib/MpLib.c | 11 +++++------ > UefiCpuPkg/Library/MpInitLib/MpLib.h | 3 +-- > 2 files changed, 6 insertions(+), 8 deletions(-) >=20 > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c > b/UefiCpuPkg/Library/MpInitLib/MpLib.c > index ff09a0e9e7..0e57cc86bf 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c > @@ -1424,7 +1424,7 @@ CheckAllAPs ( > // value of state after setting the it to CpuStateIdle, so BSP can s= afely make > use of its value. > // > if (GetApState(CpuData) =3D=3D CpuStateIdle) { > - CpuMpData->RunningCount ++; > + CpuMpData->RunningCount --; > CpuMpData->CpuData[ProcessorNumber].Waiting =3D FALSE; >=20 > // > @@ -1449,7 +1449,7 @@ CheckAllAPs ( > // > // If all APs finish, return EFI_SUCCESS. > // > - if (CpuMpData->RunningCount =3D=3D CpuMpData->StartCount) { > + if (CpuMpData->RunningCount =3D=3D 0) { > return EFI_SUCCESS; > } >=20 > @@ -1466,7 +1466,7 @@ CheckAllAPs ( > // > if (CpuMpData->FailedCpuList !=3D NULL) { > *CpuMpData->FailedCpuList =3D > - AllocatePool ((CpuMpData->StartCount - CpuMpData->FinishedCount= + 1) > * sizeof (UINTN)); > + AllocatePool ((CpuMpData->RunningCount + 1) * sizeof (UINTN)); > ASSERT (*CpuMpData->FailedCpuList !=3D NULL); > } > ListIndex =3D 0; > @@ -2212,7 +2212,7 @@ StartupAllAPsWorker ( > return EFI_NOT_STARTED; > } >=20 > - CpuMpData->StartCount =3D 0; > + CpuMpData->RunningCount =3D 0; > for (ProcessorNumber =3D 0; ProcessorNumber < ProcessorCount; > ProcessorNumber++) { > CpuData =3D &CpuMpData->CpuData[ProcessorNumber]; > CpuData->Waiting =3D FALSE; > @@ -2222,7 +2222,7 @@ StartupAllAPsWorker ( > // Mark this processor as responsible for current calling. > // > CpuData->Waiting =3D TRUE; > - CpuMpData->StartCount++; > + CpuMpData->RunningCount++; > } > } > } > @@ -2231,7 +2231,6 @@ StartupAllAPsWorker ( > CpuMpData->ProcArguments =3D ProcedureArgument; > CpuMpData->SingleThread =3D SingleThread; > CpuMpData->FinishedCount =3D 0; > - CpuMpData->RunningCount =3D 0; > CpuMpData->FailedCpuList =3D FailedCpuList; > CpuMpData->ExpectedTime =3D CalculateTimeout ( > TimeoutInMicroseconds, diff --git > a/UefiCpuPkg/Library/MpInitLib/MpLib.h > b/UefiCpuPkg/Library/MpInitLib/MpLib.h > index 962bce685d..5002b7e9c0 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h > @@ -211,9 +211,8 @@ struct _CPU_MP_DATA { > UINTN BackupBuffer; > UINTN BackupBufferSize; >=20 > - volatile UINT32 StartCount; > volatile UINT32 FinishedCount; > - volatile UINT32 RunningCount; > + UINT32 RunningCount; > BOOLEAN SingleThread; > EFI_AP_PROCEDURE Procedure; > VOID *ProcArguments; > -- > 2.15.0.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel