From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.2202.1636095197444573173 for ; Thu, 04 Nov 2021 23:53:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=laQ192TZ; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: min.m.xu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10158"; a="232102763" X-IronPort-AV: E=Sophos;i="5.87,210,1631602800"; d="scan'208";a="232102763" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2021 23:53:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,210,1631602800"; d="scan'208";a="468745737" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga002.jf.intel.com with ESMTP; 04 Nov 2021 23:53:16 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 4 Nov 2021 23:53:15 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 4 Nov 2021 23:53:15 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.170) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 4 Nov 2021 23:53:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E3NfFvD0sx+WgzHzpJk+8FTT162IBq0RhbUsLe5SiQyaLzVY2XMkytEGFKuxyvJIR7ncWf8do7qSdv4gpn210CMI0MvS69foY+ff8FXJTkOi8NHsMFW8NDuQ8sZyOCp1oQHigynZ1Rz+mcDyGjBSpm/T3qit8LIDzKi4AmTTh2FyGCtWW0aZerv+hqAV0yC6ez1c8S27NNJ1foSBUpmGBjw3nIOIB3eYVG+szb5ifXpdEuHE0zRshW+K0+3IiPiFT8rJE1re5Z6JK/hpviPiWrK0d9C1prpUZ95jipn7KSciWfT9IiMBXfbgE0Rulv4tG45/MNHO4HK2Q+pgZXB5Mw== 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=z8pilnCNdGSse8jJhQ9yUCORpF0K1u+6js9HiMTNDJ8=; b=M8669AC5H57SJk0zsVDjf9uvWK4q7rlkiVMBqT610lM+WW4iCSdpyjmzh8fuAP8g3lFBWcN6fdn5syxD9T4SIZnbFh3eW+Jai8I8AFrTtqYNLU8TpQfI5cTWwyr2m48WafrPJ3ybu+ywPtn0y4PkAYvm5GOTe8+LJuj97AFGFVtls+uMgWP8gHi8sKQLQuBjuLOF9AdeLnrcDcmz8ZcLHPBIaVA0alSrp87+NCM9getb4ZHCvDjBMITnV/LdOreNg4Af8wRuzUJlKQTj8lVD/urAE+93qM3if904lE9OBmI97h4ySOEeyiARPtNZcxVqm2N5ZOHy01ZcAHmVQaCH9g== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z8pilnCNdGSse8jJhQ9yUCORpF0K1u+6js9HiMTNDJ8=; b=laQ192TZPrQ8tNF9E9LRW3gndz9Zs041dXUZfgFRjTxxEvrE1cnv2gKaPZZ0qoPK20Ia6XwQc4dHTfIGpD4NI1lv18Go/Twv9hY0pGRMAG73Y7Rz7teZMb9RmHHsiEqw2FFyowrjvsKkAof/XL/HAYw+uT4ChLfKdFBOcsygSgw= Received: from CO1PR11MB5058.namprd11.prod.outlook.com (2603:10b6:303:99::17) by MWHPR11MB0046.namprd11.prod.outlook.com (2603:10b6:301:67::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Fri, 5 Nov 2021 06:53:15 +0000 Received: from CO1PR11MB5058.namprd11.prod.outlook.com ([fe80::49d5:fe9f:6dd9:8f95]) by CO1PR11MB5058.namprd11.prod.outlook.com ([fe80::49d5:fe9f:6dd9:8f95%9]) with mapi id 15.20.4649.020; Fri, 5 Nov 2021 06:53:15 +0000 From: "Min Xu" To: Gerd Hoffmann , "devel@edk2.groups.io" CC: Tom Lendacky , Brijesh Singh , Erdem Aktas , James Bottomley , "Yao, Jiewen" , "Dong, Eric" , "Ni, Ray" , "Kumar, Rahul1" Subject: Re: [edk2-devel] [PATCH V3 14/29] UefiCpuPkg: Enable Tdx support in MpInitLib Thread-Topic: [edk2-devel] [PATCH V3 14/29] UefiCpuPkg: Enable Tdx support in MpInitLib Thread-Index: AQHXzyL4/LyrZHH5q0iUxm90gqEiQ6vxVGAAgABucWCAAUWnAIAAeH8AgACFoxCAAHzEAIAAAYpg Date: Fri, 5 Nov 2021 06:53:15 +0000 Message-ID: References: <9d8a7f7da913a1062d3f01e24615bb8bdc958458.1635769996.git.min.m.xu@intel.com> <20211103060914.scktdnjbfzrtu4xk@sirius.home.kraxel.org> <20211104081004.4mhzk7hqozg3prrp@sirius.home.kraxel.org> <20211105064612.yxjrsxste3qyctqe@sirius.home.kraxel.org> In-Reply-To: <20211105064612.yxjrsxste3qyctqe@sirius.home.kraxel.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 63628de2-8c90-4b13-e103-08d9a028f112 x-ms-traffictypediagnostic: MWHPR11MB0046: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GijJ2ZC+fifQKSrQVcpORorVuo8qNPQ0wY4BPFuHJEULupXStvnbKvD0dD5k/IIf7Fu0YyjuWa0IcRng6OTIxHYMtOPlJ8FMRxVN7vNSp1JY6MU/v6fq9KSz7PDjZDMcjDNcnzJHV9quieoqJ4+IY0DTpgPhdOyVopSXXGLypuUF7+XKCJGL7svnnPgPuD/0cdwONOk1H9dCEVEyjrRuhTON5CXotXMxFXkusMdhXGMh2CkNBDQUrlGhRVn1MWoAGgvfMxuiWGAKqVEieR47zApj67pZleWcTSJHYkMyy+NIilJlfEEh4iJkoIkZDKZgIDrl3zbzvKbj7ONKTYx0HsTS9E9OfzkTBaRbusADNPA3KGyACK1AvNJLToVsw1YrOydYVVVWd89sBm0HB6uf7/C9zQvPSWFgL9LDlP5HYKTfeSlFp5bK+gLmuSiNZwPsj8N716q5QLTAoHAlJblaU+OjX3oisgZkD0Al79d39K7MMoDmd9h2K81GEUp/7MmN6eWkQCmX/RD8Ag9Va8PBvTYobutaTq1Fp3uK+FEDauaXbTIk/SWnP9NgzdY6JUhdNDwX4Lj4PQ1dwb+C7nitHt3NNTrRusZCYrn343choxJI4w/TLogyie6IpJcJfb8e6DMxmXB6fWUqLOYWNl9+jxFutiKEMsra8CnJQe4wJxw/IkK1YKtgM3eLxsjCRi3pU3A3YaaweijHGA/vyO7FZg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB5058.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(366004)(26005)(122000001)(508600001)(66946007)(2906002)(86362001)(55016002)(9686003)(316002)(76116006)(4744005)(82960400001)(71200400001)(186003)(54906003)(38070700005)(4326008)(107886003)(110136005)(66446008)(64756008)(8676002)(33656002)(7696005)(66556008)(8936002)(66476007)(5660300002)(6506007)(52536014)(38100700002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1oAmUUZr4ovTGaD9C+GowdW2+J8YQWcJGhH2Z12q5jJseGgpRbb3WRkO6nPV?= =?us-ascii?Q?WyWGPnR157J+inoB2gHrsz6T32BQREOrd0cmtwyIKm4ufjWluSlJkgDHlVVZ?= =?us-ascii?Q?Lu1dwKqLk3bT+maEffI28Iy/JJ194Yo0XDgVZQeb86BDX9P9VNideCA2257Q?= =?us-ascii?Q?zwG7m7rtowvbZfoScKuu+X/T5RHXBuzahJ9cyQpK1Qg9H2s0Bq9jygdZsFg5?= =?us-ascii?Q?enBt9LoF0cebwXnaub4+WUbWIk+VtTgGQ2DlZjFbmeP6sFu6g2Qd0fGvXQ1z?= =?us-ascii?Q?hbw6L4fXW1nXe8vyHVa5fZkG5c1R2ZVwZbwKuXH1Q/qexFpX2Pgmp8MF07nO?= =?us-ascii?Q?KTJeKYl8d3H1AI7VVPbGdgqrPM0+1YG+tDrE3Xnjs3AmcQvvIDG5XvOot/5m?= =?us-ascii?Q?Wt4BDLtXiHumLWZT1iWa4A8t0Q1Ixl63uvV2pJJcGxmdjOjSShSfQopXkNy9?= =?us-ascii?Q?Kqu3HIaswXEWdGEBaFT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-ascii?Q?dpn+jg2TjAw1qCfCJOPdF1vdqtmMhgG+XYiOvEZgIywVOi3VH4wCZMlFQQhx?= =?us-ascii?Q?KTHfaX+T3y70cz7RvB6ECUoR33XCEAa8XaIkAFsvFN/zh7eFqkD+Cw/qb+R4?= =?us-ascii?Q?Ee8oOo6Gnfm89W9f0ReHpuY39k2Noa7/4ghhU8mYUsHKArBqAvFVcNEGPetB?= =?us-ascii?Q?b3ZdYIQFZuED90het4tbR7uACZfvnlNGU5wX/97U9P2dKPFN6ivJ+Odvyemr?= =?us-ascii?Q?S110EJV2LrdXwRcS98oFtdE=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB5058.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63628de2-8c90-4b13-e103-08d9a028f112 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Nov 2021 06:53:15.2282 (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: jg+d/JTjX808gZjYN+HIpsPO5lsVxEswFesn+czo55eKFbM4G2KMvETC9V0m78XaWVOQKZoiKXwuC5JR098bdA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB0046 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 November 5, 2021 2:46 PM, Gerd Hoffmann wrote: > > > Can't you create something in MdePkg/Library/Baselib and then use it > > > everywhere it's needed? > > > > > Do you mean put the basic Tdx functions in MdePkg/Library/BaseLib? If t= hat is > the case, then I would add below basic Tdx functions in BaseLib: > > - TdIsEnabled () > > - TdCall () > > - TdVmCall () >=20 > That is the cpuid-based check and the asm code for td calls, correct? TdIsEnabled() is the cpuid-based check. TdCall/TdVmCall are the asm code. >=20 > > Gerd, what's your thought? >=20 > Looks fine to me. Thanks Min