[edk2] [Patch 3/3] UefiCpuPkg/MpInitLib: Not use disabled AP when call StartAllAPs.

Eric Dong posted 3 patches 7 years, 6 months ago
There is a newer version of this series
[edk2] [Patch 3/3] UefiCpuPkg/MpInitLib: Not use disabled AP when call StartAllAPs.
Posted by Eric Dong 7 years, 6 months ago
Base on UEFI spec requirement, StartAllAPs function should not
use the APs which has been disabled before. This patch just
change current code to follow this rule.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
---
 UefiCpuPkg/Library/MpInitLib/MpLib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index 0e57cc86bf..69f69f2b79 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -1008,8 +1008,8 @@ WakeUpAP (
 
   if (Broadcast) {
     for (Index = 0; Index < CpuMpData->CpuCount; Index++) {
-      if (Index != CpuMpData->BspNumber) {
-        CpuData = &CpuMpData->CpuData[Index];
+      CpuData = &CpuMpData->CpuData[Index];
+      if (Index != CpuMpData->BspNumber && (GetApState (CpuData) != CpuStateDisabled)) {
         CpuData->ApFunction         = (UINTN) Procedure;
         CpuData->ApFunctionArgument = (UINTN) ProcedureArgument;
         SetApState (CpuData, CpuStateReady);
-- 
2.15.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel