From nobody Mon Feb 9 06:42:00 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+107261+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+107261+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1690352403; cv=none; d=zohomail.com; s=zohoarc; b=OiZAmYjxKwJFG4JIZusZ1EEnl6BedeOI55Wp+FldljyIArlVnNwGymoTlwPM4PLy2vxBYHaVYUHJJns7c2AooFcJePfljXIn+NVzSV8GqfGiWdpchrnDorTAGk0tm+1FugN+/ngvNlWobSCUtEZGMgWZd/cOyl+ArOttCdufChU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690352403; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=EQMrZpwF3tW7+FeipOD6z6Zn/hlnpQxydhCIlWXpOVs=; b=cbmLGtJLQU9pVM+lj1qwuu1+8ddC4bh1tY+nypufDoLdzaiim3uKRw2Cjr00zgKR1p65ZDv+h4j8Wdf5IZpSRJjGuByrhNPBxIx+HTQSGOknzYIpvBlPVo0FOml/GKFMHFHTBSU9npcJEyga0zSN8KDX7a1CLNpLC7ZBTtzGKJA= 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+107261+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 1690352403726461.1852858785336; Tue, 25 Jul 2023 23:20:03 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=NBSc4zByKzF5BjoSV+FdnHZNHNbugJmhgntTPYYms6M=; 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: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=1690352403; v=1; b=L3rlDZiu/n47LWqHl5osFMyyEJXCp7lhILlm6NPkHX6Vn6739jid0aLfNGq9vdHcSfAT3zNr uitmuLw5FQsuWzVxHRCX4C/uNKKxQhoZXJaboLardIlaZR5YNwNwmMb2WRXv7D3hBrRy+MjXRCy xnIyJw24wci+N50a3VSuezDQ= X-Received: by 127.0.0.2 with SMTP id xbJMYY1788612xVFVFaoeBbs; Tue, 25 Jul 2023 23:20:03 -0700 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.5347.1690352402014886758 for ; Tue, 25 Jul 2023 23:20:02 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="367951040" X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; d="scan'208";a="367951040" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2023 23:20:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="972977917" X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; d="scan'208";a="972977917" X-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; 25 Jul 2023 23:19:59 -0700 From: "Yuanhao Xie" To: devel@edk2.groups.io Cc: Eric Dong , Rahul Kumar , Tom Lendacky , Ray Ni , Yuanhao Xie Subject: [edk2-devel] [PATCH] UefiCpuPkg: Decouple the SEV-ES functionality. Date: Wed, 26 Jul 2023 14:19:46 +0800 Message-Id: <20230726061946.5777-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: 7ni2ppbCcaGvEy0OpoFDOJybx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1690352404815100001 Content-Type: text/plain; charset="utf-8" The purpose is to fix an issue where an exception occurs at the start of the DXE phase by applying the following patch series on INTEL-based systems. 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. This series of patches makes changes to the way the APs are initialized and woken up. It removes the 2nd time INIT-SIPI-SIPI and introduces a special startup signal to wake up APs. These patches also create a new HOB identified by the mMpHandOffGuid, which stores only the minimum information required from the PEI phase to the DXE phase. As a result, the original HOB (mCpuInitMpLibHobGuid) is now used only as a global variable in the PEI phase and is no longer necessary in the DXE phase for INTEL-based systems. The AMD SEV-ES related code still relies on the OldCpuMpData in the DXE phase. This patch decouple the SEV-ES functionality of assigning CpuMpData to OldCpuMpData->NewCpuMpData from the Intel logic. Cc: Eric Dong Cc: Rahul Kumar Cc: Tom Lendacky Cc: Ray Ni Signed-off-by: Yuanhao Xie --- UefiCpuPkg/Library/MpInitLib/MpLib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpIn= itLib/MpLib.c index 737e03ffc5..4bb9f06edc 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -2160,7 +2160,9 @@ MpInitLibInitialize ( // APs have been wakeup before, just get the CPU Information // from HOB // - AmdSevUpdateCpuMpData (CpuMpData); + if(CpuMpData->SevEsIsEnabled){ + AmdSevUpdateCpuMpData (CpuMpData); + } CpuMpData->CpuCount =3D MpHandOff->CpuCount; CpuMpData->BspNumber =3D GetBspNumber (MpHandOff); CpuInfoInHob =3D (CPU_INFO_IN_HOB *)(UINTN)CpuMpData->CpuInfoI= nHob; --=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 (#107261): https://edk2.groups.io/g/devel/message/107261 Mute This Topic: https://groups.io/mt/100365869/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-