From nobody Mon Feb 9 20:13:08 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+107318+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+107318+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1690521515; cv=none; d=zohomail.com; s=zohoarc; b=HzvjEHuTvUYYei/Zs34G8w8KRgbLnEudNjPCYuDPtMVxon9HrjVsFnEd7LgP8nOHT8bB3pTUcJwsVA9aEYyLl2pREvEukdP/Y9cuZIfb4eMXh1TWfi/WvKOqmo5NY80DOBXr8TLwLElB5ZA2jciHIoCixBRG5fCrBKK6S//zy1U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690521515; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Fda6/GIpLojuKY26Ic3rZIyYLBggTNll8OBAH7DX55Q=; b=HHswt1kRTL9A5rc0VNXgexu6QKNePUu3olea0VKkLWfHs+ZWLEbWai5JqzcsAuqCbjRJ2+j91HaARxu4PX8h/Ubh2m4FWs1XW8IGllZzTQ6/umWGvKamxE0GpBbERC07b66xTfvMNO68GLV93UjG6oPq4UwKcfrTwcG6xnYA3YE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+107318+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1690521515437159.17376085017042; Thu, 27 Jul 2023 22:18:35 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=JdFSoEmdeolIxiWHp8EoEWOa4rT53Lt/gtMC1UPSXJ4=; 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=1690521515; v=1; b=dUym0UoNI4qiy8jbOilqcxDcaEyhnKpNBnLy9G2OeG5Qu4qEx3EoXZ9IYaoqrUnQNG+Xx5hJ sb60xJsU7ZxjfpLyCtLk04V3+Q+vumNXYYgJG+o4QenakZeTBqWQv8Es7Vv1IKNjgBoOXhQiOCZ rZpcjuRfG5CXwpg9q+ipStrU= X-Received: by 127.0.0.2 with SMTP id gYqMYY1788612xu5QaQ2dFFO; Thu, 27 Jul 2023 22:18:35 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.26393.1690521501693824176 for ; Thu, 27 Jul 2023 22:18:34 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10784"; a="365969222" X-IronPort-AV: E=Sophos;i="6.01,236,1684825200"; d="scan'208";a="365969222" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2023 22:18:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10784"; a="757009129" X-IronPort-AV: E=Sophos;i="6.01,236,1684825200"; d="scan'208";a="757009129" X-Received: from shwdeopenlab705.ccr.corp.intel.com ([10.239.55.55]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2023 22:18:32 -0700 From: "Yuanhao Xie" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann , Yuanhao Xie Subject: [edk2-devel] [Patch V4 4/4] UefiCpuPkg:Wake up APs after power-up or RESET through SIPI. Date: Fri, 28 Jul 2023 13:18:05 +0800 Message-Id: <20230728051805.6250-5-yuanhao.xie@intel.com> In-Reply-To: <20230728051805.6250-1-yuanhao.xie@intel.com> References: <20230728051805.6250-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: gpUeHdXcxqSL1k9hEoLicSAhx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1690521516558100007 Content-Type: text/plain; charset="utf-8" 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/MpIn= itLib/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 !=3D ApInitCo= nfig)) { SevSnpCreateAP (CpuMpData, -1); } else { - SendInitSipiSipiAllExcludingSelf ((UINT32)ExchangeInfo->BufferStar= t); + if ((CpuMpData->InitFlag =3D=3D ApInitConfig) && FixedPcdGetBool (= PcdFirstTimeWakeUpAPsBySipi)) { + // + // SIPI can be used for the first time wake up after reset to re= duce boot time. + // + SendStartupIpiAllExcludingSelf ((UINT32)ExchangeInfo->BufferStar= t); + } else { + SendInitSipiSipiAllExcludingSelf ((UINT32)ExchangeInfo->BufferSt= art); + } } } =20 --=20 2.36.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107318): https://edk2.groups.io/g/devel/message/107318 Mute This Topic: https://groups.io/mt/100405497/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-