From nobody Thu Apr 25 16:46:53 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+89563+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+89563+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1651887412; cv=none; d=zohomail.com; s=zohoarc; b=GZTaHz5JC3JHDK25OukRdJyjlVsqTArx5vQARJkWJG3Pk4QvxnO7ZOgYs00i6uc8voEeNPwC/M1Ff4fjxsVz8Vpuazzshlj3BzvAFmtIy2YUWKd0rCF2kVKSQdJJACjxnD9gQdpu5UA2j5AMYDtIaAtyYxqE6Eo3D57M3T3DyKg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651887412; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=v7sFQA5J14TJjmNjRmVkBGzHbuY0lD6oJPxnPAmqEZE=; b=HZqTiI6mIfVdda26N9cUgyfJFCN3arbeTH3YbrIm5ZtlhAFmGDcmu4/iLoXt3Pk3s2OIGGh82V9WZPvkl3rSpXfPjRlCBNjxJNNkbSTVh39d8eaJle+3Xx30niOshs2ZFo/jVbp+3/A4ptmENZbdqfbpl0yjRaEbMPzgwb6mvRQ= 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+89563+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 1651887412332966.178892979447; Fri, 6 May 2022 18:36:52 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id FYqzYY1788612xOdzS4U0RID; Fri, 06 May 2022 18:36:51 -0700 X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.5722.1651887402613426917 for ; Fri, 06 May 2022 18:36:45 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10339"; a="267463897" X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="267463897" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 18:36:44 -0700 X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="538142993" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.172.52]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 18:36:42 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Eric Dong , Ray Ni , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Gerd Hoffmann Subject: [edk2-devel] [PATCH V2 1/6] UefiCpuPkg: Revert "UefiCpuPkg: Enable Tdx support in MpInitLib" Date: Sat, 7 May 2022 09:36:18 +0800 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,min.m.xu@intel.com X-Gm-Message-State: ilRNIrt0o3KCoLRPixmdBvWmx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1651887411; bh=CZBvyT9XPOyza3ApsKS0O0hyhUQBG/rWXYkGjk1S4RU=; h=Cc:Date:From:Reply-To:Subject:To; b=D5z8RXIX0NleGRL51M/Ktjh4Wjf6uXhVzT6jKJl20TFEplOrndHyYJtctM0u6y60TVX oIE49YhZiNj1Cig0/xNXhSXzQ8FM7UIOskIGCQz3Naqowz6+J1P0q2Tnsq6hwibhlhp7r RhttI2ppDlv8fT2s5kkSxpAGX2tKGsmKHHI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1651887414291100013 Content-Type: text/plain; charset="utf-8" From: Min M Xu BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3918 This reverts commit 88da06ca763eb6514565c1867a801a427c1f3447. This commit triggers the ASSERT in Non-Td guest. Cc: Eric Dong Cc: Ray Ni Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Signed-off-by: Min Xu Acked-by: Gerd Hoffmann Acked-by: Jiewen Yao Reviewed-by: Ray Ni --- UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 3 - UefiCpuPkg/Library/MpInitLib/MpIntelTdx.h | 69 ------------ UefiCpuPkg/Library/MpInitLib/MpLib.c | 63 +---------- UefiCpuPkg/Library/MpInitLib/MpLibTdx.c | 106 ------------------ UefiCpuPkg/Library/MpInitLib/MpLibTdxNull.c | 69 ------------ UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 3 - 6 files changed, 5 insertions(+), 308 deletions(-) delete mode 100644 UefiCpuPkg/Library/MpInitLib/MpIntelTdx.h delete mode 100644 UefiCpuPkg/Library/MpInitLib/MpLibTdx.c delete mode 100644 UefiCpuPkg/Library/MpInitLib/MpLibTdxNull.c diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf b/UefiCpuPkg/Lib= rary/MpInitLib/DxeMpInitLib.inf index 159b4d16ed0e..e1cd0b350008 100644 --- a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf @@ -24,12 +24,10 @@ [Sources.IA32] Ia32/AmdSev.c Ia32/MpFuncs.nasm - MpLibTdxNull.c =20 [Sources.X64] X64/AmdSev.c X64/MpFuncs.nasm - MpLibTdx.c =20 [Sources.common] AmdSev.c @@ -38,7 +36,6 @@ MpLib.c MpLib.h Microcode.c - MpIntelTdx.h =20 [Packages] MdePkg/MdePkg.dec diff --git a/UefiCpuPkg/Library/MpInitLib/MpIntelTdx.h b/UefiCpuPkg/Library= /MpInitLib/MpIntelTdx.h deleted file mode 100644 index 8a26f6c19fc4..000000000000 --- a/UefiCpuPkg/Library/MpInitLib/MpIntelTdx.h +++ /dev/null @@ -1,69 +0,0 @@ -/** @file - CPU MP Initialize Library header file for Td guest. - - Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef MP_INTEL_TDX_H_ -#define MP_INTEL_TDX_H_ - -#include -#include -#include -#include -#include - -/** - Gets detailed MP-related information on the requested processor at the - instant this call is made. This service may only be called from the BSP. - - @param[in] ProcessorNumber The handle number of processor. - @param[out] ProcessorInfoBuffer A pointer to the buffer where informat= ion for - the requested processor is deposited. - @param[out] HealthData Return processor health data. - - @retval EFI_SUCCESS Processor information was returned. - @retval EFI_DEVICE_ERROR The calling processor is an AP. - @retval EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL. - @retval EFI_NOT_FOUND The processor with the handle specified = by - ProcessorNumber does not exist in the pl= atform. - @retval EFI_NOT_READY MP Initialize Library is not initialized. - -**/ -EFI_STATUS -TdxMpInitLibGetProcessorInfo ( - IN UINTN ProcessorNumber, - OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer, - OUT EFI_HEALTH_FLAGS *HealthData OPTIONAL - ); - -/** - Retrieves the number of logical processor in the platform and the number= of - those logical processors that are enabled on this boot. This service may= only - be called from the BSP. - - @param[out] NumberOfProcessors Pointer to the total number of l= ogical - processors in the system, includ= ing the BSP - and disabled APs. - @param[out] NumberOfEnabledProcessors Pointer to the number of enabled= logical - processors that exist in system,= including - the BSP. - - @retval EFI_SUCCESS The number of logical processors and ena= bled - logical processors was retrieved. - @retval EFI_DEVICE_ERROR The calling processor is an AP. - @retval EFI_INVALID_PARAMETER NumberOfProcessors is NULL and NumberOfE= nabledProcessors - is NULL. - @retval EFI_NOT_READY MP Initialize Library is not initialized. - -**/ -EFI_STATUS -TdxMpInitLibGetNumberOfProcessors ( - OUT UINTN *NumberOfProcessors, OPTIONAL - OUT UINTN *NumberOfEnabledProcessors OPTIONAL - ); - -#endif diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpIn= itLib/MpLib.c index 91c7afaeb2ad..4a73787ee43a 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -9,11 +9,9 @@ **/ =20 #include "MpLib.h" -#include "MpIntelTdx.h" #include #include #include -#include =20 EFI_GUID mCpuInitMpLibHobGuid =3D CPU_INIT_MP_LIB_HOB_GUID; =20 @@ -1805,10 +1803,6 @@ MpInitLibInitialize ( UINTN BackupBufferAddr; UINTN ApIdtBase; =20 - if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr))) { - return EFI_SUCCESS; - } - OldCpuMpData =3D GetCpuMpDataFromGuidedHob (); if (OldCpuMpData =3D=3D NULL) { MaxLogicalProcessorNumber =3D PcdGet32 (PcdCpuMaxLogicalProcessorNumbe= r); @@ -2079,10 +2073,6 @@ MpInitLibGetProcessorInfo ( CPU_INFO_IN_HOB *CpuInfoInHob; UINTN OriginalProcessorNumber; =20 - if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr))) { - return TdxMpInitLibGetProcessorInfo (ProcessorNumber, ProcessorInfoBuf= fer, HealthData); - } - CpuMpData =3D GetCpuMpData (); CpuInfoInHob =3D (CPU_INFO_IN_HOB *)(UINTN)CpuMpData->CpuInfoInHob; =20 @@ -2177,10 +2167,6 @@ SwitchBSPWorker ( BOOLEAN OldInterruptState; BOOLEAN OldTimerInterruptState; =20 - if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr))) { - return EFI_UNSUPPORTED; - } - // // Save and Disable Local APIC timer interrupt // @@ -2321,10 +2307,6 @@ EnableDisableApWorker ( CPU_MP_DATA *CpuMpData; UINTN CallerNumber; =20 - if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr))) { - return EFI_UNSUPPORTED; - } - CpuMpData =3D GetCpuMpData (); =20 // @@ -2385,11 +2367,6 @@ MpInitLibWhoAmI ( return EFI_INVALID_PARAMETER; } =20 - if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr))) { - *ProcessorNumber =3D 0; - return EFI_SUCCESS; - } - CpuMpData =3D GetCpuMpData (); =20 return GetProcessorNumber (CpuMpData, ProcessorNumber); @@ -2428,16 +2405,12 @@ MpInitLibGetNumberOfProcessors ( UINTN EnabledProcessorNumber; UINTN Index; =20 + CpuMpData =3D GetCpuMpData (); + if ((NumberOfProcessors =3D=3D NULL) && (NumberOfEnabledProcessors =3D= =3D NULL)) { return EFI_INVALID_PARAMETER; } =20 - if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr))) { - return TdxMpInitLibGetNumberOfProcessors (NumberOfProcessors, NumberOf= EnabledProcessors); - } - - CpuMpData =3D GetCpuMpData (); - // // Check whether caller processor is BSP // @@ -2517,16 +2490,13 @@ StartupAllCPUsWorker ( BOOLEAN HasEnabledAp; CPU_STATE ApState; =20 + CpuMpData =3D GetCpuMpData (); + if (FailedCpuList !=3D NULL) { *FailedCpuList =3D NULL; } =20 - Status =3D MpInitLibGetNumberOfProcessors (&ProcessorCount, NULL); - if (EFI_ERROR (Status)) { - return Status; - } - - if ((ProcessorCount =3D=3D 1) && ExcludeBsp) { + if ((CpuMpData->CpuCount =3D=3D 1) && ExcludeBsp) { return EFI_NOT_STARTED; } =20 @@ -2534,22 +2504,6 @@ StartupAllCPUsWorker ( return EFI_INVALID_PARAMETER; } =20 - if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr))) { - // - // For Td guest ExcludeBsp must be FALSE. Otherwise it will return in = above checks. - // - ASSERT (!ExcludeBsp); - - // - // Start BSP. - // - Procedure (ProcedureArgument); - - return EFI_SUCCESS; - } - - CpuMpData =3D GetCpuMpData (); - // // Check whether caller processor is BSP // @@ -2689,13 +2643,6 @@ StartupThisAPWorker ( CPU_AP_DATA *CpuData; UINTN CallerNumber; =20 - // - // In Td guest, startup of AP is not supported in current stage. - // - if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr))) { - return EFI_UNSUPPORTED; - } - CpuMpData =3D GetCpuMpData (); =20 if (Finished !=3D NULL) { diff --git a/UefiCpuPkg/Library/MpInitLib/MpLibTdx.c b/UefiCpuPkg/Library/M= pInitLib/MpLibTdx.c deleted file mode 100644 index fdb58fba9323..000000000000 --- a/UefiCpuPkg/Library/MpInitLib/MpLibTdx.c +++ /dev/null @@ -1,106 +0,0 @@ -/** @file - CPU MP Initialize Library common functions for Td guest. - - Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "MpLib.h" -#include "MpIntelTdx.h" - -/** - Gets detailed MP-related information on the requested processor at the - instant this call is made. This service may only be called from the BSP. - - In current stage only the BSP is workable. So ProcessorNumber should be = 0. - - @param[in] ProcessorNumber The handle number of processor. - @param[out] ProcessorInfoBuffer A pointer to the buffer where informat= ion for - the requested processor is deposited. - @param[out] HealthData Return processor health data. - - @retval EFI_SUCCESS Processor information was returned. - @retval EFI_DEVICE_ERROR The calling processor is an AP. - @retval EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL or Processor= Number is not 0. - @retval EFI_NOT_FOUND The processor with the handle specified = by - ProcessorNumber does not exist in the pl= atform. - @retval EFI_NOT_READY MP Initialize Library is not initialized. - -**/ -EFI_STATUS -TdxMpInitLibGetProcessorInfo ( - IN UINTN ProcessorNumber, - OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer, - OUT EFI_HEALTH_FLAGS *HealthData OPTIONAL - ) -{ - UINTN OriginalProcessorNumber; - - // - // Lower 24 bits contains the actual processor number. - // - OriginalProcessorNumber =3D ProcessorNumber; - ProcessorNumber &=3D BIT24 - 1; - - if ((ProcessorInfoBuffer =3D=3D NULL) || (ProcessorNumber !=3D 0)) { - return EFI_INVALID_PARAMETER; - } - - ProcessorInfoBuffer->ProcessorId =3D 0; - ProcessorInfoBuffer->StatusFlag =3D PROCESSOR_AS_BSP_BIT | PROCESSOR_EN= ABLED_BIT; - ZeroMem (&ProcessorInfoBuffer->Location, sizeof (EFI_CPU_PHYSICAL_LOCATI= ON)); - - if ((OriginalProcessorNumber & CPU_V2_EXTENDED_TOPOLOGY) !=3D 0) { - ZeroMem (&ProcessorInfoBuffer->ExtendedInformation.Location2, sizeof (= EFI_CPU_PHYSICAL_LOCATION2)); - } - - if (HealthData !=3D NULL) { - HealthData->Uint32 =3D 0; - } - - return EFI_SUCCESS; -} - -/** - Retrieves the number of logical processor in the platform and the number= of - those logical processors that are enabled on this boot. This service may= only - be called from the BSP. - - @param[out] NumberOfProcessors Pointer to the total number of l= ogical - processors in the system, includ= ing the BSP - and disabled APs. - @param[out] NumberOfEnabledProcessors Pointer to the number of enabled= logical - processors that exist in system,= including - the BSP. - - @retval EFI_SUCCESS The number of logical processors and ena= bled - logical processors was retrieved. - @retval EFI_DEVICE_ERROR The calling processor is an AP. - @retval EFI_INVALID_PARAMETER NumberOfProcessors is NULL and NumberOfE= nabledProcessors - is NULL. - @retval EFI_NOT_READY MP Initialize Library is not initialized. - -**/ -EFI_STATUS -TdxMpInitLibGetNumberOfProcessors ( - OUT UINTN *NumberOfProcessors, OPTIONAL - OUT UINTN *NumberOfEnabledProcessors OPTIONAL - ) -{ - ASSERT (NumberOfProcessors !=3D NULL || NumberOfEnabledProcessors !=3D N= ULL); - // - // In current stage only the BSP is workable. So NumberOfProcessors - // & NumberOfEnableddProcessors are both 1. - // - if (NumberOfProcessors !=3D NULL) { - *NumberOfProcessors =3D 1; - } - - if (NumberOfEnabledProcessors !=3D NULL) { - *NumberOfEnabledProcessors =3D 1; - } - - return EFI_SUCCESS; -} diff --git a/UefiCpuPkg/Library/MpInitLib/MpLibTdxNull.c b/UefiCpuPkg/Libra= ry/MpInitLib/MpLibTdxNull.c deleted file mode 100644 index b5aaf6df283f..000000000000 --- a/UefiCpuPkg/Library/MpInitLib/MpLibTdxNull.c +++ /dev/null @@ -1,69 +0,0 @@ -/** @file - CPU MP Initialize Library common functions (NULL instance) for Td guest. - - Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "MpLib.h" -#include "MpIntelTdx.h" - -/** - Gets detailed MP-related information on the requested processor at the - instant this call is made. This service may only be called from the BSP. - - @param[in] ProcessorNumber The handle number of processor. - @param[out] ProcessorInfoBuffer A pointer to the buffer where informat= ion for - the requested processor is deposited. - @param[out] HealthData Return processor health data. - - @retval EFI_SUCCESS Processor information was returned. - @retval EFI_DEVICE_ERROR The calling processor is an AP. - @retval EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL. - @retval EFI_NOT_FOUND The processor with the handle specified = by - ProcessorNumber does not exist in the pl= atform. - @retval EFI_NOT_READY MP Initialize Library is not initialized. - -**/ -EFI_STATUS -TdxMpInitLibGetProcessorInfo ( - IN UINTN ProcessorNumber, - OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer, - OUT EFI_HEALTH_FLAGS *HealthData OPTIONAL - ) -{ - ASSERT (FALSE); - return EFI_UNSUPPORTED; -} - -/** - Retrieves the number of logical processor in the platform and the number= of - those logical processors that are enabled on this boot. This service may= only - be called from the BSP. - - @param[out] NumberOfProcessors Pointer to the total number of l= ogical - processors in the system, includ= ing the BSP - and disabled APs. - @param[out] NumberOfEnabledProcessors Pointer to the number of enabled= logical - processors that exist in system,= including - the BSP. - - @retval EFI_SUCCESS The number of logical processors and ena= bled - logical processors was retrieved. - @retval EFI_DEVICE_ERROR The calling processor is an AP. - @retval EFI_INVALID_PARAMETER NumberOfProcessors is NULL and NumberOfE= nabledProcessors - is NULL. - @retval EFI_NOT_READY MP Initialize Library is not initialized. - -**/ -EFI_STATUS -TdxMpInitLibGetNumberOfProcessors ( - OUT UINTN *NumberOfProcessors, OPTIONAL - OUT UINTN *NumberOfEnabledProcessors OPTIONAL - ) -{ - ASSERT (FALSE); - return EFI_UNSUPPORTED; -} diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf b/UefiCpuPkg/Lib= rary/MpInitLib/PeiMpInitLib.inf index 894be0f8daab..5facf4db9499 100644 --- a/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf +++ b/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf @@ -24,12 +24,10 @@ [Sources.IA32] Ia32/AmdSev.c Ia32/MpFuncs.nasm - MpLibTdxNull.c =20 [Sources.X64] X64/AmdSev.c X64/MpFuncs.nasm - MpLibTdx.c =20 [Sources.common] AmdSev.c @@ -38,7 +36,6 @@ MpLib.c MpLib.h Microcode.c - MpIntelTdx.h =20 [Packages] MdePkg/MdePkg.dec --=20 2.29.2.windows.2 -=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 (#89563): https://edk2.groups.io/g/devel/message/89563 Mute This Topic: https://groups.io/mt/90946715/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- From nobody Thu Apr 25 16:46:53 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+89564+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+89564+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1651887410; cv=none; d=zohomail.com; s=zohoarc; b=NlqXVln4bP57o9x2fTWHpmAmiwnANNabqsAXTt/95KnNzbeeFfoCKYxVBlTivcHmY4vIZ5HSbQuaIfmEs3xOvMVZb3HQ5D6mQNLpI/ncUY5aiXBpQ2BwXtaLSv1hN1jAzvY7IC0F2xVCu8iw7lw2kWmlbY5PT9zAGi91XrgaMJQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651887410; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=aDjIBvuEA+Xe9GH4dyNjg9tFg1DR0DekFCEJ48f3iZU=; b=An9BlJjSgstV0WTwtI2ycAlqHcM+DoM4HlRTgwGG5IDilwhCoPGh7GI1/jj62v4/VoUbhgRBYILWivklHtQLceHes56VlvMi6N2SSURI4tSfW4vPLO0ozwk4Ix86Zi9lesXH61DdmqwxkY3iKpJ4y9bM46Hk4NfiUidV8Dgg3gQ= 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+89564+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 1651887409985654.7441061121746; Fri, 6 May 2022 18:36:49 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id FXLoYY1788612xNhpvwQSDHa; Fri, 06 May 2022 18:36:49 -0700 X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.5722.1651887402613426917 for ; Fri, 06 May 2022 18:36:48 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10339"; a="267463913" X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="267463913" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 18:36:47 -0700 X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="538143023" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.172.52]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 18:36:45 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Eric Dong , Ray Ni , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Gerd Hoffmann Subject: [edk2-devel] [PATCH V2 2/6] OvmfPkg: Add MpInitLibDepLib related PPI/Protocol definitions Date: Sat, 7 May 2022 09:36:19 +0800 Message-Id: <40d63f4ad5bd4b799075e233c7475db825191d19.1651885849.git.min.m.xu@intel.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,min.m.xu@intel.com X-Gm-Message-State: 36Sg0hkHM4qK6LMiT4TVkT2tx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1651887409; bh=g5PZ8LMnJtHA78vLd89yIyGqdXDg6vGuNZOjnj/2Dwc=; h=Cc:Date:From:Reply-To:Subject:To; b=ZBFvR2MAgz472pLd9/O4Q+oNDi8wyinaKMLn93uIl3T29vx/erIbKLLKpSqA1CPJ4L3 l/RSlelWLl5VJZbMb61DgYTosiLVSM+UdT/fCkIKTmzzAlNG1+JRy125hVZk7BdCzq8Fz Q2U4WXlVprWKmGMOGLkeBRZJsesLbATvVPk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1651887412231100009 Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3918 MpInitLibDepLib is a set of libraries which depend on PPI/Protocol. This patch defines the related PPI/Protocols in OvmfPkg. Cc: Eric Dong Cc: Ray Ni Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Signed-off-by: Min Xu Acked-by: Gerd Hoffmann Acked-by: Jiewen Yao Reviewed-by: Ray Ni --- OvmfPkg/Include/Ppi/MpInitLibDep.h | 28 +++++++++++++++++++ .../Include/Protocol/MpInitLibDepProtocols.h | 28 +++++++++++++++++++ OvmfPkg/OvmfPkg.dec | 5 ++++ 3 files changed, 61 insertions(+) create mode 100644 OvmfPkg/Include/Ppi/MpInitLibDep.h create mode 100644 OvmfPkg/Include/Protocol/MpInitLibDepProtocols.h diff --git a/OvmfPkg/Include/Ppi/MpInitLibDep.h b/OvmfPkg/Include/Ppi/MpIni= tLibDep.h new file mode 100644 index 000000000000..232ff52e19fe --- /dev/null +++ b/OvmfPkg/Include/Ppi/MpInitLibDep.h @@ -0,0 +1,28 @@ +/** @file + MpInitLibDepLib PPI definitions + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef MPINITLIB_DEP_H_ +#define MPINITLIB_DEP_H_ + +// {138F9CF4-F0E7-4721-8F49-F5FFECF42D40} +#define EFI_PEI_MPINITLIB_MP_DEP_PPI_GUID \ +{ \ + 0x138f9cf4, 0xf0e7, 0x4721, { 0x8f, 0x49, 0xf5, 0xff, 0xec, 0xf4, 0x2d, = 0x40 } \ +}; + +extern EFI_GUID gEfiPeiMpInitLibMpDepPpiGuid; + +// {0B590774-BC67-49F4-A7DB-E82E89E6B5D6} +#define EFI_PEI_MPINITLIB_UP_DEP_PPI_GUID \ +{ \ + 0xb590774, 0xbc67, 0x49f4, { 0xa7, 0xdb, 0xe8, 0x2e, 0x89, 0xe6, 0xb5, 0= xd6 } \ +}; + +extern EFI_GUID gEfiPeiMpInitLibUpDepPpiGuid; + +#endif diff --git a/OvmfPkg/Include/Protocol/MpInitLibDepProtocols.h b/OvmfPkg/Inc= lude/Protocol/MpInitLibDepProtocols.h new file mode 100644 index 000000000000..449c8fedb3c6 --- /dev/null +++ b/OvmfPkg/Include/Protocol/MpInitLibDepProtocols.h @@ -0,0 +1,28 @@ +/** @file + MpInitLibDep Protocol Guid definitions + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef MPINITLIB_DEP_PROTOCOLS_H_ +#define MPINITLIB_DEP_PROTOCOLS_H_ + +// {BB00A5CA-08CE-462F-A537-43C74A825CA4} +#define EFI_MPINITLIB_MP_DEP_PROTOCOL_GUID \ +{ \ + 0xbb00a5ca, 0x8ce, 0x462f, { 0xa5, 0x37, 0x43, 0xc7, 0x4a, 0x82, 0x5c, 0= xa4 } \ +}; + +extern EFI_GUID gEfiMpInitLibMpDepProtocolGuid; + +// {A9E7CEF1-5682-42CC-B123-9930973F4A9F} +#define EFI_PEI_MPINITLIB_UP_DEP_PPI_GUID \ +{ \ + 0xa9e7cef1, 0x5682, 0x42cc, { 0xb1, 0x23, 0x99, 0x30, 0x97, 0x3f, 0x4a, = 0x9f } \ +}; + +extern EFI_GUID gEfiMpInitLibUpDepProtocolGuid; + +#endif diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec index b9ca44120289..8c2048051bea 100644 --- a/OvmfPkg/OvmfPkg.dec +++ b/OvmfPkg/OvmfPkg.dec @@ -152,6 +152,9 @@ # the PEI phase, regardless of memory encryption gOvmfTpmMmioAccessiblePpiGuid =3D {0x35c84ff2, 0x7bfe, 0x453d, {= 0x84, 0x5f, 0x68, 0x3a, 0x49, 0x2c, 0xf7, 0xb7}} =20 + gEfiPeiMpInitLibMpDepPpiGuid =3D {0x138f9cf4, 0xf0e7, 0x4721, {= 0x8f, 0x49, 0xf5, 0xff, 0xec, 0xf4, 0x2d, 0x40}} + gEfiPeiMpInitLibUpDepPpiGuid =3D {0xb590774, 0xbc67, 0x49f4, { = 0xa7, 0xdb, 0xe8, 0x2e, 0x89, 0xe6, 0xb5, 0xd6}} + [Protocols] gVirtioDeviceProtocolGuid =3D {0xfa920010, 0x6785, 0x4941, {= 0xb6, 0xec, 0x49, 0x8c, 0x57, 0x9f, 0x16, 0x0a}} gXenBusProtocolGuid =3D {0x3d3ca290, 0xb9a5, 0x11e3, {= 0xb7, 0x5d, 0xb8, 0xac, 0x6f, 0x7d, 0x65, 0xe6}} @@ -167,6 +170,8 @@ gEfiVgaMiniPortProtocolGuid =3D {0xc7735a2f, 0x88f5, 0x4882, {= 0xae, 0x63, 0xfa, 0xac, 0x8c, 0x8b, 0x86, 0xb3}} gOvmfLoadedX86LinuxKernelProtocolGuid =3D {0xa3edc05d, 0xb618, 0x4ff6, {= 0x95, 0x52, 0x76, 0xd7, 0x88, 0x63, 0x43, 0xc8}} gQemuAcpiTableNotifyProtocolGuid =3D {0x928939b2, 0x4235, 0x462f, {= 0x95, 0x80, 0xf6, 0xa2, 0xb2, 0xc2, 0x1a, 0x4f}} + gEfiMpInitLibMpDepProtocolGuid =3D {0xbb00a5ca, 0x8ce, 0x462f, {= 0xa5, 0x37, 0x43, 0xc7, 0x4a, 0x82, 0x5c, 0xa4}} + gEfiMpInitLibUpDepProtocolGuid =3D {0xa9e7cef1, 0x5682, 0x42cc, {= 0xb1, 0x23, 0x99, 0x30, 0x97, 0x3f, 0x4a, 0x9f}} =20 [PcdsFixedAtBuild] gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|0x0|UINT32|0 --=20 2.29.2.windows.2 -=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 (#89564): https://edk2.groups.io/g/devel/message/89564 Mute This Topic: https://groups.io/mt/90946716/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- From nobody Thu Apr 25 16:46:53 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+89565+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+89565+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1651887412; cv=none; d=zohomail.com; s=zohoarc; b=ml5Q5Lt03SnwfN6W2brwSg6SRYt6Hu4othwyocdSUR0ZFhkDRRkmtDLn9nQHwgLKuD49S+/qC+TEeBXkA0Db857CijLLN9FUV2uxNCb0dIhBrJyrvckICBFQiAaxXtzLnSgnZ0yB95NKgwwZtbEL4NREV87BOW0lnHo1j5LghT8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651887412; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=HYAqqs13Wpbp/YF8jjZnqaJH5i1JBY+fP2Kk5ScIRHo=; b=aPRkcxN+NWKygL3uMc5fimuPErxYRVKfN76A3RrkJZC5avBjj6QjrFNLKUz5MEiwXTTlSRW7WXoY7XPoGS09PTyfrJMLstHHVLtyQsOsmOPxorcGvOrnVtcqU/3z7tGSRTJqR/PTKW42ZT3gYBobYQObo4G080mw2lxDfWcc830= 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+89565+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 1651887412880599.4130527587779; Fri, 6 May 2022 18:36:52 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id jfNNYY1788612xR9slhrPea8; Fri, 06 May 2022 18:36:52 -0700 X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.5722.1651887402613426917 for ; Fri, 06 May 2022 18:36:51 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10339"; a="267463933" X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="267463933" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 18:36:50 -0700 X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="538143046" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.172.52]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 18:36:47 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Eric Dong , Ray Ni , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Gerd Hoffmann Subject: [edk2-devel] [PATCH V2 3/6] OvmfPkg: Add MpInitLibDepLib Date: Sat, 7 May 2022 09:36:20 +0800 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,min.m.xu@intel.com X-Gm-Message-State: pcJ2disBDsLZpobLGQtrMgukx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1651887412; bh=EsgeKI7jqbbqtg/UUzEm9eBggm+ZDW7qIHNY0Edmb2I=; h=Cc:Date:From:Reply-To:Subject:To; b=GQ6mBwZnkAI/fswRTO4a93THBVst8uJV9uYsGSpQT0j6Y64KAR5QZuh7+GajleEkZR3 919a1Lxhv5SmZwrsImISvjgSTc95mYD1dGU+loHdOhQbA5A6W9C3YCgp+kOrHW0oWts21 EGp1jTp9cIW9VqjqRniwrGKI6aAv78cUaVg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1651887414261100012 Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3918 There are 4 MpInitLibDepLib: - PeiMpInitLibMpDepLib: MpInitLib multi-processor dependency - PeiMpInitLibUpDepLib: MpInitLib unique-processor dependency - DxeMpInitLibMpDepLib: MpInitLib multi-processor dependency - DxeMpInitLibUpDepLib MpInitLib unique-processor dependency The Pei libs depend on the corresponding PPI. The Dxe libs depend on the corresponding Protocol. Cc: Eric Dong Cc: Ray Ni Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Signed-off-by: Min Xu Acked-by: Gerd Hoffmann Acked-by: Jiewen Yao Reviewed-by: Ray Ni --- .../MpInitLibDepLib/DxeMpInitLibMpDepLib.inf | 27 +++++++++++++++++++ .../MpInitLibDepLib/DxeMpInitLibUpDepLib.inf | 27 +++++++++++++++++++ .../Library/MpInitLibDepLib/MpInitLibDepLib.c | 23 ++++++++++++++++ .../MpInitLibDepLib/PeiMpInitLibMpDepLib.inf | 27 +++++++++++++++++++ .../MpInitLibDepLib/PeiMpInitLibUpDepLib.inf | 27 +++++++++++++++++++ 5 files changed, 131 insertions(+) create mode 100644 OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibMpDepLib.inf create mode 100644 OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibUpDepLib.inf create mode 100644 OvmfPkg/Library/MpInitLibDepLib/MpInitLibDepLib.c create mode 100644 OvmfPkg/Library/MpInitLibDepLib/PeiMpInitLibMpDepLib.inf create mode 100644 OvmfPkg/Library/MpInitLibDepLib/PeiMpInitLibUpDepLib.inf diff --git a/OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibMpDepLib.inf b/Ovm= fPkg/Library/MpInitLibDepLib/DxeMpInitLibMpDepLib.inf new file mode 100644 index 000000000000..97a8a52d4c29 --- /dev/null +++ b/OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibMpDepLib.inf @@ -0,0 +1,27 @@ +## @file +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D DxeMpInitLibMpDepLib + FILE_GUID =3D 57461928-290D-4FEC-A439-377420A829BE + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D NULL + +[LibraryClasses] + BaseLib + +[Packages] + MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec + +[Sources] + MpInitLibDepLib.c + +[Depex] + gEfiMpInitLibMpDepProtocolGuid \ No newline at end of file diff --git a/OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibUpDepLib.inf b/Ovm= fPkg/Library/MpInitLibDepLib/DxeMpInitLibUpDepLib.inf new file mode 100644 index 000000000000..1241fa5de2fa --- /dev/null +++ b/OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibUpDepLib.inf @@ -0,0 +1,27 @@ +## @file +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D DxeMpInitLibUpDepLib + FILE_GUID =3D 95FA4B7B-930E-4755-A9B7-10F0716DA374 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D NULL + +[LibraryClasses] + BaseLib + +[Packages] + MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec + +[Sources] + MpInitLibDepLib.c + +[Depex] + gEfiMpInitLibUpDepProtocolGuid \ No newline at end of file diff --git a/OvmfPkg/Library/MpInitLibDepLib/MpInitLibDepLib.c b/OvmfPkg/Li= brary/MpInitLibDepLib/MpInitLibDepLib.c new file mode 100644 index 000000000000..a7501bd9d960 --- /dev/null +++ b/OvmfPkg/Library/MpInitLibDepLib/MpInitLibDepLib.c @@ -0,0 +1,23 @@ +/** @file + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include + +/** +This is null constructor which always return EFI_SUCCESS. +@param ImageHandle The firmware allocated handle for the EFI image. +@param SystemTable A pointer to the EFI System Table. +@retval EFI_SUCCESS Always return EFI_SUCCESS +**/ +EFI_STATUS +EFIAPI +MpInitLibDepContructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + return EFI_SUCCESS; +} diff --git a/OvmfPkg/Library/MpInitLibDepLib/PeiMpInitLibMpDepLib.inf b/Ovm= fPkg/Library/MpInitLibDepLib/PeiMpInitLibMpDepLib.inf new file mode 100644 index 000000000000..3a3c24ecd142 --- /dev/null +++ b/OvmfPkg/Library/MpInitLibDepLib/PeiMpInitLibMpDepLib.inf @@ -0,0 +1,27 @@ +## @file +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D PeiMpInitLibMpDepLib + FILE_GUID =3D D14271DE-FBEA-4AAC-9633-7143DCD7C1C8 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D NULL + +[LibraryClasses] + BaseLib + +[Packages] + MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec + +[Sources] + MpInitLibDepLib.c + +[Depex] + gEfiPeiMpInitLibMpDepPpiGuid \ No newline at end of file diff --git a/OvmfPkg/Library/MpInitLibDepLib/PeiMpInitLibUpDepLib.inf b/Ovm= fPkg/Library/MpInitLibDepLib/PeiMpInitLibUpDepLib.inf new file mode 100644 index 000000000000..4a55a242a6f1 --- /dev/null +++ b/OvmfPkg/Library/MpInitLibDepLib/PeiMpInitLibUpDepLib.inf @@ -0,0 +1,27 @@ +## @file +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D MpInitLibUpDepLib + FILE_GUID =3D C64B5035-FA3D-4215-ADBF-9C9F3F458E30 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D NULL + +[LibraryClasses] + BaseLib + +[Packages] + MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec + +[Sources] + MpInitLibDepLib.c + +[Depex] + gEfiPeiMpInitLibUpDepPpiGuid \ No newline at end of file --=20 2.29.2.windows.2 -=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 (#89565): https://edk2.groups.io/g/devel/message/89565 Mute This Topic: https://groups.io/mt/90946717/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- From nobody Thu Apr 25 16:46:53 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+89566+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+89566+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1651887414; cv=none; d=zohomail.com; s=zohoarc; b=QfhpbE3tejWM7MAXfhNkXuH7OgLUwumXN3x2W6akNNIxXDuF/UVh3mW/O8ON2pvIEedlBtfQbN/C4+ehHEwemttBGh+UlWuTUAXWrqumbOzyzqNQMi23i5QRFfGBRQQR5ovCX3BcLIK1vwF4vSPBswVfLQ8+cIIrYdxV2Z9Onfg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651887414; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=E/wNlMX1NqhMqeoNVAuXHeYAaGY+Mx5jwr18xnQJYwo=; b=VHW2LLzng7ITV1Qk2xLk2GfysBlCCM7qtG0u+AMzmdSpBZ5FAUsM5zGwXr+AYMQpv0NMM2Ep2qhqS9E/qCAYBSFbmmyJc8oEUDmZug66LIgAmLhkaSTe9Y+Qbho5661xXx8u0NEE9y9tb2Q2Ni6D1vqm/PNQ/PipNacK6UYvtF4= 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+89566+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 1651887414067898.2138284096802; Fri, 6 May 2022 18:36:54 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id moCEYY1788612x8vSEqElCjc; Fri, 06 May 2022 18:36:53 -0700 X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.5722.1651887402613426917 for ; Fri, 06 May 2022 18:36:53 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10339"; a="267463951" X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="267463951" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 18:36:52 -0700 X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="538143056" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.172.52]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 18:36:50 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Eric Dong , Ray Ni , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Gerd Hoffmann Subject: [edk2-devel] [PATCH V2 4/6] OvmfPkg/Sec: Install MpInitLibDepLib PPIs in SecMain.c Date: Sat, 7 May 2022 09:36:21 +0800 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,min.m.xu@intel.com X-Gm-Message-State: 0w4ENMcYkkPBbASSiQpdg3LPx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1651887413; bh=dN6A4BrIIdx80YWicaV+pKT1MTV2U4cIb7eASO/rM4s=; h=Cc:Date:From:Reply-To:Subject:To; b=pLUQj7h6tC23kL/0nFLqeL6R2w4Us5SSzzRau60Bx4ZHOyUfjwSEqxD/hDzN0x+9HnW iotiA0xwfOYSZM4fBHLqZvyPk4LNAz6WbAGrs8/G5eMzLkK7/viTrLEG3xiLWFNMeCmWV 0AOcto8vdl5faOH8ndbB71lslkyTsUavvKM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1651887414249100011 Content-Type: text/plain; charset="utf-8" From: Min M Xu BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3918 Td guest should use MpInitLibUp, other guest use the MpInitLib. So in SecMain.c different PPI is installed according to the working guest type. Cc: Eric Dong Cc: Ray Ni Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Signed-off-by: Min Xu Acked-by: Gerd Hoffmann Acked-by: Jiewen Yao Reviewed-by: Ray Ni --- OvmfPkg/Sec/SecMain.c | 34 ++++++++++++++++++++++++++++++++-- OvmfPkg/Sec/SecMain.inf | 2 ++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c index 89371361cd05..1167d22a68cc 100644 --- a/OvmfPkg/Sec/SecMain.c +++ b/OvmfPkg/Sec/SecMain.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include "AmdSev.h" @@ -61,12 +62,30 @@ EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI mTemporaryRamSupport= Ppi =3D { TemporaryRamMigration }; =20 -EFI_PEI_PPI_DESCRIPTOR mPrivateDispatchTable[] =3D { +EFI_PEI_PPI_DESCRIPTOR mPrivateDispatchTableMp[] =3D { + { + (EFI_PEI_PPI_DESCRIPTOR_PPI), + &gEfiTemporaryRamSupportPpiGuid, + &mTemporaryRamSupportPpi + }, { (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), + &gEfiPeiMpInitLibMpDepPpiGuid, + NULL + }, +}; + +EFI_PEI_PPI_DESCRIPTOR mPrivateDispatchTableUp[] =3D { + { + (EFI_PEI_PPI_DESCRIPTOR_PPI), &gEfiTemporaryRamSupportPpiGuid, &mTemporaryRamSupportPpi }, + { + (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), + &gEfiPeiMpInitLibUpDepPpiGuid, + NULL + }, }; =20 // @@ -936,6 +955,7 @@ SecStartupPhase2 ( EFI_SEC_PEI_HAND_OFF *SecCoreData; EFI_FIRMWARE_VOLUME_HEADER *BootFv; EFI_PEI_CORE_ENTRY_POINT PeiCoreEntryPoint; + EFI_PEI_PPI_DESCRIPTOR *EfiPeiPpiDescriptor; =20 SecCoreData =3D (EFI_SEC_PEI_HAND_OFF *)Context; =20 @@ -948,10 +968,20 @@ SecStartupPhase2 ( SecCoreData->BootFirmwareVolumeBase =3D BootFv; SecCoreData->BootFirmwareVolumeSize =3D (UINTN)BootFv->FvLength; =20 + // + // Td guest is required to use the MpInitLibUp (unique-processor version= ). + // Other guests use the MpInitLib (multi-processor version). + // + if (CcProbe () =3D=3D CcGuestTypeIntelTdx) { + EfiPeiPpiDescriptor =3D (EFI_PEI_PPI_DESCRIPTOR *)&mPrivateDispatchTab= leUp; + } else { + EfiPeiPpiDescriptor =3D (EFI_PEI_PPI_DESCRIPTOR *)&mPrivateDispatchTab= leMp; + } + // // Transfer the control to the PEI core // - (*PeiCoreEntryPoint)(SecCoreData, (EFI_PEI_PPI_DESCRIPTOR *)&mPrivateDis= patchTable); + (*PeiCoreEntryPoint)(SecCoreData, EfiPeiPpiDescriptor); =20 // // If we get here then the PEI Core returned, which is not recoverable. diff --git a/OvmfPkg/Sec/SecMain.inf b/OvmfPkg/Sec/SecMain.inf index 1557b5f4a84e..561a840f29c5 100644 --- a/OvmfPkg/Sec/SecMain.inf +++ b/OvmfPkg/Sec/SecMain.inf @@ -59,6 +59,8 @@ =20 [Ppis] gEfiTemporaryRamSupportPpiGuid # PPI ALWAYS_PRODUCED + gEfiPeiMpInitLibMpDepPpiGuid + gEfiPeiMpInitLibUpDepPpiGuid =20 [Pcd] gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase --=20 2.29.2.windows.2 -=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 (#89566): https://edk2.groups.io/g/devel/message/89566 Mute This Topic: https://groups.io/mt/90946718/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- From nobody Thu Apr 25 16:46:53 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+89567+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+89567+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1651887416; cv=none; d=zohomail.com; s=zohoarc; b=Nl8TAGL07o52GuIWZ3DDGkj2mfaU2vDP5UTqgduKanHWyRmXvjoTAVURnZBlYmz39BjySFHs7Urf4V4y4TKPEso1z4Ee7N33mKGURuI6WUtCCYNe5Cfd4I++kZBuSmOzUUfEPCzuxJ9JS//X6fveEpRVzIWbteEBaNm6BNYgfWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651887416; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=4/WS/v0CjxfgwYzN9L6LaJ8/gOn8rV6pT3Pzp/eV4+A=; b=Z+7tzaUDERYGJ+GimpNnwglc75YnCQol79zSFo34GGLHs7vlTw2JAjsibtsMZnf53mIxaJ/bY8GV5CpxesfbA5EZJv5uh49h91QytHPpVGScugheQGNpy/Gjp32789mmwi244fxe3Vs0P3aqLMBBeTd/Ww4kWZjJjxuGlNp8u00= 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+89567+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 1651887416595195.47050640029988; Fri, 6 May 2022 18:36:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id JlNxYY1788612xMTZsT1Inbh; Fri, 06 May 2022 18:36:56 -0700 X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.5722.1651887402613426917 for ; Fri, 06 May 2022 18:36:55 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10339"; a="267463971" X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="267463971" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 18:36:55 -0700 X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="538143081" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.172.52]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 18:36:52 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Eric Dong , Ray Ni , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Gerd Hoffmann Subject: [edk2-devel] [PATCH V2 5/6] OvmfPkg/TdxDxe: Install MpInitLibDepLib protocols Date: Sat, 7 May 2022 09:36:22 +0800 Message-Id: <8312a21767d191e33ae521074a627cca4cb91766.1651885849.git.min.m.xu@intel.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,min.m.xu@intel.com X-Gm-Message-State: IYaEkBtiXoaWlqEmAYSj8RuOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1651887416; bh=cPJ9xbdKEwRC2LmF5M3KJSNNSoUu/KQbT4mO+7ZI/K0=; h=Cc:Date:From:Reply-To:Subject:To; b=XuShrmyf2SEo0jY6Ixz8s5Sra9/7wRAaJqoG/PEIiV+fC5yRcPmYoi4l0cuwrR2tNlX PdgoLzo7wVlW6JQdpyCAxDHBa7O8I0sl7J7VmTIyiglYPhIBec+qSMCuOQGQ8/mSBNdqg wSt5p5nWbhTyCLFpwx8l8I5ktpLxdmEIwxA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1651887418279100001 Content-Type: text/plain; charset="utf-8" From: Min M Xu BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3918 In Td guest CpuDxe driver uses the MpInitLibUp, the other guest type use the MpInitLib. So we install different Protocols according to the current working guest type. Cc: Eric Dong Cc: Ray Ni Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Signed-off-by: Min Xu Acked-by: Gerd Hoffmann Acked-by: Jiewen Yao Reviewed-by: Ray Ni --- OvmfPkg/TdxDxe/TdxDxe.c | 22 +++++++++++++++++++++- OvmfPkg/TdxDxe/TdxDxe.inf | 2 ++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/TdxDxe/TdxDxe.c b/OvmfPkg/TdxDxe/TdxDxe.c index f0929998233c..2318db989792 100644 --- a/OvmfPkg/TdxDxe/TdxDxe.c +++ b/OvmfPkg/TdxDxe/TdxDxe.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -250,13 +251,32 @@ TdxDxeEntryPoint ( =20 if (!TdIsEnabled ()) { // - // If it is Non-Td guest, we're done. + // If it is Non-Td guest, we install gEfiMpInitLibMpDepProtocolGuid so= that + // MpInitLib will be used in CpuDxe driver. // + gBS->InstallProtocolInterface ( + &ImageHandle, + &gEfiMpInitLibMpDepProtocolGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + return EFI_SUCCESS; } =20 SetMmioSharedBit (); =20 + // + // It is Td guest, we install gEfiMpInitLibUpDepProtocolGuid so that + // MpInitLibUp will be used in CpuDxe driver. + // + gBS->InstallProtocolInterface ( + &ImageHandle, + &gEfiMpInitLibUpDepProtocolGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + // // Call TDINFO to get actual number of cpus in domain // diff --git a/OvmfPkg/TdxDxe/TdxDxe.inf b/OvmfPkg/TdxDxe/TdxDxe.inf index 2ec2ef2ed5f2..a7e0abda1522 100644 --- a/OvmfPkg/TdxDxe/TdxDxe.inf +++ b/OvmfPkg/TdxDxe/TdxDxe.inf @@ -50,6 +50,8 @@ gQemuAcpiTableNotifyProtocolGuid ## CONSUMES gEfiAcpiSdtProtocolGuid ## CONSUMES gEfiAcpiTableProtocolGuid ## CONSUMES + gEfiMpInitLibMpDepProtocolGuid + gEfiMpInitLibUpDepProtocolGuid =20 [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase --=20 2.29.2.windows.2 -=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 (#89567): https://edk2.groups.io/g/devel/message/89567 Mute This Topic: https://groups.io/mt/90946719/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- From nobody Thu Apr 25 16:46:53 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+89568+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+89568+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1651887419; cv=none; d=zohomail.com; s=zohoarc; b=EauZ24K6WRPz/2QTpfjMHwEKl5VFZFLogikB3fuVPQvdsgl6Dczy7l3/yg/gY9zeYx7ms8nDTya/1iF/vlJcnjZHhLWiUvrwAGv1NhpNrRaDGn/qKWVnPjeiqmv0hFH1E4CXMW+SbQLpbnQAO4V/5D+db3J747EixBYC2GC/cWw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651887419; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=hmmm3vXOp7t+41fHbUtf1RkUp5NMX3moEdJw+0BcKZ0=; b=P+eKSa4W0DzbBdIw5Gq0+dRsjjrT9qD389kTGAa8MiP/HYthmgC20LsX4kc0oRrruF6I3T845f1W24XWDsG7AwVrjMAvRJuTxF5pqFHMNwrP2I3YiwC57fWeQEQQ/OFfy5Io+B2FXeTMeGJAbgRIS4mxUFS6VNXefQ8o91TH1jY= 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+89568+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 1651887419763810.1801917615431; Fri, 6 May 2022 18:36:59 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id psDGYY1788612xguIq0pne0T; Fri, 06 May 2022 18:36:59 -0700 X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.5722.1651887402613426917 for ; Fri, 06 May 2022 18:36:58 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10339"; a="267464001" X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="267464001" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 18:36:58 -0700 X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="538143127" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.172.52]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 18:36:55 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Eric Dong , Ray Ni , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Gerd Hoffmann Subject: [edk2-devel] [PATCH V2 6/6] OvmfPkg: Enable 2 different CpuMpPei and CpuDxe drivers Date: Sat, 7 May 2022 09:36:23 +0800 Message-Id: <32b1d34f0f3a5b2013b11f0b87845c8dc0b2af2e.1651885849.git.min.m.xu@intel.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,min.m.xu@intel.com X-Gm-Message-State: joH2FGZ4mDQyUAYtDowJzaVCx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1651887419; bh=5wYzH2nyc2BhJNmcuxnzA60z/oZ7YqQOvUMJ2iiseuY=; h=Cc:Date:From:Reply-To:Subject:To; b=OF9DMSEXV1Rwuq5cRQID2LZ7EVWOXSyzJxU6kh8142pb+lVWlFYwfGOPII9QcF3DwvD 58NrM9tY2ZAPmHKJp/UrRPf/jdNkmH6VnNCkBjCmeUJELrzhYpkt72PbHMS4DdByiJNdc pFnwvUtWECouzE7elP+sq8txnkaHkHwg2nM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1651887420285100007 Content-Type: text/plain; charset="utf-8" From: Min M Xu BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3918 In OvmfPkgX64 we enable 2 different CpuMpPei and CpuDxe drivers. The difference between the drivers is the MpInitLib or MpInitLibUp. This is acomplished by adding a MpInitLibDepLib. In IntelTdxX64 we enable 2 versions of CpuDxe drivers. It is because PEI is skipped in IntelTdxX64. Cc: Eric Dong Cc: Ray Ni Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Signed-off-by: Min Xu Acked-by: Gerd Hoffmann Acked-by: Jiewen Yao Reviewed-by: Ray Ni --- OvmfPkg/IntelTdx/IntelTdxX64.dsc | 30 ++++++++++++++++- OvmfPkg/IntelTdx/IntelTdxX64.fdf | 3 ++ OvmfPkg/OvmfPkgX64.dsc | 55 ++++++++++++++++++++++++++++++-- OvmfPkg/OvmfPkgX64.fdf | 4 +++ 4 files changed, 89 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX6= 4.dsc index 73a6c30096a8..80c331ea233a 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc @@ -57,6 +57,11 @@ !endif !endif =20 + # + # Define the FILE_GUID of CpuDxe for unique-processor version. + # + DEFINE UP_CPU_DXE_GUID =3D 6490f1c5-ebcc-4665-8892-0075b9bb49b7 + [BuildOptions] GCC:RELEASE_*_*_CC_FLAGS =3D -DMDEPKG_NDEBUG INTEL:RELEASE_*_*_CC_FLAGS =3D /D MDEPKG_NDEBUG @@ -550,7 +555,30 @@ =20 MdeModulePkg/Universal/EbcDxe/EbcDxe.inf UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf - UefiCpuPkg/CpuDxe/CpuDxe.inf + + UefiCpuPkg/CpuDxe/CpuDxe.inf { + + # + # Directly use DxeMpInitLib. It depends on DxeMpInitLibMpDepLib which + # checks the Protocol of gEfiMpInitLibMpDepProtocolGuid. + # + MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibMpDepLib.inf + } + + UefiCpuPkg/CpuDxe/CpuDxe.inf { + + FILE_GUID =3D $(UP_CPU_DXE_GUID) + + + # + # Directly use MpInitLibUp. It depends on DxeMpInitLibUpDepLib which + # checks the Protocol of gEfiMpInitLibUpDepProtocolGuid. + # + MpInitLib|UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibUpDepLib.inf + } + OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.inf OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.fdf b/OvmfPkg/IntelTdx/IntelTdxX6= 4.fdf index 9e290ea78f61..1029916c3484 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.fdf +++ b/OvmfPkg/IntelTdx/IntelTdxX64.fdf @@ -185,7 +185,10 @@ INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf + INF UefiCpuPkg/CpuDxe/CpuDxe.inf +INF FILE_GUID =3D $(UP_CPU_DXE_GUID) UefiCpuPkg/CpuDxe/CpuDxe.inf + INF OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf INF OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.= inf INF OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 45ffa2dbe35f..71526bba3183 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -72,6 +72,12 @@ !endif !endif =20 + # + # Define the FILE_GUID of CpuMpPei/CpuDxe for unique-processor version. + # + DEFINE UP_CPU_PEI_GUID =3D 280251c4-1d09-4035-9062-839acb5f18c1 + DEFINE UP_CPU_DXE_GUID =3D 6490f1c5-ebcc-4665-8892-0075b9bb49b7 + [BuildOptions] GCC:RELEASE_*_*_CC_FLAGS =3D -DMDEPKG_NDEBUG INTEL:RELEASE_*_*_CC_FLAGS =3D /D MDEPKG_NDEBUG @@ -728,7 +734,29 @@ MdeModulePkg/Universal/Variable/Pei/VariablePei.inf OvmfPkg/SmmAccess/SmmAccessPei.inf !endif - UefiCpuPkg/CpuMpPei/CpuMpPei.inf + + UefiCpuPkg/CpuMpPei/CpuMpPei.inf { + + # + # Directly use PeiMpInitLib. It depends on PeiMpInitLibMpDepLib which + # checks the PPI of gEfiPeiMpInitLibMpDepPpiGuid. + # + MpInitLib|UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/PeiMpInitLibMpDepLib.inf + } + + UefiCpuPkg/CpuMpPei/CpuMpPei.inf { + + FILE_GUID =3D $(UP_CPU_PEI_GUID) + + + # + # Directly use MpInitLibUp. It depends on PeiMpInitLibUpDepLib which + # checks the PPI of gEfiPeiMpInitLibUpDepPpiGuid. + # + MpInitLib|UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/PeiMpInitLibUpDepLib.inf + } =20 !include OvmfPkg/OvmfTpmComponentsPei.dsc.inc =20 @@ -760,7 +788,30 @@ =20 MdeModulePkg/Universal/EbcDxe/EbcDxe.inf UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf - UefiCpuPkg/CpuDxe/CpuDxe.inf + + UefiCpuPkg/CpuDxe/CpuDxe.inf { + + # + # Directly use DxeMpInitLib. It depends on DxeMpInitLibMpDepLib which + # checks the Protocol of gEfiMpInitLibMpDepProtocolGuid. + # + MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibMpDepLib.inf + } + + UefiCpuPkg/CpuDxe/CpuDxe.inf { + + FILE_GUID =3D $(UP_CPU_DXE_GUID) + + + # + # Directly use MpInitLibUp. It depends on DxeMpInitLibUpDepLib which + # checks the Protocol of gEfiMpInitLibUpDepProtocolGuid. + # + MpInitLib|UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibUpDepLib.inf + } + !ifdef $(CSM_ENABLE) OvmfPkg/8259InterruptControllerDxe/8259.inf OvmfPkg/8254TimerDxe/8254Timer.inf diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index 6e72cdf3453e..aa9a83032d9b 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -185,6 +185,7 @@ INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf INF OvmfPkg/SmmAccess/SmmAccessPei.inf !endif INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf +INF FILE_GUID =3D $(UP_CPU_PEI_GUID) UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 !include OvmfPkg/OvmfTpmPei.fdf.inc =20 @@ -239,7 +240,10 @@ INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf + INF UefiCpuPkg/CpuDxe/CpuDxe.inf +INF FILE_GUID =3D $(UP_CPU_DXE_GUID) UefiCpuPkg/CpuDxe/CpuDxe.inf + !ifdef $(CSM_ENABLE) INF OvmfPkg/8259InterruptControllerDxe/8259.inf INF OvmfPkg/8254TimerDxe/8254Timer.inf --=20 2.29.2.windows.2 -=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 (#89568): https://edk2.groups.io/g/devel/message/89568 Mute This Topic: https://groups.io/mt/90946720/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-