From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web12.7074.1651901414004751544 for ; Fri, 06 May 2022 22:30:15 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=M9EDLNnw; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651901414; x=1683437414; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=tP2gBBIODCPpJ02tBHEUAdeg2dNAA2vcWzZBEQ93fcY=; b=M9EDLNnw5C8iLupxUTktPjS6FrDmSswLNBx+ksk75Kv8xxRDU+sQ9anj R6T4nEbnTSc/2ge0pEzetN00F/RC2wW70t69mXhhClm7anu+ezpg9Z2v6 21+bIHrO7OhTpmrz8dQaeaZrhJTVvzsSUgInbaXl3WbYiS9iiuGvLJNCK dfUHmJ/FE0uoPfVBFKeoOnyRiUOUwLF6DNPwai+/Ze8ovQnk/J+8oVMm9 hlTIjLKNFGVh0AcqobGFa8bOSar7aTh1bgFGNkmMh85VXphyPnaOBEqsD PznixSQ/vNZUg6tNf9gtCxfQK1VumQ6lN8L7J8mRUWSYMiSZUoWVfCNvV w==; X-IronPort-AV: E=McAfee;i="6400,9594,10339"; a="250665979" X-IronPort-AV: E=Sophos;i="5.91,206,1647327600"; d="scan'208";a="250665979" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 22:30:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,206,1647327600"; d="scan'208";a="709770844" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga001.fm.intel.com with ESMTP; 06 May 2022 22:30:13 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 6 May 2022 22:30:12 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Fri, 6 May 2022 22:30:12 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.172) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Fri, 6 May 2022 22:30:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mldD9n0WonF6ZNuzZjnMWMK57JMaCix7uyeidV86m//l86CLKh6PFmTDouhJjxyrqibsYKdUiuuWkQQ58zDOeIgXdIot+vu+Jnkm8f+cShoChqUeaRzV4U/R81Lnu9+MHUbqYd5xM3Ntpb9nRzYeEGCiQivtuWMqHci1ZiToLCxIhopwmdR7BnMtyseQblA2Qy3535RZF1ZI5J+icEKFeCu4FW+mrX9XzxrmCHaYGdzm7p7zAtZ9WtjncP9YG+sxFVUgM/Z2mgG5OZhCjrJgBeGoE4PTzLkjuOvBkG8cUAKf+UrIbjU99EgeP82tj/HBENSIxvSuf/AOitI7rmPO4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dJzomIRwRboF2vjH8RoeBTrly1X77mHZjGzi2K1+xYM=; b=bqff7Vk4yjeLiJ+izVB0daN/qOk1Q47ETuaopJUZcRa58512M/ErVhIyJAubavGPiehL6CycOoIQsPZVfu7iqna6tPQXBbQEzG7Vp5qWQNqBX3l6bLEqPdQqTNf9WyUcrdrfTN6EVcXpuRLawRRhy6ChbMjZcPojbxwUfB0oTuC/Q7JjCYavUrW5QPq+1XmOFuhaDQg9CNjUDNAvYs8o+G/P84e9Mqssmpfo5BB2rpvFaWuEfZNeuUBvsEiZW58feQ3okiZ8ma6QfxJNb7QMV4u2r2nRnEaj1AYxuFGzxlpG/p+GUK7MozTyGYKRlH07noAj9y+UNj6Z8fbvwSYyRQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MWHPR11MB1631.namprd11.prod.outlook.com (2603:10b6:301:10::10) by DM6PR11MB3147.namprd11.prod.outlook.com (2603:10b6:5:64::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20; Sat, 7 May 2022 05:30:09 +0000 Received: from MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::2d8b:3e7f:83d7:1e56]) by MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::2d8b:3e7f:83d7:1e56%8]) with mapi id 15.20.5206.028; Sat, 7 May 2022 05:30:09 +0000 From: "Ni, Ray" To: "Xu, Min M" , "devel@edk2.groups.io" CC: "Dong, Eric" , Brijesh Singh , "Aktas, Erdem" , James Bottomley , "Yao, Jiewen" , Tom Lendacky , Gerd Hoffmann Subject: Re: [PATCH V2 1/6] UefiCpuPkg: Revert "UefiCpuPkg: Enable Tdx support in MpInitLib" Thread-Topic: [PATCH V2 1/6] UefiCpuPkg: Revert "UefiCpuPkg: Enable Tdx support in MpInitLib" Thread-Index: AQHYYbLuwQCyyTnL8UKtHVaN8bY1g60S44sA Date: Sat, 7 May 2022 05:30:08 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8a342ffc-192e-4fe2-6fe1-08da2feaa684 x-ms-traffictypediagnostic: DM6PR11MB3147:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mLFl0yXfZtO75JOePBx/8a3R7eyMRQ7qopszyIU2InWZCt9YgphJPB4cM2AgtCD4euW7izX6+uXUoLs9c+qXeRk7i8uUl3GTi9Mea790oN3VMtwzWMi+iibDmJ4Pemzit9+Uo0lV1rSjQt1w9MnAmwRTTnJXISdxsl+uE+1RojQCI8+krV5DoT2sJN5cMkW/b2YHTAFEbVEiEuFIWwd6O387xMpk4CG/a+hyVI9nZgTXshWxP8M3PfXxFwK4vfWaXREzYhwHavbPe7xomkWCzl6Ol3WAujIjb9VKLLaI2jl3KXvVCTdCtE7euJuJMKIGp8J6NzTALRnUlb8uUFAgUedOsBB79LsTpCNiu5xfq6EWrsffgjIOiQr4zbQkrIaqW62S6NjwJtmd/SvTqKgQHbhVlWnY7XMjox+yL0FPIbeHsDKFkmnkpqoiPD3hRlzAQNQTg9v+MHwyyxhK9+n66ZnCHw2VXO6SBFjs5ZZc20wvOfzQM9jHZgwLUVUFo45mIuA0Ah8l1QKR85XViC1DCaEQYkjLKABiT8gYFUN3MLtqo+jtoZapgSLEd5VAcuUMMJJ2cJm/0vwTxjGeAqNQRd33nJXUP5cZC7iD81JRmjE3VfBHoRkkz7G7RgsoYU2tmQBuhx15d9m5wILmiKsQEPPTzakC6kQQFtu3vASv9pWOtQO2fFLwIcwEg9duUNKrOC6n4m1CHL1AzGO084QAIJp/c6g/PmPFw4YCBTEKjIl+1i/9MQni2bzbqQrS86nY1fekDPvnv/IF7PTdOtiqPrF4OEOIAlhcWJQsDCe/jvQ= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1631.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(6029001)(366004)(86362001)(30864003)(6506007)(71200400001)(966005)(5660300002)(52536014)(53546011)(508600001)(33656002)(26005)(9686003)(4326008)(7696005)(2906002)(122000001)(55016003)(82960400001)(8936002)(186003)(83380400001)(38070700005)(38100700002)(66946007)(316002)(66556008)(66476007)(8676002)(64756008)(76116006)(54906003)(110136005)(66446008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Mk1z1xb5P/asOp8h7uvd3uVWrjUPpIZFaTWnx+tO3KVLxbYJ4hXhYLHOtEcX?= =?us-ascii?Q?4Pedb4RPmjIRojUB+iXJj/01X8AT3ctSshe1N1r6FSaNiBaL6zE7BtM+N+Qc?= =?us-ascii?Q?XeY+f8h8HLvmcu56fHxzZ/Z6fnWhF35a4+T9vjJJBvK0xdk/SNeoPDNxSBNk?= =?us-ascii?Q?Fdsuyow4XZy8c8L/08YWPuJwBxawlQnzaG/UG3ULbXDm5eaDEoEQrwg55i4H?= =?us-ascii?Q?sy4YbyJLp2t2Dd54qAa0ie3ja0f04doQG0RwZRfbHAzsUj86N8up8FQFAXNq?= =?us-ascii?Q?btYhtBNo6FBemAQj5QZPKkku4Q1E98jaZa470LdefiQZrPXIH5IjRGwFjEHj?= =?us-ascii?Q?oKhLt33AYWvJKouWrf/xVvHRasVqSOwfgTEKDDXXo3LgppBF0FryKBwZR/Uu?= =?us-ascii?Q?t6RvQwAO1o6YnQyGajT/jbAnxkoIyhCosMHkE7iUZHAyP1t1uBjrVLKthc2P?= =?us-ascii?Q?d46RO6MpxQ9Z6UjjHr4bHGMLrF99X4F3gyCLhICYFm1EA7rkxJu2FTtQRUNM?= =?us-ascii?Q?lSwAZIXm+gU3t2Olom0AV3bnF5fKHKr6F9fJFW5lGL6oeQ1YxBWRPjqHRiCo?= =?us-ascii?Q?B/5yLdSnqNasHi9OmecBmILJsAjJ3GtKuS0u1AD34f3mRonoqEVx9Qgb/Z8v?= =?us-ascii?Q?aeJSyln52C81SNADeONFHZkHXnOZE9iHsWOeKoaODf++a5hz6e4rFxwou2lG?= =?us-ascii?Q?lHRvcSbMH07IA5h/cik2pLzbRCdeu6rpl+e3Q4KocT47nBmjruZThWvUAQWF?= =?us-ascii?Q?O/rMeXzGCixAh8A8WdR3R2ztm47HA+TlLt9NqYL8Ag+0Oge2eicwuBrAgJlX?= =?us-ascii?Q?Q7X4PsLkvFABnezIyMS7lzrr7toH2o9AHjp83VKVRpko81AYY6suaPeHzDbV?= =?us-ascii?Q?nhWswCmspkNkCgwztsxL9uPtuD87wEweFQvzKIncRUSeVc0PcdrysYiggH9x?= =?us-ascii?Q?GEI8RYQaCKAv1+HavXQV6e7nQHrXAeI5BegmLxXR+ym5yOiQERkKJ1U+pkx0?= =?us-ascii?Q?6ejdggfdIGqw0hyQWzfpNXh/v2FBaHpMNa61nGuoEr/QMTqRt8VFVb2HOp/v?= =?us-ascii?Q?wEmj0Yka7nhjB1P4Ss3aGf09XEQglX7f6igdF1a/CVZBU2vEMq3fKiHURa2T?= =?us-ascii?Q?LpC0WLaFrBPZ20MOjUsSsX+f8WkEU59Oez6qpxJCCBC60AvxbGdhA9VgRmS9?= =?us-ascii?Q?wdXWWhebPRHlOwKmAtSWQZX+I+BroQkW7ZgHqiYVVlA5Mkzko5Eg6IQjeTuS?= =?us-ascii?Q?/rT8B7zbFlltDJ4RFjQQdS/yIpHVF6b0Jcy76WS4bJkdBC0DTPv0yWMpo916?= =?us-ascii?Q?f1z9C6d22Eu5D/K8sAA92rlnoTdauWUDqvSihX+c4gVwmCab0XfiJVo7/1M5?= =?us-ascii?Q?SrGE1LvKCYIc/bQqm4rAUeXO2zfQV8POQ6gEVRIz1Bh465mQ/Cw9Y9BuzA7r?= =?us-ascii?Q?MvK8d4BW5l9Uxb15CwL3SpyzDbe/K0WvHvMIGajD8iskJR0BlNn/QRMgr+mg?= =?us-ascii?Q?TgEMhL+doXFbWR4niNjSZ9lu5lfj2Pye5mVjYC0hlFb/3StYNOuSkBZdjwyb?= =?us-ascii?Q?VNiDqfJ6gvRSo7ECZ9lxCR77GcM12EpRM3BYFto857lW0O0urCwQshycslYh?= =?us-ascii?Q?9ACuooMoygEtTX4sG91SH/6GQiyaZVeCfeRcP2OqOhOXoqJu45UeG+YgIAmA?= =?us-ascii?Q?EffsnQz2osTSxNu2wbSfnA7+7D6OupWkoqaG88kB0XAyovzS?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1631.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a342ffc-192e-4fe2-6fe1-08da2feaa684 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 May 2022 05:30:08.8584 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: bd8RamJSynZbAw6H8AxCEZ1fYMIvrEQ2464Q36OI9Z0Cnm/Unsu7HYKty1HQKLIZd959+eoGd9F1WTbZ7WSGug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3147 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni > -----Original Message----- > From: Xu, Min M > Sent: Saturday, May 7, 2022 9:36 AM > To: devel@edk2.groups.io > Cc: Xu, Min M ; Dong, Eric ; Ni,= Ray ; Brijesh Singh > ; Aktas, Erdem ; James Bott= omley ; Yao, Jiewen > ; Tom Lendacky ; Gerd Hoff= mann > Subject: [PATCH V2 1/6] UefiCpuPkg: Revert "UefiCpuPkg: Enable Tdx suppor= t in MpInitLib" >=20 > From: Min M Xu >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3918 >=20 > This reverts commit 88da06ca763eb6514565c1867a801a427c1f3447. > This commit triggers the ASSERT in Non-Td guest. >=20 > 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 >=20 > diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf b/UefiCpuPkg/L= ibrary/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/Libra= ry/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 BS= P. > - > - @param[in] ProcessorNumber The handle number of processor. > - @param[out] ProcessorInfoBuffer A pointer to the buffer where inform= ation 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 specifie= d by > - ProcessorNumber does not exist in the = platform. > - @retval EFI_NOT_READY MP Initialize Library is not initializ= ed. > - > -**/ > -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 numb= er of > - those logical processors that are enabled on this boot. This service m= ay only > - be called from the BSP. > - > - @param[out] NumberOfProcessors Pointer to the total number of= logical > - processors in the system, incl= uding the BSP > - and disabled APs. > - @param[out] NumberOfEnabledProcessors Pointer to the number of enabl= ed logical > - processors that exist in syste= m, including > - the BSP. > - > - @retval EFI_SUCCESS The number of logical processors and e= nabled > - logical processors was retrieved. > - @retval EFI_DEVICE_ERROR The calling processor is an AP. > - @retval EFI_INVALID_PARAMETER NumberOfProcessors is NULL and NumberO= fEnabledProcessors > - is NULL. > - @retval EFI_NOT_READY MP Initialize Library is not initializ= ed. > - > -**/ > -EFI_STATUS > -TdxMpInitLibGetNumberOfProcessors ( > - OUT UINTN *NumberOfProcessors, OPTIONAL > - OUT UINTN *NumberOfEnabledProcessors OPTIONAL > - ); > - > -#endif > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/Mp= InitLib/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 (PcdCpuMaxLogicalProcessorNum= ber); > @@ -2079,10 +2073,6 @@ MpInitLibGetProcessorInfo ( > CPU_INFO_IN_HOB *CpuInfoInHob; > UINTN OriginalProcessorNumber; >=20 > - if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr))) { > - return TdxMpInitLibGetProcessorInfo (ProcessorNumber, ProcessorInfoB= uffer, 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, Number= OfEnabledProcessors); > - } > - > - 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 i= n 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= /MpInitLib/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 BS= P. > - > - In current stage only the BSP is workable. So ProcessorNumber should b= e 0. > - > - @param[in] ProcessorNumber The handle number of processor. > - @param[out] ProcessorInfoBuffer A pointer to the buffer where inform= ation 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 Process= orNumber is not 0. > - @retval EFI_NOT_FOUND The processor with the handle specifie= d by > - ProcessorNumber does not exist in the = platform. > - @retval EFI_NOT_READY MP Initialize Library is not initializ= ed. > - > -**/ > -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_= ENABLED_BIT; > - ZeroMem (&ProcessorInfoBuffer->Location, sizeof (EFI_CPU_PHYSICAL_LOCA= TION)); > - > - 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 numb= er of > - those logical processors that are enabled on this boot. This service m= ay only > - be called from the BSP. > - > - @param[out] NumberOfProcessors Pointer to the total number of= logical > - processors in the system, incl= uding the BSP > - and disabled APs. > - @param[out] NumberOfEnabledProcessors Pointer to the number of enabl= ed logical > - processors that exist in syste= m, including > - the BSP. > - > - @retval EFI_SUCCESS The number of logical processors and e= nabled > - logical processors was retrieved. > - @retval EFI_DEVICE_ERROR The calling processor is an AP. > - @retval EFI_INVALID_PARAMETER NumberOfProcessors is NULL and NumberO= fEnabledProcessors > - is NULL. > - @retval EFI_NOT_READY MP Initialize Library is not initializ= ed. > - > -**/ > -EFI_STATUS > -TdxMpInitLibGetNumberOfProcessors ( > - OUT UINTN *NumberOfProcessors, OPTIONAL > - OUT UINTN *NumberOfEnabledProcessors OPTIONAL > - ) > -{ > - ASSERT (NumberOfProcessors !=3D NULL || NumberOfEnabledProcessors !=3D= NULL); > - // > - // 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/Lib= rary/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 gues= t. > - > - 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 BS= P. > - > - @param[in] ProcessorNumber The handle number of processor. > - @param[out] ProcessorInfoBuffer A pointer to the buffer where inform= ation 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 specifie= d by > - ProcessorNumber does not exist in the = platform. > - @retval EFI_NOT_READY MP Initialize Library is not initializ= ed. > - > -**/ > -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 numb= er of > - those logical processors that are enabled on this boot. This service m= ay only > - be called from the BSP. > - > - @param[out] NumberOfProcessors Pointer to the total number of= logical > - processors in the system, incl= uding the BSP > - and disabled APs. > - @param[out] NumberOfEnabledProcessors Pointer to the number of enabl= ed logical > - processors that exist in syste= m, including > - the BSP. > - > - @retval EFI_SUCCESS The number of logical processors and e= nabled > - logical processors was retrieved. > - @retval EFI_DEVICE_ERROR The calling processor is an AP. > - @retval EFI_INVALID_PARAMETER NumberOfProcessors is NULL and NumberO= fEnabledProcessors > - is NULL. > - @retval EFI_NOT_READY MP Initialize Library is not initializ= ed. > - > -**/ > -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/L= ibrary/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 > -- > 2.29.2.windows.2