From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.72117.1674214943891807434 for ; Fri, 20 Jan 2023 03:42:24 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=DRM+FvzB; spf=pass (domain: intel.com, ip: 192.55.52.136, 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=1674214943; x=1705750943; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=b+zzLZRf4aN2C+hCp3BxWwTxzSkcvvRmx2jYAOwGy9M=; b=DRM+FvzBpKDt5hutxwUTbS6MyaeHmdA3MWk7Iztx6LzGT+Db9B1PnHPr nluzQXzZhDwBuSmOSUZuOCBqrMrEUPmDz38KyMRRVRDXJvpnSeSozlSyT UAXbN7jRvUUWOHgNFgglblFnp1FI1WlNvbJEP130MMZtYaqcfurgt7S9W XQdK4QQxgJ9XEJXR3kKfRg8C509ju6SrEfbgrkoKqHBW/frqzJ7LnWp5h 3FEGs9J7dMdqZ24ezZiV2GVUzSGsOW/DUB2lU/Rcpx+WUVUUW8fa1WuyC Z6Piam/BFnsxRPqTn2ZpUXpqQbBA7TtnQ6ihWDSvYBUxvwUFYmtGR7C++ w==; X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="305233446" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="305233446" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2023 03:42:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="834386526" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="834386526" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga005.jf.intel.com with ESMTP; 20 Jan 2023 03:42:22 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 20 Jan 2023 03:42:22 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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.2507.16; Fri, 20 Jan 2023 03:42:22 -0800 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.2507.16 via Frontend Transport; Fri, 20 Jan 2023 03:42:22 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.108) 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.2507.16; Fri, 20 Jan 2023 03:42:21 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L+kGfeKbzJFaJQrKDVoXjDl366Ih2+YxTTwXGWe4W7DhAhjayNCPfSewVkpKFitOIHT2mIljWW8TICjnPoN4R0OjQI0LJLIyI4Y7cb+5MZVIY1lK2z3lPcdL1JLMxu+SvAFnKTf5jP6nR6LrfiQ8DiuLgV2v+xjKtLilBByLr8IuzHOWbPIMbbK0JyYSo5bI2Z7JvAzDnHHJO72aeqMS2bE+10suvCx0A8Q9CVlrQu+W2a591/Ps9ipH040dsIiqXk2pRYRfTSgcv1N+t1pegUZ8ddx5hX7cIpV5Uqne2MQfwFwl923g+Tyj9uMaj0LgMNlM8YyYsDKCQg6IualIeQ== 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=RBmLr9sByEfJ2m2rdpIqMYY8ZlcuKkcowPJeGiM3JqU=; b=J+pV4Y7a+2v8NxzCdqaqgOVA7fbW5G6FpGRKhdPqFl9y/zStRm0QlhYfsI/UuHJibyjPUQ7Z8W4uk7vh64KZFmV2V+U4yMbsv+HDWbqdN+8a3j7RkUdyFolAaKI/Zddszs+pQBTEz6l0m9Bus4O1WKXfrBBR6AObRPXWqwu9GF88uhtzGAoxfixiuPESyz9a99YxDJSBYbyXpwJHqebvxGVx75+40CKa0nNTwAwsRPA/91mtQRGxq+344CfxoMhoRSk8YSbUrF2zfEUncauAs2qo/wJX37j6AtWMhmK8+2HRyZRXQpxpg7B230hK+ReFPFO1uks4rCs58MkmaJgHfQ== 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 PH0PR11MB5643.namprd11.prod.outlook.com (2603:10b6:510:d5::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.27; Fri, 20 Jan 2023 11:42:19 +0000 Received: from PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::d87:9f99:2db2:43d1]) by PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::d87:9f99:2db2:43d1%6]) with mapi id 15.20.6002.027; Fri, 20 Jan 2023 11:42:19 +0000 From: "Min Xu" To: Gerd Hoffmann , "Yao, Jiewen" CC: "devel@edk2.groups.io" , "Aktas, Erdem" , James Bottomley , Tom Lendacky , Michael Roth Subject: Re: [PATCH V2 04/10] OvmfPkg/IntelTdx: Implement other helper functions in SecTdxHelperLib Thread-Topic: [PATCH V2 04/10] OvmfPkg/IntelTdx: Implement other helper functions in SecTdxHelperLib Thread-Index: AQHZK7YrgVPaTkexhUe4Crhi5Ela4a6lgJYAgAFqSJCAAAsagIAAI68AgAASUbA= Date: Fri, 20 Jan 2023 11:42:19 +0000 Message-ID: References: <20230119032822.1406-1-min.m.xu@intel.com> <20230119032822.1406-5-min.m.xu@intel.com> <20230119095422.ou5vbckdyn33hh5c@sirius.home.kraxel.org> <20230120101828.jf43j7ahxqossace@sirius.home.kraxel.org> In-Reply-To: <20230120101828.jf43j7ahxqossace@sirius.home.kraxel.org> 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-traffictypediagnostic: PH0PR11MB5064:EE_|PH0PR11MB5643:EE_ x-ms-office365-filtering-correlation-id: 99eaa5a7-eb78-4589-dcdc-08dafadb6335 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +F1n2fW8fABK70gOuOxAXSPJpw8a8FlQKvJGqU5YoIbmlWny5SN/A22JQm4fyfjidico2YqgUu9dbalDU8n5kmZiIGLLiXya0sAX8TMtBs0K4fDKfIoierHcVtdo0DQIP/59GkuKZKqd3r67IeDrwIpalkxX9oF2n3DbCDIj6fGJaJTILy1zfk2frdKLj6SzV/WM2G8CxpjEy7EyxK7HaJPBK2wHKLmRJvLlB7kmLwdUNLJTCCLergjlR5iQlCc73i8SMtHK5N08f8npL4FugHotqVeVrdbIVCgEbmnmGFfYfMjxPGjSfLE/yz8xM7vvtgPBAz/DiW7u4xvQHLAam90sCBHPJExbgbhBM4tHI692dKyDMT4nB+/R3Ls+kIwTp+BcOKG7LW9KjW0R4tq4a6PDrNlF3TcN++1WpbKGvF0aKHWmGHln6566W9PRQ5xO7ygDz6mlJUJ68c+FNbyyzwpy9FFsjvQ0kvB1qK76uIZ1T0PI3iEw/xCHgGytwf1Vl6fzHnOKdhyXxzKF+FAVfIltkXrTvSka5lDbzW3N9kq4OZuTemrmzAe/8Hc+Nq1RqkWWFn+4g6GLGqFl781vNpvT+W0qCrnDqv+kSu2JGsmNbbLYqPEkHotBAd/LAu6fXOanEOlAI/6NlBg8wW6MaHkkwI1/WVI6jhX/5rRaQSQeQSvunhN8Lxfjc+PAuhBLBsiKeSS4YzjGOeq+VjDeIiOhQmkOIPKkke4dsnWjltOJ0Aq4mn6ABwmlHQKZNGwTXo7VSKT3Je/Fzmd8WTFASg== 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:(13230022)(39860400002)(376002)(136003)(366004)(346002)(396003)(451199015)(6506007)(33656002)(55016003)(478600001)(54906003)(6636002)(7696005)(71200400001)(966005)(110136005)(66556008)(76116006)(66476007)(4326008)(66446008)(64756008)(66946007)(186003)(316002)(26005)(9686003)(5660300002)(8936002)(52536014)(41300700001)(2906002)(83380400001)(86362001)(38100700002)(122000001)(8676002)(82960400001)(38070700005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?iO4KNx7nJlBT6MksSNlARsso/arSHWpEvw5culLQHczEb4FLZhyuKZx7F8mb?= =?us-ascii?Q?5FM8iTh8YdKBSHD4NNHo3kjCLd07tG3cFdjmoyq7h3+cTszF2ymfx/MjJTlL?= =?us-ascii?Q?HXsbHeP3OVcZDlY5Jb2yUQ6lMWXbiKCKjWP2ZM3MtBQ/osMGpOtacS1+ezGC?= =?us-ascii?Q?Nn3Y8nVM1DZahIJc8v6piaut306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ii?Q?0KRufwkKtveV5Xh9xo0JoOVwQtbuFfrkPeYtpmOnFz5punO7mu/0O7ygyimd?= =?us-ascii?Q?ZO/cug5YgLr8PBfTE+ex29/0yP5QrS6AzMLOlUJJDCMH5GcapogSbA04vcsP?= =?us-ascii?Q?mKUwF0rsToecDPnfswKpk8mBhfZ11E4+ZjcptIdmd2T4U/mnuUdZSPAd5krR?= =?us-ascii?Q?s0Z+mYUsYQPK8nfwZi7xWklqga8yw8BPfMo9Hd1U8rhN0+zwAY2mJ0RLw2W8?= =?us-ascii?Q?15ExuGUvL4Uy98jTJBS9BRmeWzpD3/i/WiUO6tw7Bvna012ZxaBBdKeAFHlc?= =?us-ascii?Q?mDUxgEMpASzpXtnAXurlS+WkIO9DP2xIvYl+DuMKcp61l1t03elqN4Mk/Quc?= =?us-ascii?Q?EpfHT9JL4Gx3PwN2CnEqDd138efedtxeZqBmV/eBndbSx6pNzXK5TDoSm2Rf?= =?us-ascii?Q?wkIvcJS/+5hhMBEK4y/VNjBAuuHD0z2i4jsmk4MSpzpfwmxVr/MQxIInqEyy?= =?us-ascii?Q?72ZmqlA8bjglHi6FiPtm1zPKcyBM47Kf4hYNpQD4?= 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: 99eaa5a7-eb78-4589-dcdc-08dafadb6335 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2023 11:42:19.5134 (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: hhOgZL9zP0I/YapAyYf7ULpC5n19wTods05mUvK7D67K1y4Ed5r8wiLtFP6Be+b4m100Hjb8IYAvwCEcY4tuhg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5643 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 January 20, 2023 6:18 PM, Gerd Hoffmann wrote: > On Fri, Jan 20, 2023 at 08:10:45AM +0000, Yao, Jiewen wrote: > > > Can we define FV_HANDOFF_TABLE_POINTERS2 and > FV_HANDOFF_TABLE_POINTERS2 in > MdePkg/Include/IndustryStandard/UefiTcgPlatform.h? > > > > [Jiewen] No. We cannot move to MdePkg. > > TCG defines the field to be variable length. Something like below: > > > > typedef struct { > > UINT8 TableDescriptionSize; > > UINT8 TableDescription[TableDescriptionSize]; > > UINT64 NumberOfTables; > > EFI_CONFIGURATION_TABLE TableEntry[NumberOfTables]; > > } HANDOFF_TABLE_POINTERS2; > > > > typedef struct { > > UINT8 BlobDescriptionSize; > > UINT8 BlobDescription[BlobDescriptionSize]; > > EFI_PHYSICAL_ADDRESS BlobBase; > > UINT64 BlobLength; > > } HANDOFF_TABLE_POINTERS2; > > > > The implementation can choose its own length as they wish. >=20 > Why doesn't follow TDX standard TCG practices here? >=20 As Jiewen mentioned TCG defines the field to be variable length. The implem= entation can choose its own length. Below are some examples. Tcg2Pei defines its FV_HANDOFF_TABLE_POINTERS2. (https://github.com/tianoco= re/edk2/blob/master/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c#L126-L136) SmbiosMeasurementDxe defines its SMBIOS_HANDOFF_TABLE_POINTERS2 (https://gi= thub.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/SmbiosMeasuremen= tDxe/SmbiosMeasurementDxe.c#L113-L123) TcgEventLogRecordLib defines the PLATFORM_FIRMWARE_BLOB2_STRUCT and HANDOFF= _TABLE_POINTERS2_STRUCT. https://github.com/tianocore/edk2/blob/master/Secu= rityPkg/Include/Library/TcgEventLogRecordLib.h#L14-L32 I think TDX follow the same practice above to define its own TDX_HANDOFF_TA= BLE_POINTERS2 and FV_HANDOFF_TABLE_POINTERS2. (FV_HANDOFF_TABLE_POINTERS2 h= appens to be same as the one in Tcg2Pei.) To make the definition more clear= , TDX can define the name as CFV_HANDOFF_TABLE_POINTERS2. @Gerd, Hoffmann what's your thought? Thanks Min