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.31; helo=mga06.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 8599F21B02845 for ; Tue, 24 Jul 2018 20:57:49 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2018 20:57:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,400,1526367600"; d="scan'208";a="69681341" Received: from ydong10-win10.ccr.corp.intel.com ([10.239.9.125]) by orsmga003.jf.intel.com with ESMTP; 24 Jul 2018 20:57:18 -0700 From: Eric Dong To: edk2-devel@lists.01.org Cc: Laszlo Ersek , Ruiyu Ni Date: Wed, 25 Jul 2018 11:57:12 +0800 Message-Id: <20180725035712.8944-4-eric.dong@intel.com> X-Mailer: git-send-email 2.15.0.windows.1 In-Reply-To: <20180725035712.8944-1-eric.dong@intel.com> References: <20180725035712.8944-1-eric.dong@intel.com> Subject: [Patch 3/3] UefiCpuPkg/MpInitLib: Not use disabled AP when call StartAllAPs. 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: Wed, 25 Jul 2018 03:57:49 -0000 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 Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong --- 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