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.web10.68474.1674716999613681834 for ; Wed, 25 Jan 2023 23:09:59 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=kXkFjsk/; spf=pass (domain: intel.com, ip: 192.55.52.115, 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=1674716999; x=1706252999; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=TjDETq4tAKPiqghl1ow3W76FW3p+8Xgkz2WJiRJj7wo=; b=kXkFjsk/FYcwWkuzdBrSaaGihrrI4qa2Ip3t0LUlWIcrmK+t3OfR03FX 15yHsYn/ZLqwKW+cKiah5wFVWk19CztxVpt5LbXTKLSXIPesLVZEpoHse ZAZHPisPZCKlpNc++xqOePtXBNuSYYuoA8a53cSkFJlU85XghWBgmLpKD Owwq8+lt7SFfhWd5ySS34hXUgcGBhg2YPiPIizQE/SgZJcndQ9kqJPuXS y3/UGMAWbm8osWkMDR+4DHIOpIEDMwCOy611Nlg9ZhzhcRDpYyxsvs5gD CLTzm+FKQN8deuWoTFxNQsMjqvXGcfOsrQl0Ra/ZNidnTLbeyVn6hFsTU Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10601"; a="326785993" X-IronPort-AV: E=Sophos;i="5.97,247,1669104000"; d="scan'208";a="326785993" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2023 23:09:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10601"; a="991528622" X-IronPort-AV: E=Sophos;i="5.97,247,1669104000"; d="scan'208";a="991528622" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga005.fm.intel.com with ESMTP; 25 Jan 2023 23:09:59 -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; Wed, 25 Jan 2023 23:09:58 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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; Wed, 25 Jan 2023 23:09:58 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.176) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Wed, 25 Jan 2023 23:09:58 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H4+azyQAY8XTXUSosTKFwGfJppV1pRy6Y3UErYxLHahY0segm3QPUWUE3M2cPqx5qlBUzrvGUhb8a761T9HyzRYJXKXtwzh5PSQSdJfdV/0oB1yOj1HCxYNjBM5gAQzXk7gi4P64TmuKo1OmB+j/6lKNC6lVKVXFlQDsoDLL4fYhfsS+uIc1NYvfUDNCEw16jpUy3ARAwDQiDZCA+PoQ3/keMB5yEcKbaL67l01+UYBqusUC6Hs5KwV547STXy2q55GYp69fCN6syEhYMkn19nOpZ3A2m2ljIyvHZLdzs3ft8CXZrFL15l8yZj6Efl4ojSzZucFR8/3XPosjAht7mg== 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=BWI0fNooSIuHOe0v6sGYPbVopmSCI3yjrHYj/O8ci9A=; b=DwYLGNJ6LFis3zitZgJs8brcIBteLyDc71tBIqYyj/UySfQL6vLvC3IBwpgbdd+SYaQVI4jbB04xathiR6rMSzDLMYLWw98YeDToaCLkJWMtcto4qFmvJUYIcENLZeaMjnB49OMOvNo99EDbcCRdAL8vUH7ax6ZhZEUawKQNxnSVnr/5PUFIRisBiCXHI9Lk4gmROoOK0b7AKt+3XD+ONpIsNZePfx13XVMLnE6LLP5BPu0OuIs5buzjzW6+KBGucLKYGs8Gv2XT8YHxuQJlSYPD12L2RQvylp+Cwa8Z3iBfiLrsXj7PubMrtgfBR7ZzGsyHuLOHP0Y+Sdoq8qVYZQ== 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 SA0PR11MB4542.namprd11.prod.outlook.com (2603:10b6:806:9f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.21; Thu, 26 Jan 2023 07:09:55 +0000 Received: from PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::d87:9f99:2db2:43d1]) by PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::d87:9f99:2db2:43d1%8]) with mapi id 15.20.6043.022; Thu, 26 Jan 2023 07:09:55 +0000 From: "Min Xu" To: Gerd Hoffmann CC: "devel@edk2.groups.io" , "Aktas, Erdem" , James Bottomley , "Yao, Jiewen" , Tom Lendacky , Michael Roth Subject: Re: [PATCH V3 5/9] OvmfPkg/TdxHelperLib: Implement TdxHelperBuildGuidHobForTdxMeasurement Thread-Topic: [PATCH V3 5/9] OvmfPkg/TdxHelperLib: Implement TdxHelperBuildGuidHobForTdxMeasurement Thread-Index: AQHZMGQ9iootqGkOR0SoQpxNl7Osza6vDpKAgAE1bSA= Date: Thu, 26 Jan 2023 07:09:55 +0000 Message-ID: References: <20230125022359.1645-1-min.m.xu@intel.com> <20230125022359.1645-6-min.m.xu@intel.com> <20230125122223.xsc2kwwpcajn53bi@sirius.home.kraxel.org> In-Reply-To: <20230125122223.xsc2kwwpcajn53bi@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_|SA0PR11MB4542:EE_ x-ms-office365-filtering-correlation-id: 12d67082-6b37-480f-8bd4-08daff6c53b4 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: 6EZ0UtqmsBnZOStoicYcNH9LwXpukAfbE+snw9C34KK1niwkOCW1D9TQ6FMoYM0aEzGNyzZKDfRKYyTZTPk1AeN1eRVBNCNtSZGcyTiPlQdqheQphxR6SbuR8YL9/esQB63mxsN+SslHhjdJeWU5SuRUoPo/TVWup32WQ0G1/4VXhTENCAuEkVRZdVHUg41Zv9ECfl97bPcEAsD4Mc16+9W0kUJuUxs3Takh/UA3yu9joP36Bch601D1Lojd+U6kWYo4Z4GkgwOVMsaqRf7Fobzkl1T35Wtgx/ma1SeCJ4KF9glmGbuPS9IQX/JmRxTjkvSngxhvRxFpcN3wE27D3UXL83ndzgM7T/QsO/tNYS8I0z+xkX49sxX3fiI61CFtk0qwJ86U6mIKdk0LHTnD3SaNe04hWuljOvdHeyIrtzU8SZ2lVRftzGwMo3uSfg3U1c0ZlF4DtjJpGCd3g10nVthJygxxPw6xpIyEjwa2A0UyTKz0OuGZTccfOuXD5cg71zotaUcbutng8vW6FXKPnloQ/r3lSwzqDJmbjhlAFVuEnziULNIFB2j5Ii+yIz65+lJMudbIcD0Imj7Eo+VGtCIeSYEEe8letZhzvUDZMewlD2hjgb5u1VXUYTPx7m9tY7Nimu+IWyBv/azTMSqmF0/KFVUtKNlMam72yScqmKjs4b7ojvRkFH6xgBQTBvoH/AGieAOP4LPBqDcZD+GoQdn1lm8qEZd874X8J+HKGXA= 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:(13230025)(396003)(366004)(346002)(136003)(376002)(39860400002)(451199018)(7696005)(71200400001)(86362001)(186003)(9686003)(478600001)(26005)(316002)(33656002)(54906003)(76116006)(64756008)(66476007)(55016003)(66446008)(38070700005)(66946007)(66556008)(4326008)(8676002)(6916009)(38100700002)(41300700001)(52536014)(8936002)(83380400001)(6506007)(5660300002)(82960400001)(122000001)(2906002)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?6sCHja+Dr7sBNCSkh9py43VfR4omcVFug18R/YWkQcXIVqXOtKm5dCUD0rVI?= =?us-ascii?Q?q7G8Ndpx+yHwSJRugjnhi8zuzGc3cXNoPi8tQIACqNlr7n43QeT5GWlGx+56?= =?us-ascii?Q?LeUMfolWsX6rDDirnY8NzkEhLM5IFAkG1y/TtMX7flsDw4C7aZ9aTf909Yyj?= =?us-ascii?Q?oMuLl84imhAEsEWynRhPXG0mt5jHXez/tWULPyc2+miw0/8gRD3l4SrvGA58?= =?us-ascii?Q?Yo97teA7QRlkPpx1qHWcvu1pf8vjpmshFLOzPTHrbitouLd5ysvjTc6SKoMh?= =?us-ascii?Q?QGGmMWv4/rsz5sIUYC4Ary/CD5MBKNMXWAyLK5bz4moXaIovxve2t860QAev?= =?us-ascii?Q?F0MrEjzYQidiFJ8CiaTF81u/lHPs5roTgU+NO8i/OttfgQdBEM4JNnYVP1RL?= =?us-ascii?Q?ftdY59y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aTyMh2FKzHbBMOOOwZ?= =?us-ascii?Q?dpjxNykU054nNpa3eWF5WzvAjemBAa2xJxjlvFciLXZgS/e+JuEinfSwjYt8?= =?us-ascii?Q?aLLWok/iOt1OGMrEL26S5ye4uOv0uBBSwERoK3XW/Fc1uvzLmCGRPQVSo+b+?= =?us-ascii?Q?dc6O+COTCltd/25GTC9z/KxWBs/R7pmfFHDKX7wFwNQJhMPTkcGavXCjuc2a?= =?us-ascii?Q?XT9wy/baoLV0ODDdLSBJi+EEYpl9FrXTlyHKwdeu4R+980kV3Po2dsMCPMcu?= =?us-ascii?Q?dwenTzoMYtnUYpVf3QkG6qlRVWjRIZZIhlODYSEE?= 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: 12d67082-6b37-480f-8bd4-08daff6c53b4 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jan 2023 07:09:55.1769 (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: fJmht8ft2NdWMhNoOsNCeSK8XQXv84r5FnakW7nuqeYo0vdSQGlZmgMW1K0KYRN1Z3KwfJ+FMsRgclmdiof+Zw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4542 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 25, 2023 8:22 PM, Gerd Hoffmann wrote: > > +#define FV_HANDOFF_TABLE_DESC "Fv(XXXXXXXX-XXXX-XXXX-XXXX- > XXXXXXXXXXXX)" > > +typedef PLATFORM_FIRMWARE_BLOB2_STRUCT > CFV_HANDOFF_TABLE_POINTERS2; >=20 > > -#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; >=20 > That update makes sense, but can you please split this (and possibly > other) code changes to a separate patch so this patch does nothing but > moving code and the absolute necessary changes needed to make it work > (update library references, function renames). >=20 Some of the data struct and functions in TdxMeasurementHob.c are moved from= PeilessStartupLib/IntelTdx.c - TDX_HANDOFF_TABLE_POINTERS2 - CFV_HANDOFF_TABLE_POINTERS2 - GetFvName BuildTdxMeasurementGuidHob is partially copied from TpmMeasureAndLogData@Se= cTpmMeasurementLibTdx.c. InternalBuildGuidHobForTdxMeasurement is newly added. That is because in the previous PeilessStartupLib/IntelTdx.c the measuremen= t uses the TpmMeasureAndLogData which is exported by SecTpmMeasurementLibTd= x.c. It does not only measurement/extending, but also builds GuidHob of the= measurement. Now in this patch-set, the measurement/extending and the building of GuidHo= b are split. Firstly HobList and CFV image are measured and extended (at the same time t= he measurement values are stored in WorkArea because at that time the Hob s= ervice is not ready). Then after hob service is ready, GuidHob of the measurements are built. So it's hard to separate the patch into the one that does nothing but movin= g code. I would put below change in a sperate patch. +#define FV_HANDOFF_TABLE_DESC "Fv(XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)" +typedef PLATFORM_FIRMWARE_BLOB2_STRUCT CFV_HANDOFF_TABLE_POINTERS2; Then keep the other changes in another patch. What's your thought? Thanks Min