public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Fan Jeff <vanjeff_919@hotmail.com>
To: "eric.dong@intel.com" <eric.dong@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>, Laszlo Ersek <lersek@redhat.com>
Subject: Re: [Patch] UefiCpuPkg/MpInitLib: Keep compatible with former solution.
Date: Thu, 26 Oct 2017 07:17:34 +0000	[thread overview]
Message-ID: <CY1PR19MB0283F7381B18E0535D2BFA66D7450@CY1PR19MB0283.namprd19.prod.outlook.com> (raw)

Reviewed-by: Jeff Fan <vanjeff_919@hotmail.com<mailto:vanjeff_919@hotmail.com>>



发自我的小米手机
在 Eric Dong <eric.dong@intel.com>,2017年10月26日 下午1:59写道:

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
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 <ruiyu.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Jeff Fan <vanjeff_919@hotmail.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
---
 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 == 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 == 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 initialzation.
+      // In this case, the later while loop is useless.
+      //
+      TimedWaitForApFinish (
+        CpuMpData,
+        PcdGet32 (PcdCpuMaxLogicalProcessorNumber) - 1,
+        PcdGet32 (PcdCpuApInitTimeOutInMicroSeconds)
+        );

       while (CpuMpData->MpCpuExchangeInfo->NumApsExecuting != 0) {
         CpuPause();
--
2.7.0.windows.1


             reply	other threads:[~2017-10-26  7:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26  7:17 Fan Jeff [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-10-26  5:59 [Patch] UefiCpuPkg/MpInitLib: Keep compatible with former solution Eric Dong
2017-10-26  8:25 ` Laszlo Ersek
2017-10-27  1:38   ` Dong, Eric

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CY1PR19MB0283F7381B18E0535D2BFA66D7450@CY1PR19MB0283.namprd19.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox