From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.59251.1686577063707829615 for ; Mon, 12 Jun 2023 06:37:43 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Fvqx/Ae0; spf=pass (domain: intel.com, ip: 192.55.52.151, 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=1686577063; x=1718113063; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=Zbvz7/EZGNoHzt6qMzrnZyuiL4meN/lqIk32FL1RWhI=; b=Fvqx/Ae0JNs4bGjDkS5wNLhD2eVhKU/r03q0Lehg2hkrsuUx+x/4zGUy h78yiUArZgXg9lUDARvyGVKqRZmnk9pMnTyCqE7+brI+Uv/xUwojmBDVs K3SFA8zSyLsMiMW1bg1YN9Z4xR8qb4rCzj/+0i5tHg7aFVkpfvzNircMw 4yVwQbfXF9fYZAWO7Z78kLyePKtE2ppN3qnzx3lWDIXBuHty88TYluJYb zvQuLdbFbPT/Jr5uo5o7mmi5ITq51RXJJi+K1pKG+uAUOMIrhTbbX2yw7 aT12aaPCAJePNfQF5ZIcgGjf98JNkf6DvQAJQ+nTsMGce7K6G8rW284F6 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="338400616" X-IronPort-AV: E=Sophos;i="6.00,236,1681196400"; d="scan'208";a="338400616" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2023 06:37:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="958032980" X-IronPort-AV: E=Sophos;i="6.00,236,1681196400"; d="scan'208";a="958032980" Received: from shwdeopenlab705.ccr.corp.intel.com ([10.239.55.55]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2023 06:37:42 -0700 From: "Yuanhao Xie" To: devel@edk2.groups.io Subject: [PATCH 0/5] Eliminate the second INIT-SIPI-SIPI sequence Date: Mon, 12 Jun 2023 21:37:15 +0800 Message-Id: <20230612133720.15501-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: Create MpHandOff to transfer info from PEI to DXE. UefiCpuPkg: Refactor the logic for placing APs in HltLoop. UefiCpuPkg: Refactor the logic for placing APs in Mwait/Runloop. UefiCpuPkg: ApWakeupFunction directly use CpuMpData. UefiCpuPkg: Eliminate the second INIT-SIPI-SIPI sequence. UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 1 + UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm | 4 ++-- UefiCpuPkg/Library/MpInitLib/MpHandOff.h | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/Library/MpInitLib/MpLib.c | 360 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------ UefiCpuPkg/Library/MpInitLib/MpLib.h | 10 ++++++++++ UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 1 + UefiCpuPkg/Library/MpInitLib/PeiMpLib.c | 32 +++++++++++++++++++++++++++++++- UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 3 +-- 8 files changed, 404 insertions(+), 71 deletions(-) create mode 100644 UefiCpuPkg/Library/MpInitLib/MpHandOff.h -- 2.36.1.windows.1