From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.11788.1687942151408549511 for ; Wed, 28 Jun 2023 01:49:11 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=dfsnE0zi; spf=pass (domain: intel.com, ip: 192.55.52.136, 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=1687942151; x=1719478151; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=laMRICOAKrGUsQaN4X0f0AWI0edKo2rWSrXCB+dBZb4=; b=dfsnE0ziUfq7fGn8MjoVoCXV9GcqEMujKNPXeYXN5sw25Ugw3AtyXy2m Z5z7EVFHeCdg75o5S6fupM1HgEjCzygm6oGvsRUzSg6EMNSEHqkD4ihfh Tid/CGYwGymC4C8IabJ4HbQNPu52XdYdaUSqkZrT/gsxgyiH2YSkE155s o8CsRNQPROMh2ZVjBu2ZhHgEtHDfhPBPMnLyH5428ock8JSyvRGnKdGJI 89K7CX/6zKu7I+ykvm/Oxr3iTZark20wmozSMGqh1zabS9FM0XIf6dE6S gGs3dBz2nDxlSOL0Ko8FcvaQEojgwEsQdOURisvX8v4nj6HrkNnPRjRq6 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10754"; a="341373453" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="341373453" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2023 01:47:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10754"; a="890964486" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="890964486" Received: from shwdeopenlab705.ccr.corp.intel.com ([10.239.55.55]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2023 01:47:39 -0700 From: "Yuanhao Xie" To: devel@edk2.groups.io Subject: [Patch V4 0/5] Eliminate the second INIT-SIPI-SIPI sequence Date: Wed, 28 Jun 2023 16:47:19 +0800 Message-Id: <20230628084724.57574-1-yuanhao.xie@intel.com> X-Mailer: git-send-email 2.36.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To speed up MP initialization, this set of patches replaces the time-consuming init-sipi-sipi process in the DXE phase. Instead, a start-up signal is used to wake up the APs and switch context from the PEI phase to the DXE phase. This optimization is effective when both PEI and DXE operate in the same bit mode. The current HOB characterized by mCpuInitMpLibHobGuid has two purposes: Acting as a global variable for the PEI phase. Transferring information from the PEI phase to the DXE phase. This series of patches creates a new HOB specifically designed to transfer only the minimal necessary information (MpHandoff structure) from the PEI phase to the DXE phase. YuanhaoXie (5): UefiCpuPkg: Refactor the logic for placing APs in HltLoop. UefiCpuPkg: Refactor the logic for placing APs in Mwait/Runloop. UefiCpuPkg: Create MpHandOff. UefiCpuPkg: ApWakeupFunction directly use CpuMpData. UefiCpuPkg: Eliminate the second INIT-SIPI-SIPI sequence. UefiCpuPkg/Library/MpInitLib/AmdSev.c | 17 +++++++++++++++++ UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 1 + UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm | 4 ++-- UefiCpuPkg/Library/MpInitLib/MpHandOff.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/Library/MpInitLib/MpLib.c | 345 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------- UefiCpuPkg/Library/MpInitLib/MpLib.h | 28 ++++++++++++++++++++++++++++ UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 2 +- UefiCpuPkg/Library/MpInitLib/PeiMpLib.c | 32 +++++++++++++++++++++++++++++++- UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 3 +-- 9 files changed, 408 insertions(+), 71 deletions(-) create mode 100644 UefiCpuPkg/Library/MpInitLib/MpHandOff.h -- 2.36.1.windows.1