From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.22700.1647419535575180541 for ; Wed, 16 Mar 2022 01:32:16 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Sd2H6ewl; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647419535; x=1678955535; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=sLIgnzIbbrGCWEmNvQj5M/B2Cv5V//1lAdal56dAS/I=; b=Sd2H6ewl0kk2+DI62GZ4rTLZiKqn9UqcRcA4uEDHNz8z4Rez/D7bymoY 21wI0a6jvmIFp+Y4m9LxyUBL21E64tevgVcGCi4mbr2S+RpZWW4Iv1fr3 CfXvFgf/DZjGILb1gDvH/D32awhnGIBV+dCPwvuPpQW0+DppdUAt2yJ7G JF3M1cTz49jMm/0wR30AlSm+rgIaBjc/mQDZ8o8p8QPYD/zqNG5rXvW/C RBFQo8DYLEMtxvUbxP0L3Aj5d3K/wvf5EeiK/uWEuJic7PjZtk468hYlS WRpBGak4q1m+9im6q7D4aWaxroBZoMCW56+PFN/g5CIUlDsBdoHnzNFc0 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10286"; a="317245681" X-IronPort-AV: E=Sophos;i="5.90,186,1643702400"; d="scan'208";a="317245681" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2022 01:32:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,186,1643702400"; d="scan'208";a="644573716" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga002.fm.intel.com with ESMTP; 16 Mar 2022 01:32:14 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 16 Mar 2022 01:32:13 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Wed, 16 Mar 2022 01:32:13 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.103) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Wed, 16 Mar 2022 01:32:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nkYE05znWcjvj4xJqFlOk7zKEnP+NkFBTIQeanAShJ5c1/fKpfl2AKCp9NECZIzaH9TTOGbjajkFnozqlr/S3WxyVMm/EPNlHxC2mXFl1VykZof8OK0uKlh5ogSpdoXWOHRLsrkOBWKSnsLfNwmpwaRjJAVna0FhGx9/KXMRIBTophN+N/W8MbaoPQGEQfThx7A68+Tpu08cMc8B2r7Ti+rN9CoVmzMNqQf287nZtRUe2ZvQQt2aZTOwWgSm7CsJOckonBi0s8Gl9iDxIM211L0lJcAeBIgWjmT1BYpaJrx6zPXmoBc2BuRmm5f5sPdbgonDrclNX40xHUSPDJoCog== 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=sLIgnzIbbrGCWEmNvQj5M/B2Cv5V//1lAdal56dAS/I=; b=n4wnlpLFsC9kq2C4K+wh4s/pEe502kaxC3sYx5r9B4k/VqLlEHZ9/01CvUcK8ZK9VgZFgRk3HHv5vzyS6ri/7azzGWFnC6L4Aupp316Xa1CG34ECONxWoFMc910cFzi0LawRmA8t7CWgRbvqKBeEhutu+YUUHCabUN4eIIGGGnVSjyD2lH66Ptq4pCY5/BYl4KgHP3SimQ/Yd5CDQdfnUADnidxEL2bdkVQpqVVNzKfYDoJDWxX90wXrOsQ48Bi/H9Eo/R3pQ+VRbqOJZbTWog3RuCTkk4htURFPh+Avb7SBivtJ5yKBpmZw36+Y67IztKUM7LEAhx7vyDTYUMaIfQ== 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 PH0PR11MB5064.namprd11.prod.outlook.com (2603:10b6:510:3b::15) by DM6PR11MB3740.namprd11.prod.outlook.com (2603:10b6:5:140::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.24; Wed, 16 Mar 2022 08:32:05 +0000 Received: from PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::ece5:6170:a99a:480a]) by PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::ece5:6170:a99a:480a%7]) with mapi id 15.20.5081.014; Wed, 16 Mar 2022 08:32:05 +0000 From: "Min Xu" To: "Ni, Ray" , "devel@edk2.groups.io" CC: Brijesh Singh , "Aktas, Erdem" , James Bottomley , "Yao, Jiewen" , Tom Lendacky , "Dong, Eric" , "Kumar, Rahul1" , "Gerd Hoffmann" Subject: Re: [PATCH V8 13/47] UefiCpuPkg: Enable Tdx support in MpInitLib Thread-Topic: [PATCH V8 13/47] UefiCpuPkg: Enable Tdx support in MpInitLib Thread-Index: AQHYNbRAUWp0dpIQT0aJEtKk5R8BpqzAGVmAgAGQzQA= Date: Wed, 16 Mar 2022 08:32:05 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.401.20 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: b4805301-b80d-43de-fdfc-08da072773fe x-ms-traffictypediagnostic: DM6PR11MB3740: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: oSLUc9WNNQaxTQDbP0nMgagUDBJh4Tra7KmKTSgBimZSEPhzejDOZlzsXEGkNuIqc8GF9dX6JCR0lEak5JfhNowqbWwpkBi51KFflpnohML4UqZa2yr6HH8Zu80hJYtUcCaOMkO0z5dN8kTGKscJMML8G96TqCHW7EXdlhj1A5E2dYkKaOv8Mgf72Gov+pM+/D8rR5Pg7lEjvt4zDyfq2RYrdRo8lYMrybe1/qG6r8kpaUDaFxBtc9glCtQWF2m5x/Y6JzEYE11aWuYUctnEuF3aKSnxtq8vkbYvhURuLm3sY73jWvS21xKyHRVCqi/D4X2PEc2Flq9ccQMYNFaNWoXYTP+yC7+FOv0Cjp4eJVuWzMpuZtxG4qR9GQFE3P7FTnc/8KfQP9fUHL0qxo9g6QHK6l0yYO8M/tBW775WSwNieFPFMzewpPLpN/qkOiafSkZ0ejO1C7vg9U8bZGLOesuGuwjvgQXDCXhwDnwySwHx2vwAPjQ60o3Y/V8N8J5IgnlK4Rf3VOrpjt7oD8tQ/0cg3ICTCjnc7Vrjv2f6Krw/v/IgWeBc65XgRxwtaVPRwljSq7d6tjsbuYwu56raMYie4akuwT6Jmpo/ExFa9qSVgyKxk5h58MIg4oHQKXENTcfQMRJ6K+Tnnr+4TfYsCsCrmnEBDTjHvpy99zx7ay/61hTKDxIbiDrRr4cJ6YDcHGbf/Xdt9XHsnt1jHPOUqASnn45oiSjiuIyZuWmPl1s/ML8wpXP6oJn6+9TGFb1BZNAkDgxyxG2m5CmX5GybUMw922RLo+HT5FASwb5KKM5XEReKVV0MHc50ZoX8oGlnXXwF8RumOVxiS2dqiRGGoQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB5064.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(6029001)(366004)(38070700005)(55016003)(86362001)(2906002)(83380400001)(186003)(33656002)(26005)(52536014)(66446008)(8936002)(71200400001)(64756008)(66476007)(66946007)(38100700002)(76116006)(66556008)(82960400001)(316002)(966005)(4326008)(122000001)(508600001)(8676002)(5660300002)(9686003)(110136005)(54906003)(7696005)(6506007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?NI/YNW3VJ85WcWpm6QqBHnjwHzse9XJxZ6cqnEvWl6DGFpSZHVcidoKNLSCE?= =?us-ascii?Q?ABRTo6bnVPPyQiS9XIkqZmIbMNl49qpCg4UgoMXa2l8Ug1pgWMINRxKYNvIE?= =?us-ascii?Q?qNG4C9kFPgubba+gWYC2ONXvtHjkraMA3WgXON3+0yI5xqDShAdHD411iFkk?= =?us-ascii?Q?lei+sR28UTBhaibNbN7KY/u1U9nINWfKDuktX+qXjFZLeaLqHr0e0gqDMdtN?= =?us-ascii?Q?KEgfCloWA5cCRho892qRu969ftYKDn3syqQRMPtLb106aBcPfS3SlxZpk4DC?= =?us-ascii?Q?UgunGz3VQPH5C2NWOevfO/ZPEk01ShxpjxJc9csrjreHlsCH1yeZDj5CHv9M?= =?us-ascii?Q?ZXVlJDPWu2JgZn07vObF6l4ZrseWVnUqfRj8Tkavi+FzBEhUo8A+Tm0YE+IC?= =?us-ascii?Q?ckUlWIBdkz67xiF2Jf34yMcXaRaT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ii?Q?ldV1Ow6Ld7H4aqEUtd4jCZ7/byuJ6eKWDGs+q3bPQwGLVBrGjUBokSvTq+Wt?= =?us-ascii?Q?O0hzTQtG8I664QF9Gu+w8HGOdh4fF80H+U4ddUZzpHNhHOChE8rmKW5EsHbr?= =?us-ascii?Q?tp6foXFSMRhtOmwG0rmDNIhU+djyC+Ax?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5064.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4805301-b80d-43de-fdfc-08da072773fe X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Mar 2022 08:32:05.6462 (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: BDNFqsfM8el6w18xxO2Tck6OM8hTxhaZe1uuulmm5+xNswhu8JTpgiUTxkU3vv6L0VZWddlrnEIbxY21+LhIcA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3740 Return-Path: min.m.xu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On March 15, 2022 3:58 PM, Ni Ray wrote: >=20 > Min, > I don't quite understand. >=20 > Of all MP services, the TDX version only supports: > * GetNumberOfProcessors > * GetProcessorInfo >=20 > And even when TDX MP returns 3 or 4 threads from GetNumberOfProcessors(), > StartupAllAPs() is an NOP. > Will that cause any issue? >=20 > Can you avoid running MP driver when TDX is enabled? MP Driver cannot be skipped in td guest. Because there are other drivers de= pend on the protocol (gEfiMpServiceProtocolGuid) which is produced by MP dr= iver. MP service of Td guest is different from the current MP service in EDK2. Td= guest implement the MP service by the mechanism of mailbox. Please see [TD= VF] 4.3 TDVF AP Handling & [GHCI] 4.1 ACPI MADT Multiprocessor Wakeup Table= . [TDVF] https://www.intel.com/content/dam/develop/external/us/en/documents/t= dx-virtual-firmware-design-guide-rev-1.01.pdf [GHCI] https://www.intel.com/content/dam/develop/external/us/en/documents/i= ntel-tdx-guest-hypervisor-communication-interface-1.0-344426-002.pdf So here is my suggestion to this problem. In MpInitLib if it is Td guest, then GetNumberOfProcessors just return (Num= berOfProcessors=3D1, NumberOfEnabledProcessors=3D1). Because only the BSP i= s workable at this moment. GetProcessorInfo returns EFI_UNSUPPORTED. Because in current stage Td guest= doesn't have the MP Service requirement. What's your thought? Thanks Min