From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id D6E88D80591 for ; Wed, 26 Jul 2023 06:20:04 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=VhKb3BbR+lz5Daf6j0gudRGNjyibi5WOPRW+7tgmzbI=; 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=eJkyhHzxFNMvXeJA1xfPIH2/7utGFsgxAw5UOUYS1GA6pgCHhmBItTeBtmWtOoWyouHWvwEy u8llibDuD5NErEF32SO0mR5bExVhHVw4yqleLTOGDBlNMLH1ClPgntgk88zReEpdYWQKQSFVV0/ OadiARuoqG9Uv2sIlkBaxrQQ= X-Received: by 127.0.0.2 with SMTP id qvWSYY7687511xjP2TEfVIS2; 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: NmDrVTy9hbldTXEJP3S7Ub4zx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=eJkyhHzx; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) 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/MpInitLib/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 = MpHandOff->CpuCount; CpuMpData->BspNumber = GetBspNumber (MpHandOff); CpuInfoInHob = (CPU_INFO_IN_HOB *)(UINTN)CpuMpData->CpuInfoInHob; -- 2.36.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- 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/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-