From nobody Mon Feb 9 16:47:03 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+107264+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+107264+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1690357901; cv=none; d=zohomail.com; s=zohoarc; b=U8ZF8BRP1ceVGCID95zp2KVwX58fHX5hMjIHgBVf8aQVVQkAKtgrbCAd07qN3fbfF5MMEzu0eGQfzZNtfFuE8TYRyfdBGI03yOmwIVKIz2gBz+jfA5ajyahpVwerMfXan7BzHpYf0HqHkBfjkkzv0xGts4CsiG0n8UfDuei+xXY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690357901; 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=TcIlwHtonkW+M3yGHWOsV3UUkubzJTeXPi3doRH4tRI=; b=USpxsqRiGpgg+RMVP8vJSzrzGFWgxBvieoVIuv4O8Dne3o56qeGajmyFtgEKh5Qd/TiZW1DTy+a5WliFbiFivW8sWew9f4PMebV960k8oNN1YH3ROYFXW6NXnkveeIBshJOfl1SscHcnGxzF+ls1FMFOq941AmM6/wDJzNyBJpI= 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+107264+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 1690357901678583.6786001581446; Wed, 26 Jul 2023 00:51:41 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=r41oRa2RoJ3uTXPNFnIIe2TIArxXJCuygkACpd0Dl8g=; 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=1690357901; v=1; b=FPvErJyv9u1kSpTZoK+nJFBNGugsXp8yl9e0/A2ihfAiixSzEMjKDEvxe+/PcB7zjibxRK3s yB0ji9+EQiQ8alWTZ0n6YT292rwZa9eNeHGGGvg0vbNfytRJpT/+MrDSqDk//Tz9FFtVnFzi8Ah nDZ63JVEZtu6iN4LzdnBzEZQ= X-Received: by 127.0.0.2 with SMTP id tRd2YY1788612xe4k5JFNQWR; Wed, 26 Jul 2023 00:51:41 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.6194.1690357900611412141 for ; Wed, 26 Jul 2023 00:51:40 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="398878465" X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; d="scan'208";a="398878465" X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2023 00:51:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="796465000" X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; d="scan'208";a="796465000" X-Received: from shwdeopenlab705.ccr.corp.intel.com ([10.239.55.55]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2023 00:51:38 -0700 From: "Yuanhao Xie" To: devel@edk2.groups.io Cc: Eric Dong , Rahul Kumar , Tom Lendacky , Ray Ni , Yuanhao Xie Subject: [edk2-devel] [Patch V3] UefiCpuPkg: Decouple the SEV-ES functionality. Date: Wed, 26 Jul 2023 15:51:26 +0800 Message-Id: <20230726075126.5836-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: D8w6y0Ok0rsS3E5eiCUx30Bnx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1690357904447100003 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 Reviewed-by: Ray Ni Reviewed-by: Tom Lendacky --- UefiCpuPkg/Library/MpInitLib/MpLib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpIn= itLib/MpLib.c index 737e03ffc5..e7054adbcc 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -2160,7 +2160,10 @@ MpInitLibInitialize ( // APs have been wakeup before, just get the CPU Information // from HOB // - AmdSevUpdateCpuMpData (CpuMpData); + if (CpuMpData->UseSevEsAPMethod) { + 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 (#107264): https://edk2.groups.io/g/devel/message/107264 Mute This Topic: https://groups.io/mt/100366586/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-