From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 9D54DAC0F3C for ; Fri, 28 Jul 2023 06:25:57 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=iY/SWuviVoNqMKsIJi/gaQXivgYsM4L9ryaz2cie9h0=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-IronPort-AV:X-IronPort-AV:X-Received:X-ExtLoop1:X-IronPort-AV:X-IronPort-AV:X-Received:From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:X-Gm-Message-State:Content-Transfer-Encoding; s=20140610; t=1690525556; v=1; b=iyELS5mFemZld1PvxxD8aw3iELLOiokjkbD6hzWlvLelm1nD8BahLY10MfQuV8udXQjEpqM7 oui4VBPYBiHoJaKedJDjcN96fxEOwhR/+9+apIzflW4W4gOEwAIfj2Ep/HXO8FOd1PO/JpAqNDG X+xM7Z7c61bCIQQwsqMunogY= X-Received: by 127.0.0.2 with SMTP id zfrGYY7687511xm12SL0PHpg; Thu, 27 Jul 2023 23:25:56 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.27043.1690525544496645407 for ; Thu, 27 Jul 2023 23:25:55 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10784"; a="358542725" X-IronPort-AV: E=Sophos;i="6.01,236,1684825200"; d="scan'208";a="358542725" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2023 23:25:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10784"; a="730614960" X-IronPort-AV: E=Sophos;i="6.01,236,1684825200"; d="scan'208";a="730614960" X-Received: from shwdeopenlab705.ccr.corp.intel.com ([10.239.55.55]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2023 23:25:53 -0700 From: "Yuanhao Xie" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann , Yuanhao Xie Subject: [edk2-devel] [Patch V6 4/4] UefiCpuPkg:Wake up APs after power-up or RESET through SIPI. Date: Fri, 28 Jul 2023 14:25:29 +0800 Message-Id: <20230728062529.6312-5-yuanhao.xie@intel.com> In-Reply-To: <20230728062529.6312-1-yuanhao.xie@intel.com> References: <20230728062529.6312-1-yuanhao.xie@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,yuanhao.xie@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: FHzDBFDm05bMtOuKbiJFTdcux7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=iyELS5mF; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io The implementation of this new behavior aligns with the guidelines outlined in the Intel SDM. Following a power-up or RESET of an MP system, system hardware dynamically selects one of the processors on the system bus as the BSP. The remaining processors are designated as APs. The APs complete a minimal self-configuration, then wait for a startup signal (a SIPI message) from the BSP processor. Additionally, the MP protocol is executed only after a power-up or RESET. If the MP protocol has completed and a BSP is chosen, subsequent INITs (either to a specific processor or system wide) do not cause the MP protocol to be repeated. Instead, each logical processor examines its BSP flag (in the IA32_APIC_BASE MSR) to determine whether it should execute the BIOS boot-strap code (if it is the BSP) or enter a wait-for-SIPI state (if it is an AP). Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Signed-off-by: Ray Ni Signed-off-by: Yuanhao Xie Reviewed-by: Ray Ni --- UefiCpuPkg/Library/MpInitLib/MpLib.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c index e7054adbcc..6f1456cfe1 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -1294,7 +1294,14 @@ WakeUpAP ( if (CpuMpData->SevSnpIsEnabled && (CpuMpData->InitFlag != ApInitConfig)) { SevSnpCreateAP (CpuMpData, -1); } else { - SendInitSipiSipiAllExcludingSelf ((UINT32)ExchangeInfo->BufferStart); + if ((CpuMpData->InitFlag == ApInitConfig) && FixedPcdGetBool (PcdFirstTimeWakeUpAPsBySipi)) { + // + // SIPI can be used for the first time wake up after reset to reduce boot time. + // + SendStartupIpiAllExcludingSelf ((UINT32)ExchangeInfo->BufferStart); + } else { + SendInitSipiSipiAllExcludingSelf ((UINT32)ExchangeInfo->BufferStart); + } } } -- 2.36.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107335): https://edk2.groups.io/g/devel/message/107335 Mute This Topic: https://groups.io/mt/100405922/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-