From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 F1F7121A0480E for ; Tue, 25 Apr 2017 01:18:42 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2017 01:18:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,248,1488873600"; d="scan'208";a="1160603937" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 25 Apr 2017 01:18:42 -0700 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 25 Apr 2017 01:18:42 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 25 Apr 2017 01:18:42 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.193]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.224]) with mapi id 14.03.0319.002; Tue, 25 Apr 2017 16:18:38 +0800 From: "Tian, Feng" To: "Fan, Jeff" , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" , "Tian, Feng" Thread-Topic: [PATCH v2] UefiCpuPkg/MpLib.c: Set AP state after X2APIC mode enabled Thread-Index: AQHSvZDHkGGaLjijQEmgIRfp/hGif6HVveXw Date: Tue, 25 Apr 2017 08:18:37 +0000 Message-ID: <7F1BAD85ADEA444D97065A60D2E97EE5699EC328@SHSMSX101.ccr.corp.intel.com> References: <20170425065412.13064-1-jeff.fan@intel.com> In-Reply-To: <20170425065412.13064-1-jeff.fan@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v2] 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 08:18:43 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Feng Tian -----Original Message----- From: Fan, Jeff=20 Sent: Tuesday, April 25, 2017 2:54 PM To: edk2-devel@lists.01.org Cc: Tian, Feng ; Kinney, Michael D Subject: [PATCH v2] UefiCpuPkg/MpLib.c: Set AP state after X2APIC mode enab= led After X2APIC mode is enabled, APs need to be set tp IDLE state, otherwise A= Ps cannot be waken up by MP PPI services. https://bugzilla.tianocore.org/show_bug.cgi?id=3D505 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/MpIn= itLib/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 =3D 0; Index < CpuMpData->CpuCount; Index++) { + SetApState (&CpuMpData->CpuData[Index], CpuStateIdle); + } } DEBUG ((DEBUG_INFO, "APIC MODE is %d\n", GetApicMode ())); // -- 2.9.3.windows.2