From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.19910.1647393542462815259 for ; Tue, 15 Mar 2022 18:19:03 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=a9evx4Xp; spf=pass (domain: intel.com, ip: 134.134.136.24, 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=1647393542; x=1678929542; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=f8yfYfhmxCTtXhD3UzR1yW5Lohr7shJmMqPo2ojLlss=; b=a9evx4Xpji9QgRkop7iL3SNh+v3IkWGSRzobDMZWNp5mWbpaft8P7RQN UdgBeolAeSzKJDNHD/WSMrdX11H0y1nfNY01lgQsG7rT4uwILCBiy/jXg b8G27yVPCB53jCIHCIxwS7Otz4GJogtSWUSLKp15cq7AiEA/Oz1tsg8Yy 5RHgRUTgsfhNM0nkEEisD1P9YzYWwgv00RnTUIbfWXqW1QvoC4MFhjKid NztZAZxvbieOeKNkfpxxHlVqCVHvstVh2sOfikrtF/fn6FxAbNnp6wzuk +5NQME2vaTLJ5Gwxxi1WBfE+wMMCf8HuyQnsJKF7sTCZgCvWiD6DnF210 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10286"; a="256185074" X-IronPort-AV: E=Sophos;i="5.90,185,1643702400"; d="scan'208";a="256185074" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2022 18:19:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,185,1643702400"; d="scan'208";a="714399037" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga005.jf.intel.com with ESMTP; 15 Mar 2022 18:19:01 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 15 Mar 2022 18:19:01 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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.21 via Frontend Transport; Tue, 15 Mar 2022 18:19:01 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.104) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Tue, 15 Mar 2022 18:19:01 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hRDedfHpp+NQErlJ24tuoF32YnVX4a1+rZu4ZdmjdnOffUx+JcwYJv10n84jaFxvMf39WuPMwq5OzaiKTo+MUMwK3NoSSFAMtQ2T4ylSuYdZoeb2YXJyuHtLR+sx3Bv3EVCr4hSmIe5SHvSaXI0cQoXXRS+nJq61T9Dl5n1aEovo2JJ82oDJoPJ9vCv0Y0XSgIKD+42uN+LYYv3DEDzZgcBrepVVNG8tyJ72txZ/IFRP6ST7VeMoEimi6zFyNbBU2hHmPg5j8M6NyvfATEDgCgFITOMiWSjNRPbKHiaRCQ6tV3z20Dsb0qJHO3hhon+EEDRZs3fcEXgjgUQWiJP4xA== 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=ceDzavFxNOHmniReQDXLyDoD9p0v6NQQZtCPT5ISvbU=; b=POPgju5sTHheGapWWGBDc8QjHUIJMJFZ9d0D6YwkupoPQlZpFHZTNxoVau9IER62YLmKSVtSLMzBy16a45KB2p2tT0XnP804nXq+boa0j94KQzhztuRS4eJlXka2mxPd0H7U21Z3Itwz3W7F1QodG3U8BypWmBIdtnZOH3nc5bMPKvwBlVhokT8bOWjN2los9lVlVcMr8LSHiMKWJOtCcrM0+MgyblwJYLOk5B4byi7c7W8yo0P/iP0wcfML8V4JLXwsFnDSz48AxkZuwqcMznlAKz2AiyrwBkFW69s4rptKW7vpx9EZlgdrzm/pFe0HKWWVD/hm3WVGjiCmhnEd2A== 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 SN6PR11MB2815.namprd11.prod.outlook.com (2603:10b6:805:62::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.14; Wed, 16 Mar 2022 01:18:53 +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 01:18:53 +0000 From: "Min Xu" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Kinney, Michael D" , "Gao, Liming" , "Liu, Zhiguang" , Brijesh Singh , "Aktas, Erdem" , James Bottomley , "Yao, Jiewen" , Tom Lendacky , Gerd Hoffmann Subject: Re: [edk2-devel] [PATCH V8 02/47] MdePkg: Introduce basic Tdx functions in BaseLib Thread-Topic: [edk2-devel] [PATCH V8 02/47] MdePkg: Introduce basic Tdx functions in BaseLib Thread-Index: AQHYNbQjjtSvkrSrX0C8H8lbdUndoKzAFNYAgABd3xA= Date: Wed, 16 Mar 2022 01:18:53 +0000 Message-ID: References: <78b2b2da2b70601cc173ce5801138226ca9f4bb7.1647047481.git.min.m.xu@intel.com> 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: b44b34c7-984b-4bca-010a-08da06eaef98 x-ms-traffictypediagnostic: SN6PR11MB2815: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: AZpJr4D25jfslMUTB60ln3EhNbpqyThhXucNtvDL5F8biLwjP+iYCHX2JDG3+YXBATBFomzoPMGNWLCbPRZsmy0PK3jZLbB1ATdfLxuhWXU3XMvgzDcy+68F7pUPb3tD4HHbvtn9R2rxkteL2SUyuefCnHRZKiEnJDJ6IL+6pEm8NePXd9k+xO/wC93Y2iuxtFmfWPmY3J3W43eZCTURSJjJo18CSOXb4uMhFjgKZL0NZen/vuZ2fhT9WVWnOnVLXCaZS/VCWDKqp27y7Mq8J6/zKR7d5TsG+0qui4KCI2misJPQ1PZGNFZiNnX5z382A4D1zKw3rWkGc5n2/MWZAX7kqxa9cAMEbPEz9bTtMwjX59bPtpLSGwyPiOTpGw7xRIZd3VyQTvj7qCV+m3rr7sLPZJFpAb2L/4gjQPgsfIlbMeR18RSZ4AB7csgW8zrEO4VHwqR9laerCsRs1C4DpWXP6NtIqW4CqFaAQosBDQdBiS0H54kWYAcSwySSqazocyjdVaNqlTYW8W0P1T0+dzQNAqZKFmlFouRDcGJ9SJvH5vZv6Axv1iI9kp6ppn++fMiyIV6PcCKSX+wmqkqyjMlpkuzkeK1KOMw/6PknwtmhHuyRNopUJCVcyWWzMEvFN4HDgPZP1kgCopGTcaMB64hQrnsvqoB0R1YraMvn28AItuW/qagNqlJKB8ldscviD8fkzr8WzIAJXycbmPqeLzGWZEdp0ekbVzAknEYn3WFE1rAVw8Xhb7jaabhvwgx4gwqVaqsDSWBAMUvcKxw2p/H3jmHM+4xguCSeOatyDgc= 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)(366004)(82960400001)(66556008)(66476007)(66446008)(66946007)(76116006)(64756008)(4326008)(316002)(8676002)(33656002)(38070700005)(54906003)(86362001)(110136005)(83380400001)(186003)(26005)(9686003)(508600001)(122000001)(966005)(38100700002)(71200400001)(7696005)(6506007)(2906002)(8936002)(52536014)(5660300002)(55016003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?fT3eoytcAkl2iV9ddmPIEHxMAMwsG8SqqGsprO2qMjTqJK9xWtmHrQrgoVkh?= =?us-ascii?Q?GZxJmi93hoHeL5VRGpcrZYA42yRAdUO8aXatysZxuXZmfvxtMTConUP7U5l0?= =?us-ascii?Q?Za05r6MNsQCOObXikOrUcqXF/iGhdBSkhVB67dMHIlHLuZop1Da/xzZ/j7Xl?= =?us-ascii?Q?dptdrr+ntWgp8HpdlUAE4qgoWd1oHvwcgYDt+CBFoeaQEjG4djpYmyz2Zw5T?= =?us-ascii?Q?1lrc1yH+EOvLacXRVM/ISgXMTldRaGDhDQbCt9E+nTtcElFwgtoUPdbxrG33?= =?us-ascii?Q?7+fM60Qd7molN0nlsykakXEGWe/VdOkHXnvbbCUlf8hXIxLyExh0ACPZXXIT?= =?us-ascii?Q?Y/a0eknSjWKRltiH3ORVe3k73X+DbC9C4ZMguXnpod9m+S3Bvr9qGfolCepR?= =?us-ascii?Q?iqNx6hzp6u5KGajvh4ohPV1w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?hHt5H2+Q3nabBP2l23j3JF8jCH5McwXRu1NZ4z5gI1jCspMyBgoSJyoRibGw?= =?us-ascii?Q?jKpkLEI3O2dsVKqEhcaK4Lo66lcaArgXfL/+HkNUUr3jtYg3Dun1AHv8ooKJ?= =?us-ascii?Q?TTmpgZypLY7mlOMxTzefucMDxGWJjyry?= 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: b44b34c7-984b-4bca-010a-08da06eaef98 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Mar 2022 01:18:53.6458 (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: +LCvXj3SAEnZ3EigUS5z7a4W3muSI7G+WnJGL46oN/iV7/j7zUhiwWUl2KTCDhmdz6zNYUzpkOEpTh9lQ1Ri4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2815 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:42 PM, Ni Ray wrote: > + > +%macro tdcall 0 > + db 0x66,0x0f,0x01,0xcc > +%endmacro >=20 > 1. can you please check whether the tdcall instruction is supported by la= test > NASM compiler? I checked the NASM (2.15.05) doc https://www.nasm.us/xdoc/2.15.05/html/nasm= docb.html#section-B.1 but not find the tdcall instruction. >=20 >=20 > + AsmCpuid (CPUID_VERSION_INFO, NULL, NULL, &Ecx, NULL); > + if ((Ecx & BIT31) =3D=3D 0) { >=20 > 2. Can you please update CPUID_VERSION_INFO_ECX in > MdePkg/Include/Regiter/Intel/Cpuid.h for the BIT31? Sure. It will be updated in the next version. >=20 > + break; > + } > + > + if (LargestEax < 0x21) { > + break; > + } > + > + AsmCpuidEx (0x21, 0, &Eax, &Ebx, &Ecx, &Edx); > + if ( (Ebx !=3D SIGNATURE_32 ('I', 'n', 't', 'e')) > + || (Edx !=3D SIGNATURE_32 ('l', 'T', 'D', 'X')) > + || (Ecx !=3D SIGNATURE_32 (' ', ' ', ' ', ' '))) > + { > + break; > + } > + >=20 > 3. Similar comment as #2. Sure. It will be updated in the next version. >=20 >=20 > +%macro tdcall 0 > + db 0x66,0x0f,0x01,0xcc > +%endmacro >=20 > 4. similar comment as #1. See my answer to comment #1. Thanks Min