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.web11.69377.1674200420654732369 for ; Thu, 19 Jan 2023 23:40:20 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=FrUqzTVo; 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=1674200420; x=1705736420; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=HhqAQOB2Mxj28maJXGuSwLeGuxUGBdbmJtEVdlc/ScM=; b=FrUqzTVove1RqTdmUG3sq/fsBDiHvdAU2+jF2/b6yiG9FgVE2Ly5eduA GwkC9y1lU99DPrEfQPFMj2NRdBvULd8WRSFTSQk7stFeRN/SICU+/pEyk v3dkAqI5R2xdVzBzNqkMdmtqAWNUHqfq8hCtid3z1oWNjhClmfRnrM8e+ I1hzN6XRI94fj7pWRq2xlZ1H84PUE6HpqQpRNzSUWzhD4jFHGFBjIelEw SqflchXADtvAJzmeLWZTnpi7lqdzouDQo/X7biOPalMlkOVMxmp5bZ4RD b2M1nSsN+ItwzZaJ3ToYFBvZKVQMhSH2VbaKLgtLskedY8kA49kqUzzJa g==; X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="326803630" X-IronPort-AV: E=Sophos;i="5.97,231,1669104000"; d="scan'208";a="326803630" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2023 23:40:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="690961602" X-IronPort-AV: E=Sophos;i="5.97,231,1669104000"; d="scan'208";a="690961602" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga008.jf.intel.com with ESMTP; 19 Jan 2023 23:40:20 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 19 Jan 2023 23:40:19 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Thu, 19 Jan 2023 23:40:19 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.109) 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.2507.16; Thu, 19 Jan 2023 23:40:19 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wm7Fnat4ampXuFGyDHx7tyUbIgMsco6ipZzvHcZhJP3m3DsXtg7S/1izud+4VCpgingZlmN4l/v+F156SxMAR7XkEzlYVixM1HBUVFanP1indph8IfV+WCyunDWncOvvG73PtjP0y5M4OzPBi3NfRhFB3/w8xbZRiGbWi4XAheW+p4Li5YXpnMcl/UiSD/TiCR4MtiWFe5fHPXp03fITlpJd4tq+YX/iv5MySgenq0moydagtzLY2xeBJcWdaShrv+xLnVQ7ZHN3uPHdo3+drXi9qlvfuYIjBo4ZOealKhF1rbGcdT1JfLV/zIesohWZJvDyycoAgWHci6kZ++Z7gQ== 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=DAukVD+OQGJBLcvGX5U6Vy++b0wlSs4YWYeT+i6ffcw=; b=X2PjFdU74J3tZTW3vLk4t9t+kfIaQ+/LdMaW2yWIdoRxB3XCofpy0BO7KGmdJtdFby2eLA2baDHSVjEsFfmGOzFf1itVCMFJbTdNdsZVqo7wD3xkapkynwGMzykOTFQR4tsafsbvrKWeUw5ifV5Dgugx1RT0n8bf4EA+4Fr3g81adx2crutBub2GBCakCVJNxixa/y/rjsNilvdcSKgUFXWWR6Yvg/WTaz54FrJaSczCw3Gdi2rYylsIfycsWMKFr3Kp7i1tTzHJ6lpLQqyRRM2MnOg3lCQBrDnfqoVEL7+fF1SES2Ld4b5c3o/HBdaPqRLRJedhMuikzstdrBnWdQ== 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 CO6PR11MB5570.namprd11.prod.outlook.com (2603:10b6:303:138::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.24; Fri, 20 Jan 2023 07:40:17 +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 07:40:17 +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: AQHZK7YrgVPaTkexhUe4Crhi5Ela4a6lgJYAgAFqSJA= Date: Fri, 20 Jan 2023 07:40:17 +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> In-Reply-To: <20230119095422.ou5vbckdyn33hh5c@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_|CO6PR11MB5570:EE_ x-ms-office365-filtering-correlation-id: b4c45aed-ed21-41bd-499f-08dafab9937a 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: aN+F0mvaoBf53CkJ2WxNWnWmq5tr/iYJuVLfIUnnk20Yny39vayWeGpfcNBYamh7s3dRqUBJA9zwg070G9iGyjKH+yE+IGX7z6kLUep5wEoOUodGzg0xn4y+YgjaH2rw/IyOhGjhqUjRpcUyhBUIp9M9MYAoJ1vgLL5ZhyB7RMAaxxkLmPq2C43MPHDMX/E6+7SWFBJcDp2yLOVFfJ0BDtUTupm3e41xOw9/kftB0aaU97hpaEkOYufJHdTqzW3TbpZJteAdEsuxIdZ5G5QijeGMg8qyJzPLnuNlTJvhUMgZoCe7CyJpKF7wA+XcJLCcuaQgJWacO/SNxhrs4CcVfCUB8+rF70Ht/bbd14+gO57piGqXvzpMDnGhz93tWj7DlVUURo9wYAvSWt0VxKkyHTSwOy23xp4dhylTmJ5jPlWuCXFOutmvFhEjCc7vHCdX12cRyhSDoKEOHPwo74klpkAezwMSn/SZVO0z0U1NA+ZTgKT2/5/WQBuagLJz+JUWO5cBted7nMW7/5kJZVdDsLC2lb6pwpSxaLrd6Ai+LezOaGBYbrPcRzL+VOA6Yht2ODw9VHmEjFqeL1NL1OgMoo8UBDa4XoBMa9u5c8NClgKHCaddfcoitUZX92p3DR4zf71i14D88r4tZcL0PjwHonh6rGETHRLeW4IvfyeV3Ntaw7uynB0PGlIFYB9xvfJLwj81DY2lKyRlBCMjTd9hFx+uBR96w1F7o65TOC01as8= 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)(396003)(346002)(451199015)(38070700005)(6506007)(86362001)(5660300002)(66946007)(76116006)(55016003)(66476007)(52536014)(2906002)(33656002)(8936002)(82960400001)(38100700002)(66556008)(122000001)(316002)(64756008)(110136005)(54906003)(6636002)(71200400001)(7696005)(4326008)(478600001)(41300700001)(8676002)(66446008)(26005)(186003)(9686003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?IMZIpwRe6+1M9oIB43HGeRlOk+WDdh8RMx68Zzfu1nPr0TIbydcdEDpUqAVQ?= =?us-ascii?Q?dQpC/U5SCBMwyp2is20pa6YMKRiXO/GfOCuCqfDC/RXznNxtP0A0Azj9ZvHg?= =?us-ascii?Q?MYw6qUpsZIp6uGRH9Aadoa+1lePZSISm0u7N8kLJh1A85HUbrV+X/XohkgVi?= =?us-ascii?Q?Jcu3Fl5e5apk7nD0EmnMcuYo/Yl5ZL2+omVeNwtPn7qRTPytlcLOxA0q7leV?= =?us-ascii?Q?0YSOSqiyK31fbxlotHDy073iWrCacFfiOhms/ZyMwqAjkyuIcKTRm/qA2epB?= =?us-ascii?Q?ggWkzwoqkXsy5LvzZvojmA9I4JrwYgQle2TdvZQhWi9g79mEYQleIm+pyWjN?= =?us-ascii?Q?nwLbGFK10I70WofE6m/B93gZswx5DoaqReWJSdnN7QBhuEcGMsRmizbgtaL4?= =?us-ascii?Q?FCPAecIgp9Nb1xIbKHsHXBsSaqQ1A3LIFrqC5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q?Q14zPx4x+lRDpTaOy8WCSy1gk6ZK8x0Bs/mDPTVPs2tQLVHLDn9pZDaCkpaf?= =?us-ascii?Q?+cVemHdILAWOAxrVYF93/WjpuprvZaYq9tj1IScAf7QZgTmc8gnAkS9LXMN9?= =?us-ascii?Q?Uz2VRPtgBfcUn+DmifKI7JIEC4FoujhcaIFuAhF5DbpiDUZBdksLOJKJj1Cl?= =?us-ascii?Q?cYJv8xCvIWB9b8EgvMQ1fxR6IeHbEZvXDjjsbCBWN0HGHUToCNEZMdEuukln?= =?us-ascii?Q?3H7w3bFvVZXeR1BKGolR4xpZKZHWn8RtXYAbMxPV?= 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: b4c45aed-ed21-41bd-499f-08dafab9937a X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2023 07:40:17.6036 (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: dy/fbwtBUmfnQy2JhkZEG0JwM4evstD+3VqSGA80ViDlV8N96vNzyynht5SIv1jcg3/7o7tT0zZOGUqHWsq2GA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR11MB5570 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 19, 2023 5:54 PM, Gerd Hoffmann wrote: >=20 > > +#pragma pack(1) > > + > > +#define HANDOFF_TABLE_DESC "TdxTable" > > +typedef struct { > > + UINT8 TableDescriptionSize; > > + UINT8 TableDescription[sizeof (HANDOFF_TABLE_DE= SC)]; > > + UINT64 NumberOfTables; > > + EFI_CONFIGURATION_TABLE TableEntry[1]; > > +} TDX_HANDOFF_TABLE_POINTERS2; > > + > > +#define FV_HANDOFF_TABLE_DESC "Fv(XXXXXXXX-XXXX-XXXX-XXXX- > XXXXXXXXXXXX)" > > +typedef struct { > > + UINT8 BlobDescriptionSize; > > + UINT8 BlobDescription[sizeof (FV_HANDOFF_TABLE_DES= C)]; > > + EFI_PHYSICAL_ADDRESS BlobBase; > > + UINT64 BlobLength; > > +} FV_HANDOFF_TABLE_POINTERS2; > > + > > +#pragma pack() >=20 > Why do you need this? For standard event types we should have those > structs already defined somewhere in edk2 I think ... >=20 FV_HANDOFF_TABLE_POINTERS2 is related to standard event type (EV_EFI_PLATFO= RM_FIRMWARE_BLOB2). According to comment (https://github.com/tianocore/edk2/blob/master/MdePkg/= Include/IndustryStandard/UefiTcgPlatform.h#L145-L156) we can see this event= type uses the structure of UEFI_PLATFORM_FIRMWARE_BLOB2. It is not a data = struct with fixed size. Instead its size depends on BlobDescriptionSize.=20 Tcg2Pei measures the FV image with the event type (EV_EFI_PLATFORM_FIRMWARE= _BLOB2) and data struct (FV_HANDOFF_TABLE_POINTERS2).=20 Tdx measurement does the same measurement to the Configuration FV image.=20 @Yao, Jiewen Can we define FV_HANDOFF_TABLE_POINTERS2 and FV_HANDOFF_TABLE_= POINTERS2 in MdePkg/Include/IndustryStandard/UefiTcgPlatform.h? Thanks Min