summaryrefslogtreecommitdiff
path: root/UefiCpuPkg
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2017-10-26 13:55:21 +0800
committerEric Dong <eric.dong@intel.com>2017-10-27 09:34:38 +0800
commit861218740d6d0f6b443f4ef6e170f9524372add8 (patch)
tree3940a84cb196d794630f5167f6e5bfb39f78201c /UefiCpuPkg
parentbf5a306ab5e0b1829b1d59180bc010648f09a32e (diff)
downloadedk2-861218740d6d0f6b443f4ef6e170f9524372add8.zip
edk2-861218740d6d0f6b443f4ef6e170f9524372add8.tar.gz
edk2-861218740d6d0f6b443f4ef6e170f9524372add8.tar.bz2
UefiCpuPkg/MpInitLib: Keep compatible with former AP counting solution.
For some special platforms (such as Ovmf), it is possible that, some APs start up *and finish* before the remaining APs 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> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jeff Fan <vanjeff_919@hotmail.com>
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r--UefiCpuPkg/Library/MpInitLib/MpLib.c21
1 files 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();