From nobody Mon Feb 9 02:15:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+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-