From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.11779.1674906906540183104 for ; Sat, 28 Jan 2023 03:55:06 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=BkNrJGk2; spf=pass (domain: intel.com, ip: 192.55.52.120, 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=1674906906; x=1706442906; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=cmBiD2/cE3tAr1MKxjBhrEptMC1hd7h3oQeKUR5KbyU=; b=BkNrJGk2XXo8JrC666HGazhBVgWMfiXGQNmuf65Fn+A3tC9+hiyScftn qJfI1rHJT+hE244+fogG03SUOmbVWtKrtCo8hKMCyUp223gkLgiHrG/gp TS+6HS+uiM/jmR3djEW9wN8jiHCb9mp7VtavZ0uTZMB2Xz5x+Qm3qRJTB +q1X6yJR0h0Hr5wOBKU7ahWSF9hsuY0TwM75mP8Gt4csfI8IuNauXLwND WTUonMJCndUQNIS/iJDQFcFW+eeKmQnMzMO35K/9t3UXVHw7gikm8yNjn FWPht3AC+ZO1OO2SpDRqPVHsEAkw+LRAw4xsdsM7P4XUB5EbAZUnSSd3b w==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="325956200" X-IronPort-AV: E=Sophos;i="5.97,254,1669104000"; d="scan'208";a="325956200" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2023 03:55:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="732162511" X-IronPort-AV: E=Sophos;i="5.97,254,1669104000"; d="scan'208";a="732162511" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga004.fm.intel.com with ESMTP; 28 Jan 2023 03:55:05 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Sat, 28 Jan 2023 03:55:05 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) 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; Sat, 28 Jan 2023 03:55:04 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Sat, 28 Jan 2023 03:55:04 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) 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.2507.16; Sat, 28 Jan 2023 03:55:04 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FttpIoDKcWlvX2zcuasJRHEhWiIsn8P4PSFonQyY5BszWLaEV/7Uy7FMzhBZIZ1tbh0ASPe6oY71mlLpURamxdRKE7vcYJ5H/+IOOgZP1r8UHLK+DjjsGz1FdTaB1sOlaMO1uLQqrOHY1UcDmxXgcL7fyPysfocLxEFk4tLPIxWmxJAKkFQh01Q5p/tM9wJU0CIqWnyss8ASKeq6DBaAtAcy6Kr0snCRR0DXCjlRc4ba/vtFpJxnY86ZEhoYMOWEmhx7xqBPlu9V0stw+PWgqOV+Lf/xCC6PUOaY+L/CHvqmw0AZMcPo5ZPQbsFflCie8lriY/CvCHFhD+CTlCLuFw== 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=m+wO/JKw3Y/i/1SKZvH899pmq78XeFd20e0h3J5Q4dw=; b=Pq7UI7g7zoeCL+ZGOcqPBgppVU+aK3UhOE6ZmIxuoMaYtNsuBYeeXINO55lJ6LKduNiO/2s6inZWvod3hkbg3UpWoQWtH0u1+gcpIfjK/U2RBLrKbMYXhyj+/Bf9BVbo3muCx2c5eCe4XcVFqbhs63AdWSY8w8XBrAo6R7oXnAtcuXhlmBIzOQVr711WLt1hDsXYUX/XyOldtsvM78JXSMD/3pPt1OTPasvd8HUVjPGMqBRx3vBCb37TjAu32O6A7/cStFz9HG/WrDCsIXdl8Cb0tI6M5uvqNhfvcK9wn3yVDiAWXcovH9b389UwWhPZS/+wTDuFS7JTMWrnxTjTRg== 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 SA2PR11MB5052.namprd11.prod.outlook.com (2603:10b6:806:fa::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.28; Sat, 28 Jan 2023 11:55:01 +0000 Received: from PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::d87:9f99:2db2:43d1]) by PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::d87:9f99:2db2:43d1%7]) with mapi id 15.20.6043.030; Sat, 28 Jan 2023 11:55:01 +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 V4 06/12] OvmfPkg/PeilessStartupLib: Build GuidHob for Tdx measurement Thread-Topic: [PATCH V4 06/12] OvmfPkg/PeilessStartupLib: Build GuidHob for Tdx measurement Thread-Index: AQHZMeP2Son5LEw/EUWlm8s9yFHUk66x5VaAgAF2M+A= Date: Sat, 28 Jan 2023 11:55:00 +0000 Message-ID: References: <20230127001106.2038-1-min.m.xu@intel.com> <20230127001106.2038-7-min.m.xu@intel.com> <20230127075419.72x2sbvn2fcau3jw@sirius.home.kraxel.org> In-Reply-To: <20230127075419.72x2sbvn2fcau3jw@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_|SA2PR11MB5052:EE_ x-ms-office365-filtering-correlation-id: af3df5e0-f6d3-40c8-2d89-08db01267c35 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: AmhvyXxNmNrCwpMnK0f1o5y4icE2WMWrai7O8ppUGPToWLIiA8WQciQu9yUCxD9NdVgpw9sfVNaq8XTgx51NH1USrhf1e47QsAYhPf0D8S8WBF18FSbgZjr/OsvGadml5ZwOUZ6leqpeBuLgPyuoDAsevG9M0X4BQDp3GcFqfu/QUl69hmwvlBH3q6F1oaMP1uBLwhjlB1CQERpiqcBoAGhRpjSfGUt2I7jj8++s4Hcz3qxImYeLT72IPTXQEg/T4NeFy73wvxAX+7BFgEKMFlssUuTrulwGT4qDw96E1F1qptSRXx9MsNciGLS1hy4HvnmIiROCPpVNRb2YYHkZ3oh8epTTP8S8UP1vxhpLytZFW9GgvJ7e3iSuQ1mBWc6Soy3w/jKsY9D0GkNPqzPPVvsnRWgPmWeebvF/vv5ThGVFKeeZ//k47fgj/tiZNWL3CWJau972lmcOCwc3cNuNuHPvu+V4qhUSD9B2ope3bLUhCnb0zS1VRxWFp/lgR/XW6Vm/Y2QrJLkHDJcCSQR2etYh/zrop6FOnPrmMKoC5BYsJoDyP+J54bcVe3XgE06d95pg1EuQHi7Bxj47hjiPnEby/45xZX8CHZa0DzFThMIIlQgZw0NMdVK8MAb83hInti0tThz+/oSxA3GzqPQAAK/K0rZBRIroov2iF3SYZKfqwb7pNLX15catBsjQ7O2Mhy/8gjxfGLZPxk8hUKQ5N4O31lA0G3V6OyxU91g39OI= 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)(376002)(346002)(136003)(39860400002)(451199018)(9686003)(186003)(82960400001)(38070700005)(6506007)(38100700002)(33656002)(478600001)(86362001)(122000001)(966005)(2906002)(5660300002)(7696005)(41300700001)(8936002)(52536014)(71200400001)(6916009)(8676002)(4326008)(66946007)(66476007)(76116006)(64756008)(66446008)(66556008)(55016003)(316002)(54906003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?QqzxR8xn8I3vljrOqKFV1W/bs244o8fF03ommLRx0lovV4z3QtvM4HWONDM9?= =?us-ascii?Q?uaV4musn1t1Dv0xKiJ7B1+OuXHa5M/FOUMdapfLxtOIoFNU+TnjDd8AX1tFO?= =?us-ascii?Q?JadMGaCrwvXP262tAQ0fFbY5ybZay5r7Cp7M5y1QZl0TqJ6fZCP550LJlxaz?= =?us-ascii?Q?O5k71lDN055J/DvfwkJQDt7t5mrZQH+FeGBf+AtqZb4Vx4TQgED8XwF+E6rj?= =?us-ascii?Q?qEgTA00pvPxR2X2MIqv8GQzjujLmFWA6Mh1wOYLVISXWQ1WcDgvGiW95kOoq?= =?us-ascii?Q?/ELyIq+i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CXkLyuiEhCfTrmfvQAe?= =?us-ascii?Q?e+xF+lyxM9ovn0SyFjMGO9dZQnJoMw2WTz86bkznHmFvl4XIkCANYpC+VxDD?= =?us-ascii?Q?EVNqXiXGWjQ1JUF3O4GIIqhWHpQwTxNMm66bJfIOxsWh3nuCuT1ygaRVOO01?= =?us-ascii?Q?0GzZ4jBsORE04bY9r93pBGDaDoHULS++ZPAnDUT4doIPIn3HrZF4Up02jVgF?= =?us-ascii?Q?EJaCHIns2KeyWgr76S5HHtlrO2jduB+wEii8WiDLdHnxB0xf7E2r6hs2Lxdj?= =?us-ascii?Q?qGbqulV0/T0ZSFmxPdlOazUtK2mD9a43w/a4B9KZXR5sPtwPAJTX9/qOoUgq?= =?us-ascii?Q?jRxTWKIn5rl4LSVFOXBmq249mg9GomlykITPePIcQRWA9ez8rJsDhkqaiw?= =?us-ascii?Q?=3D=3D?= 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: af3df5e0-f6d3-40c8-2d89-08db01267c35 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jan 2023 11:55:00.6989 (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: lLcUwcuqOp7UT8qVZOuBKGDI2vxlbxEB6kRXX8JuuM5GaSXH2k8gx6DWq6dRkroh53vhe75pvlVVBAq/Y2qMRg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB5052 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 27, 2023 3:54 PM, Gerd Hoffmann wrote: > On Fri, Jan 27, 2023 at 08:11:00AM +0800, Min Xu wrote: > > From: Min M Xu > > > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4243 > > > > 2 new functions are added in PeilessStartupLib/IntelTdx.c. > > - BuildTdxMeasurementGuidHob > > - InternalBuildGuidHobForTdxMeasurement > > > > These 2 functions build GuidHob for Tdx measurement. >=20 > But you don't use them anywhere? The point of splitting the patches is n= ot > only to simplify review, but also to simplify testing (and in case a bug = shows > up later finding it with bisecting). >=20 > So, current state of the code is: >=20 > There are MeasureHobList() + MeasureFvImage(), doing measurement and > logging in one go, using TpmMeasureAndLogData(). Problem is this doesn't > work in SEC, so you want split. >=20 > So, you add TdxHelperMeasureTdHob (doing the measurement part of > MeasureHobList) and TdxHelperMeasureCfvImage (likewise doing the > measurement part of MeasureFvImage) and logging both is handled by > TdxHelperBuildGuidHobForTdxMeasurement(). >=20 > So I think the series should have: >=20 > (1) One or more patches doing cleanups (like reusing the struct). > (2) A patch removing MeasureHobList and adding TdxHelperMeasureTdHob > with the first half of TdxHelperBuildGuidHobForTdxMeasurement > (3) A patch removing MeasureFvImage and adding > TdxHelperMeasureCfvImage > with the second half of TdxHelperBuildGuidHobForTdxMeasurement > (4) A patch moving the code from PlatformInitLib to TdxHelperLib. > (5) A patch moving the calls to TdxHelperMeasureTdHob and > TdxHelperMeasureCfvImage to SEC. > (6) A patch adding the Tdxhelper* calls to OvmfPkgX64. Thanks for the suggestion. The patches will be re-organized in the next ver= sion. Thanks Min