From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 8135121954086 for ; Mon, 24 Apr 2017 23:49:42 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP; 24 Apr 2017 23:49:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,248,1488873600"; d="scan'208";a="80561876" Received: from jfan12-desk.ccr.corp.intel.com ([10.239.158.57]) by orsmga004.jf.intel.com with ESMTP; 24 Apr 2017 23:49:41 -0700 From: Jeff Fan To: edk2-devel@lists.01.org Cc: Feng Tian , Michael Kinney Date: Tue, 25 Apr 2017 14:49:38 +0800 Message-Id: <20170425064938.7776-1-jeff.fan@intel.com> X-Mailer: git-send-email 2.9.3.windows.2 Subject: [PATCH] UefiCpuPkg/MpLib.c: Set AP state after X2APIC mode enabled X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Apr 2017 06:49:42 -0000 After X2APIC mode is enabled, APs need to be set tp IDLE state, otherwise APs cannot be waken up by MP PPI services. https://bugzilla.tianocore.org/show_bug.cgi?id=500 Cc: Feng Tian Cc: Michael Kinney Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan --- UefiCpuPkg/Library/MpInitLib/MpLib.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c index 03d6c2d..e502e36 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -434,6 +434,8 @@ CollectProcessorCount ( IN CPU_MP_DATA *CpuMpData ) { + UINTN Index; + // // Send 1st broadcast IPI to APs to wakeup APs // @@ -465,6 +467,12 @@ CollectProcessorCount ( // Enable x2APIC on BSP // SetApicMode (LOCAL_APIC_MODE_X2APIC); + // + // Set BSP/Aps state to IDLE + // + for (Index = 0; Index < CpuMpData->CpuCount; Index++) { + SetApState (&CpuMpData->CpuData[Index], CpuStateIdle); + } } DEBUG ((DEBUG_INFO, "APIC MODE is %d\n", GetApicMode ())); // -- 2.9.3.windows.2