From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.26668.1679887050505740187 for ; Sun, 26 Mar 2023 20:17:30 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=ElgniTDT; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: yuanhao.xie@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679887050; x=1711423050; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ErOA4kLn58cxziOME+jC6uZnmYMjaEBm2B9/eOxtp1c=; b=ElgniTDTdF0J16/YmAOqhRs6tXOPNQpKbJVGzbXR799Na0NZpBdpPB3I X08Kzjca7dQeIlfQyNsDOQakS/jWxTfuAzlkqoGMLSFCrI/TITBfC0zwG 51q28SvCL3Jgi2q9SteHiM8iRQ7i7t0prp3wZgfnc/vo5JibdWp5H6cWg rNjcaHOSQ8oYUQwQCz6982xQlLsiADsro4EK8Cbg/w3WnxBUn7BV/fwYh AYXlx7ocY8RLK9ifV3emPnjOHEyIHXXJc3bTtn737svLF1uL8r+8y1DKc CHFT/JnKuHIPmd7bzC8iik2EU2ZVtcPLCiqWdBu4MMNkUzIbBEdwXDoXA A==; X-IronPort-AV: E=McAfee;i="6600,9927,10661"; a="367910223" X-IronPort-AV: E=Sophos;i="5.98,293,1673942400"; d="scan'208";a="367910223" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Mar 2023 20:17:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10661"; a="747836755" X-IronPort-AV: E=Sophos;i="5.98,293,1673942400"; d="scan'208";a="747836755" Received: from xieyuanh-mobl.ccr.corp.intel.com ([10.238.0.208]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Mar 2023 20:17:28 -0700 From: "Yuanhao Xie" To: devel@edk2.groups.io Cc: Guo Dong , Ray Ni , Sean Rhodes , James Lu , Gua Guo Subject: [PATCH 2/2] UefiCpuPkg: After reset, wake up APs by SIPI. Date: Mon, 27 Mar 2023 11:17:11 +0800 Message-Id: <20230327031711.1575-3-yuanhao.xie@intel.com> X-Mailer: git-send-email 2.39.1.windows.1 In-Reply-To: <20230327031711.1575-1-yuanhao.xie@intel.com> References: <20230327031711.1575-1-yuanhao.xie@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following a power-up or RESET, since all APs are already in the “wait-for-SIPI state,” the BSP can broadcast just a single SIPI IPI to the APs to wake them up and initialize them. Cc: Guo Dong Cc: Ray Ni Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Signed-off-by: Yuanhao Xie --- 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 e5dc852ed9..a540b3fe3d 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -1233,7 +1233,14 @@ WakeUpAP ( if (CpuMpData->SevSnpIsEnabled && (CpuMpData->InitFlag != ApInitConfig)) { SevSnpCreateAP (CpuMpData, -1); } else { - SendInitSipiSipiAllExcludingSelf ((UINT32)ExchangeInfo->BufferStart); + if (CpuMpData->InitFlag == ApInitConfig) { + // + // 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