From nobody Sat May 18 07:31:15 2024 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+107263+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+107263+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1690357441; cv=none; d=zohomail.com; s=zohoarc; b=cdBKySl37ohHJtChyw7G4VpD29UCyCA/mz9n5LQQFGFvVOZnRZp2IePE7ItgFVSw7D6NQKxNzcGjhSC/CvV4FlOYN2WyczMbxZ+s2R+74a+Nn/0F2UI66UK7UFU6mHm6f5qE/rbvhmtMFVm1TdrdILlrsgFjguoOlGjyu5zKNjU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690357441; 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=n5VMvzPRND0ctHUz3eKoK/24mQPirts0y9oSpVlsbWw=; b=KthzEvKJ8D0K0FRU56LeG65uW2tFaBkIqA7l9xC7FsTmxMFLTYsFqMzdXtBWv95RW2VH7ezNksAS6pHRPAfrjwS0XlpnK8nN6GOG8cbAa4eTTrqI40DHVlWsvs4TsiKrFanebAAm+AcfsZFBj0vwY+aL+beFZtu/1maBvuEr0ug= 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+107263+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 1690357441137612.5521215224862; Wed, 26 Jul 2023 00:44:01 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=z/wRqu+WKXpwEJ3lG7b/YaJ4WAcSMq2wL08o2DVuDrE=; 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=1690357440; v=1; b=oynPrR4KcP3/pp32mID7AXmYu05bDcaJsSmTM89fTdp5zAxt0vsMsKF+C2I0PKgpLP2xyc4t ER8/eiWfuTW49GL0rBJzFH6Djr9/zXaA/MZeLXrPHPPzimvgbqFWZ4LQfiw2ZJ0caQA3X3RbaPY xLXuKbqjqr4btQNRTHLUROjo= X-Received: by 127.0.0.2 with SMTP id S1cvYY1788612xesnIuWdlCR; Wed, 26 Jul 2023 00:44:00 -0700 X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.6124.1690357439573333350 for ; Wed, 26 Jul 2023 00:44:00 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="370619951" X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; d="scan'208";a="370619951" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2023 00:43:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="840170246" X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; d="scan'208";a="840170246" X-Received: from shwdeopenlab705.ccr.corp.intel.com ([10.239.55.55]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2023 00:43:57 -0700 From: "Yuanhao Xie" To: devel@edk2.groups.io Cc: Eric Dong , Rahul Kumar , Tom Lendacky , Ray Ni , Yuanhao Xie Subject: [edk2-devel] [Patch V2] UefiCpuPkg: Decouple the SEV-ES functionality. Date: Wed, 26 Jul 2023 15:43:44 +0800 Message-Id: <20230726074344.5807-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: 6KsQdTu0rtSx7aePJXn8WSHQx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1690357443362100001 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 | 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..3f3c7bf907 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->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 (#107263): https://edk2.groups.io/g/devel/message/107263 Mute This Topic: https://groups.io/mt/100366526/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-