From nobody Sat Apr 20 08:51:19 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+89537+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+89537+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1651761821; cv=none; d=zohomail.com; s=zohoarc; b=bYeo7dWFOPgyBe+qmuRx13Jvn0MTfYafkOWgzqvSj01XwsFcoWAIurb6/Ighc822k8z9jbvvjHf2lsrVPOPP6cWACtxvlI0ZCu2jMMOYK9aPWYsCxQfEkbVpIBkF8s08V8WaUQyTO31PCP3VcUL6GIyAQk+C6stgLdFwdeBLHRk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651761821; 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=WD/p3mSs/AKHopcszeJLGNG0UPkDU5fZxBKXK7IvSOI=; b=RBHRc8e1LIJwr3rI/zGloRifJh0D0VUWRwcIc21BpymKrl6fwePmHjGPNIWOX0oJuYTkWd/TSN2/qcJcMSAKw1/R+kf8t/SIep3ZvaU3Jejs6QsFkLGZqQmOFLMrEQTBprPfvQpR5OlrqS5j6FbpDw9ZNzy7h96d2Gcj1zBNdw4= 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+89537+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 1651761821309203.6862839981644; Thu, 5 May 2022 07:43:41 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id OeeMYY1788612xKBzwxxOzrS; Thu, 05 May 2022 07:43:40 -0700 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web12.12068.1651761816591790482 for ; Thu, 05 May 2022 07:43:40 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10338"; a="255604309" X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="255604309" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 07:43:39 -0700 X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="563268831" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.175.139]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 07:43:36 -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 1/6] UefiCpuPkg: Revert "UefiCpuPkg: Enable Tdx support in MpInitLib" Date: Thu, 5 May 2022 22:43:14 +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: 9OrClrLcTC98rTwtumr7OqC8x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1651761820; bh=6Vf/Mdc+CF47ppCbqQOo2QHZhqgJ2BdA7zH77/BDvko=; h=Cc:Date:From:Reply-To:Subject:To; b=HLY+Bg4PjgAUAUZGyq7pVgqHPYZZk3QLUCkZMnc1U7W1gZkMXFVqov4JmiWwsTvbiSB smFklwP2FRa6OObTEi9In2s5Q2exLbLo09vKw7BThRB+u2SIDAjJSf/KOG3DiPRXpEWVS qoNwc01TFjhQgVfYKwkVHDOigZxbSWdjlEo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1651761823035100007 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 --- 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 (#89537): https://edk2.groups.io/g/devel/message/89537 Mute This Topic: https://groups.io/mt/90912388/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 Sat Apr 20 08:51:19 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+89538+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+89538+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1651761825; cv=none; d=zohomail.com; s=zohoarc; b=jLY4bX5zKavlVBz3vMVBFBLA/31gCiflwm8WhkJ0ZMuSE8Yu3Ck5uYgrc8YbPrnv4MJPPckjr+kW2wFJE39Zl/DOOxGA606DVPtXwRtFAViiJxJzGeGkHD6r9ntFZzzTFgy5Gmh/M74NsK3Azst4H9SetYP9qfMYMwCOW0Ii9/Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651761825; 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=0qOFrQCHeGbIXBgQuH/B7IaYLkrn2GNoGeiw+nd2slo=; b=lBBprQxrexNgeuXWitpt6Ov3ls/v5tEtBxZrI1GgJIuo3gR9DvmhMxtaE/AkJ3YJkyTvhN4Sf2SXHrAw25dqaoTvtr6jZtSvRRdkaRbs0ToX+5mbXNjSScRU7aLRB3MvaB7ho/ygBHhhZxfBkBk2nQW6aehqB8zrSYAcTZ/ZiWw= 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+89538+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 1651761825418461.5483100924213; Thu, 5 May 2022 07:43:45 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id oyuHYY1788612xJJQ4aIVZtP; Thu, 05 May 2022 07:43:45 -0700 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web12.12068.1651761816591790482 for ; Thu, 05 May 2022 07:43:44 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10338"; a="255604356" X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="255604356" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 07:43:41 -0700 X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="563268842" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.175.139]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 07:43:39 -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 2/6] OvmfPkg: Add MpInitLibDepLib related PPI/Protocol definitions Date: Thu, 5 May 2022 22:43:15 +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: v0IGy4dxkw6jej7fFRb8EdPFx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1651761825; bh=meV0Tq+5bF4WhIfy/fdDt7qI80IOjLlep3ThxVv5snY=; h=Cc:Date:From:Reply-To:Subject:To; b=TmSEnA3C2IUkOOkxiMeqOQcB7dKWgad2gMJwoG8eQIxoHF6SLWYVT09W51z2SzwiZpd 9JOMI6A2rzz2XlkbazrpxyAlEd3yhsSi8eyxm/jaB/NFUHwmifWDj3M/XVQo2BSzCFm5+ r57rkHwR8qFDrQZeGoqbHevShz6OgNN2ZgA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1651761827204100001 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 --- 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 (#89538): https://edk2.groups.io/g/devel/message/89538 Mute This Topic: https://groups.io/mt/90912392/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 Sat Apr 20 08:51:19 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+89539+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+89539+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1651761833; cv=none; d=zohomail.com; s=zohoarc; b=ff53BsUZOVk/rIiT0j/xU+OYKu7G2JyZl236RJIhDF4OPAue+FHzjyFk2DWQmVqdMNWwYa1b446nMR0AZOEcA/4YEfvVrfQxIVjlCu1xHQdFJm1Qvl6qcuadDw+JLd9xQakdWyin+LXvimif3tfsliDTdJoLjrUat3c4Tb/OvS4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651761833; 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=A4lrOgeFMj7fTj4dsW4k1F+AvKwHfZC5GevOgv0MY5w=; b=d9lIRjLLQ43Mei4pzTn5cKGN/WNSHaD2x2iKHyRUpYsJZe118E4aXlrziwVO02cZVYgqBWdy/lStawIh7kCKF3gE85dnjRk/FZdt89cm+PEHaYhlSkO4etN0+srw8iLEYTLoC4HchFw0MzfOb/VmaRvoSh0HqI2sYmOrh4au1M0= 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+89539+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 1651761833302800.6733865281875; Thu, 5 May 2022 07:43:53 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id SAqtYY1788612xKx2CcS8qKT; Thu, 05 May 2022 07:43:53 -0700 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.11878.1651761831263961075 for ; Thu, 05 May 2022 07:43:52 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10338"; a="255604386" X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="255604386" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 07:43:44 -0700 X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="563268855" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.175.139]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 07:43:41 -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 3/6] OvmfPkg: Add MpInitLibDepLib Date: Thu, 5 May 2022 22:43:16 +0800 Message-Id: <8e1d357d2a4b60ea080ad18a07edccb1fa62c88a.1651760174.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: 8d1jkpjsWiVJhEsIRjv6NaGpx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1651761833; bh=HY6Nmtc9kOcpCiDiwY4UIfM6WChV2J85llCCpDp/9FQ=; h=Cc:Date:From:Reply-To:Subject:To; b=j4YGWaoptI3RU/WXxWUi/jlv1Td727kE9a60PZIF7mrHcQk6bm5AILkAbeT9/HrWtya jxqFqEgBETLgSBTZbovn4ZZS9+V6B35hkEMWceWwDkbF53btc5GqruXyyMamD4dsS3jr/ zVmVg55Xd84LMR9Y07e1w7cujJw3b3z2Ris= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1651761835077100001 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 --- .../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 (#89539): https://edk2.groups.io/g/devel/message/89539 Mute This Topic: https://groups.io/mt/90912394/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 Sat Apr 20 08:51:19 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+89540+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+89540+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1651761835; cv=none; d=zohomail.com; s=zohoarc; b=eRWw/VcFxoy9bWyowXh4wODSg1o9LNH9LM0HpXHQ3aAGqlSOcLVjiDm8UTeM9MawdOEm2yiSJ8clRykSQrRjXQLBIbXNVr6W5RnAcemVEQcpGYJQSwSkoke5H9otMa5VHx4U/X3JddSvQz60kHPZQLFgkKbbcxe29htI0UhL3+4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651761835; 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=y+XfBh08mTuwnKimFcXV3UjnHz7A2Tw65cWim1T0eBY=; b=QfwlHGbsADM1DY+57RewzIDH+xLZhAVzluKTnjKthYta+VnShewZJsgwGlwb9b5bp1W5z2PfjgPgtAnJDQsjrAK5osXFSAUiBlqHZV860sDYmdAJD7QAB2Kv2UpHJOink+RqojHB6t624NuW6ZrPzK6wlRsJaqFRhl9gr30tWT0= 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+89540+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 1651761835761218.3743515097923; Thu, 5 May 2022 07:43:55 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id U3HlYY1788612xxya1ASt3pQ; Thu, 05 May 2022 07:43:55 -0700 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.11878.1651761831263961075 for ; Thu, 05 May 2022 07:43:55 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10338"; a="255604411" X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="255604411" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 07:43:47 -0700 X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="563268879" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.175.139]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 07:43:44 -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 4/6] OvmfPkg/Sec: Install MpInitLibDepLib PPIs in SecMain.c Date: Thu, 5 May 2022 22:43:17 +0800 Message-Id: <73284f9baf99ec3014732071744b67b7041bc3f5.1651760174.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: wHZzUkONXjQuAYvmnZCiyGKox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1651761835; bh=wtVFrkRpuCXfV2w7uJ8NY6LkcnXGcvTZ3uFYb4mm/1g=; h=Cc:Date:From:Reply-To:Subject:To; b=AlLiLuSPNbSAWF1yWW/wS3mdjop9uhQwBvItfOYFYtocbi4+QjFyxn9N8p+RON3nPRv hUhT0Wdn+VmeU60xyeGEjtFU8a+2twoBP5Sa/We495DW8uwuUDz+egF+54YZhlBALR2FY GGUcMkfjkWmTTec8cFef31VRaDFKR8HSLMQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1651761837063100005 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 --- OvmfPkg/Sec/SecMain.c | 30 ++++++++++++++++++++++++++++-- OvmfPkg/Sec/SecMain.inf | 2 ++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c index 8949d1015708..c396c1b67079 100644 --- a/OvmfPkg/Sec/SecMain.c +++ b/OvmfPkg/Sec/SecMain.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include "AmdSev.h" @@ -60,12 +61,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 | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), &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 | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), + &gEfiTemporaryRamSupportPpiGuid, + &mTemporaryRamSupportPpi + }, + { + (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), + &gEfiPeiMpInitLibUpDepPpiGuid, + NULL + }, }; =20 // @@ -935,6 +954,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 @@ -950,7 +970,13 @@ SecStartupPhase2 ( // // Transfer the control to the PEI core // - (*PeiCoreEntryPoint)(SecCoreData, (EFI_PEI_PPI_DESCRIPTOR *)&mPrivateDis= patchTable); + if (CcProbe () =3D=3D CcGuestTypeIntelTdx) { + EfiPeiPpiDescriptor =3D (EFI_PEI_PPI_DESCRIPTOR *)&mPrivateDispatchTab= leUp; + } else { + EfiPeiPpiDescriptor =3D (EFI_PEI_PPI_DESCRIPTOR *)&mPrivateDispatchTab= leMp; + } + + (*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 27100595aeca..2584c334066c 100644 --- a/OvmfPkg/Sec/SecMain.inf +++ b/OvmfPkg/Sec/SecMain.inf @@ -58,6 +58,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 (#89540): https://edk2.groups.io/g/devel/message/89540 Mute This Topic: https://groups.io/mt/90912395/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 Sat Apr 20 08:51:19 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+89541+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+89541+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1651761841; cv=none; d=zohomail.com; s=zohoarc; b=fKkFQ/dm3dchyKtU/TVNpzIiYiPvYKq4T5846+oj5x8meZh5R/km5Fh9sxrcbH/R6rYzTypQOA+rLx+49SL6CTOQO0scG4Ek0mZgK9vTpdo1L4mfmsrNFM3a2imWGBjtfeUFL5Hn3w3KufRd1eiSmj+a86T1x875T4EgmLdLJ70= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651761841; 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=joYaZGzySOJZjRYT+ZnyQneemO0GolZCPqsRvLMRdBo=; b=dXCb7GEndndwyxVfmJPzHMavY31DXexmzrRQnUPLFpOokIwC2EaTtfp0l0uUKaftOrwblHN+OSbrkuXJo4gcgQlFWMZ11Il0JRC5ksmy4WaDgjsC5+1GX7QHgkGcn2vtNmarDBJTisebiwnYqeCfrFM9qPTCLpaqPT3OFdQ5Hok= 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+89541+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 165176184140637.1390040985907; Thu, 5 May 2022 07:44:01 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id b9gjYY1788612xvhxeUsfS1y; Thu, 05 May 2022 07:44:01 -0700 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.11878.1651761831263961075 for ; Thu, 05 May 2022 07:44:00 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10338"; a="255604435" X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="255604435" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 07:43:50 -0700 X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="563268928" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.175.139]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 07:43:47 -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 5/6] OvmfPkg/TdxDxe: Install MpInitLibDepLib protocols Date: Thu, 5 May 2022 22:43: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: qD6tkIO6HP81VPmzDB4Z8E9Yx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1651761841; bh=k+NvsRSMsZ71jAyMrqV3GYCzSSeahl3Jq7ntH3rq9hk=; h=Cc:Date:From:Reply-To:Subject:To; b=FKl/9eZ4VTltNu6PaGim8m7vrhWiOC0F3HrtqGGpKwvqi0G7ymyUeSOMUoip8TiXkIF dQnSYu6Z+uHcbwiu2cMYzO/+xIBCWHIk1GdjKoi+dmik8c8woUt7PvWZks3+4sGrChmo/ ek8wu0Gac+LVrsYRgXBNlwEV+/nHlammm+A= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1651761843090100001 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 --- 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 (#89541): https://edk2.groups.io/g/devel/message/89541 Mute This Topic: https://groups.io/mt/90912396/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 Sat Apr 20 08:51:19 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+89542+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+89542+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1651761843; cv=none; d=zohomail.com; s=zohoarc; b=fugTD+JJLgA8qzjoL7k/QxKtivs00q1dBlq6xKbqcdz92Q39gySrag6psqyfMZaqf6IAvupHa0Ro6BTDtLnBHwL+SzljB+pRC7Lny1qkdfyCxpGzo8gdlrmAlSD3JMlLKa+A1+s/ul1qJVVvsZak6YM4gGI+ys7t5a0nEA+VFA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651761843; 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=LGWWEIQ2U83BcTQZeiT8MrPMwFJXGUbXlR/EcZYJcUs=; b=F62qTvuDw+0qNK9X0NUKLZkLuXOrps2jiEXpYsef+0Rc5ujzaBSKr1281ehUC4WMYlaM9N5vXDhlk2+THAerhp7Z1b4YqzHnKwviy1icnH3Dtzlow+0rSw4S4uty4rzIlVrHpeCoWXm0l3FuvDyLSPJkA4mjdcNdZ+JhFSkgA2U= 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+89542+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 1651761843201584.9910564821811; Thu, 5 May 2022 07:44:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 9CC0YY1788612xhT32Hahmef; Thu, 05 May 2022 07:44:02 -0700 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.11878.1651761831263961075 for ; Thu, 05 May 2022 07:44:02 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10338"; a="255604448" X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="255604448" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 07:43:53 -0700 X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="563268937" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.175.139]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 07:43: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 6/6] OvmfPkg: Enable 2 different CpuMpPei and CpuDxe drivers Date: Thu, 5 May 2022 22:43:19 +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: 8UdfmIl75yt6Vsr97oGFzo0px1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1651761842; bh=H5Gpv6ddWi89C9IhCNPY9fx66IFkgn/EaEIRftSS5LA=; h=Cc:Date:From:Reply-To:Subject:To; b=ZH02DMEBB/pSbf8yXPMbtUqkF1oKuGqhSbnlsl8vHDQD0DJiXb+TE+Qevqx2lFlXk97 c+0L5klAMwLILah6bOSGkh0FX2Mx5o5595Gj6sIbNwOgvM1217lz0Vx+3sG9loYiWP+DF ByFoOdt1qh+5pQ5R0IaCB8PHHpzCrnYiPi4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1651761845109100005 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 --- OvmfPkg/IntelTdx/IntelTdxX64.dsc | 23 +++++++++++++++- OvmfPkg/IntelTdx/IntelTdxX64.fdf | 5 +++- OvmfPkg/OvmfPkgX64.dsc | 45 ++++++++++++++++++++++++++++++-- OvmfPkg/OvmfPkgX64.fdf | 8 ++++-- 4 files changed, 75 insertions(+), 6 deletions(-) diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX6= 4.dsc index 73a6c30096a8..e81570d57174 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc @@ -57,6 +57,9 @@ !endif !endif =20 +DEFINE MP_CPU_DXE_GUID =3D 2d73044a-1df3-415d-b054-17fe05765c3c +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 +553,25 @@ =20 MdeModulePkg/Universal/EbcDxe/EbcDxe.inf UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf - UefiCpuPkg/CpuDxe/CpuDxe.inf + + UefiCpuPkg/CpuDxe/CpuDxe.inf { + + FILE_GUID =3D $(MP_CPU_DXE_GUID) + + + MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibMpDepLib.inf + } + + UefiCpuPkg/CpuDxe/CpuDxe.inf { + + FILE_GUID =3D $(UP_CPU_DXE_GUID) + + + 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..bedd50f69b39 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 $(MP_CPU_DXE_GUID) 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..e86b3f320278 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -72,6 +72,12 @@ !endif !endif =20 +DEFINE MP_CPU_PEI_GUID =3D 3dd59561-e4ea-4846-b7c5-c7b74a061190 +DEFINE UP_CPU_PEI_GUID =3D 280251c4-1d09-4035-9062-839acb5f18c1 + +DEFINE MP_CPU_DXE_GUID =3D 2d73044a-1df3-415d-b054-17fe05765c3c +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,24 @@ MdeModulePkg/Universal/Variable/Pei/VariablePei.inf OvmfPkg/SmmAccess/SmmAccessPei.inf !endif - UefiCpuPkg/CpuMpPei/CpuMpPei.inf + + UefiCpuPkg/CpuMpPei/CpuMpPei.inf { + + FILE_GUID =3D $(MP_CPU_PEI_GUID) + + + MpInitLib|UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/PeiMpInitLibMpDepLib.inf + } + + UefiCpuPkg/CpuMpPei/CpuMpPei.inf { + + FILE_GUID =3D $(UP_CPU_PEI_GUID) + + + MpInitLib|UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/PeiMpInitLibUpDepLib.inf + } =20 !include OvmfPkg/OvmfTpmComponentsPei.dsc.inc =20 @@ -760,7 +783,25 @@ =20 MdeModulePkg/Universal/EbcDxe/EbcDxe.inf UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf - UefiCpuPkg/CpuDxe/CpuDxe.inf + + UefiCpuPkg/CpuDxe/CpuDxe.inf { + + FILE_GUID =3D $(MP_CPU_DXE_GUID) + + + MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibMpDepLib.inf + } + + UefiCpuPkg/CpuDxe/CpuDxe.inf { + + FILE_GUID =3D $(UP_CPU_DXE_GUID) + + + 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..2b8225c8fcd2 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -184,7 +184,8 @@ INF MdeModulePkg/Universal/FaultTolerantWritePei/Fault= TolerantWritePei.inf INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf INF OvmfPkg/SmmAccess/SmmAccessPei.inf !endif -INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf +INF FILE_GUID =3D $(MP_CPU_PEI_GUID) 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 $(MP_CPU_DXE_GUID) 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 (#89542): https://edk2.groups.io/g/devel/message/89542 Mute This Topic: https://groups.io/mt/90912398/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-