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.99844.1674819052943279781 for ; Fri, 27 Jan 2023 03:30:53 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=FoHMr5tA; 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=1674819052; x=1706355052; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=TjdSIoDOyU+pT8J3WnCcyEE7lnfAjEzEMik5wJkjHB4=; b=FoHMr5tAUgyGbfUv5hi5GV4+FwpbxgnYldV2BvU8ZccQc11QICTpzStU hjO+V6MBpAEeSPxP0BKjP8pvKx0Q9wngCNNnfj6rHp5Lh3w/sJxFUe8a7 zbDTBai7cjovsWLhCBDjW9YaqIJwAUfKHvWnS+jpkF3PkAwzvlooSaz1I DPXzKHK2JGPoiQLF4hQ4R3VqRsFsUZrW4wMx/g4ZDjv22xqW2rDdylI04 Q8Rx7BagUzuXUspdD/5DtltErfxf8VCaifYfsCn5ikYGwRci41kJkexNy 9jrzOP4uaa+uBoGPKXI6EmGLHVx0/NeXG5hnCnWXzSyaqUTZKSwaCTgER g==; X-IronPort-AV: E=McAfee;i="6500,9779,10602"; a="306718215" X-IronPort-AV: E=Sophos;i="5.97,250,1669104000"; d="scan'208";a="306718215" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 03:30:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10602"; a="663241505" X-IronPort-AV: E=Sophos;i="5.97,250,1669104000"; d="scan'208";a="663241505" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga002.jf.intel.com with ESMTP; 27 Jan 2023 03:30:52 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) 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; Fri, 27 Jan 2023 03:30:51 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) 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; Fri, 27 Jan 2023 03:30:50 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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; Fri, 27 Jan 2023 03:30:50 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Fri, 27 Jan 2023 03:30:50 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hVTvscfj1Lyw7MF+BjbK5tnHuOrHfnkZ0smQGyKKHhlnRCCTn/RQxR5IrFZobXzZsQySSM8XtvGM7Ax/SSpTqyxMjj8LWeAuTbKdruUQKaGUteDbOc/nuNG/a3FFcefH4LBqLFcAzNsmLYGIbt0WSYLIN90IRKG+Yc0ARM7iuooZG1r7DJ5Nh+OFo0RUvCNKqdCkHaoLlRQ9CgcWIRL0SHKAAalbBwB9/uiGGjj+Otu3S4HonCIvwpotPC9CpE5D5Xlh0JdWjJfTQwDhukY/Se8pSlffBWUhpMQo3xBzLz0DV5fx7pviFzlKWGVX1P9kIS8Xl31EFCf/VH6ygA5Ucg== 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=TjdSIoDOyU+pT8J3WnCcyEE7lnfAjEzEMik5wJkjHB4=; b=keSDqp2cbFnQDWpstO0Y8e5K8IFptjfdhfWuhu4Cdkxfepn5PXg3byWwFxSvAUEzhLPuU5NS1Ej5MT9aiKphG2RqTvRVxCfFJuEXXPxN9SyNiq5o2MCiicEvvPEF/TRNoY5vB698kkbA6HKGpAhPRx1oG0833AyL/NsnwrUPPnXRoZ0eqJipJi8VJMwWRjSLRLGX17nea33HE+hhLsOdANDn0Xnh2CFKDjC9597IKnn3AQ4SgFxqxZloUNgHWB/DxBzF7A4G0MOvLvvNVypvCFAvaCRuWElHa6Ylrf30cf0YIwRxXlNgGVpMzhJ9pyUY1LHoUiw59nlEVeY9gD/dNQ== 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 CY8PR11MB7036.namprd11.prod.outlook.com (2603:10b6:930:50::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22; Fri, 27 Jan 2023 11:30:46 +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.025; Fri, 27 Jan 2023 11:30:46 +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/EUWlm8s9yFHUk66x5VaAgAAxX3A= Date: Fri, 27 Jan 2023 11:30:46 +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_|CY8PR11MB7036:EE_ x-ms-office365-filtering-correlation-id: 7a424b3b-e92e-457f-1e2f-08db0059ef0b 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: Up+DgjA6eEItYPtUWBYvEFNyVbqqhYOYTLnwR+RxDqDP20u4km6LNaumvk0qakD4qZBW1TNTeq1xLKSC6jP60phedohtLAnfyQ7dJ2Z9o/dz6+RvyM32shFEUXMN4OqXvVgXv/2yBo8ELOk4YjAk61LcX2/C+Go/Pc5LyQhKdMV/fX/ZgF/OpzP3orr5FubhsyNZmyn5q6Kjyi2YZ/taeEd7bsT134RuB++DaX3TJ6dQqgeop7thr4HEo8u8ZfYiZ2+sFWRQ8oQlj4L2yQPqpWPXUEA1tVqYh3P4MqEcJBMGvjBgMftMuIGYFA10TTkNQg9AB5c8HMBHNS0d6gC9CAhfXrW35OaFFsdVeY7SS6ScaJXfOjUWLSo1GXrrvFQ8hTlnWiqpmKDlKfmT3uPD2+zLYGGzUQkNNHn6Gtn6t52eAqzRuim+fcfNY4AT2SSsmgtpvgY3/YucLyI7OWTlbAY5Wb3JHTb3aq5VM/3nzbV2Tn6WSjNMQ/D85B0K7fP6e/aGQA7yi4ll80upJSThLeDCAORwPSHf+skAmcNZYy645DQnu0YjT5FI7knmMoMVXxWaQJsUIrlePnePwbVMQXOhgaBdj4nzn/Hn1gjVl1E97I4pYX8nAjzgY+u8dSMmlw2uam2YLSXUL5Yu50FHhI0oB5c5xNoDON2M4AlfgcNGjY2nk+nJiD16tn+kJbOiiYbUBzvEdtxVgxTDgwhc5AwgLqRv69rLGj/D4hT5WzY= 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)(136003)(376002)(39860400002)(346002)(366004)(451199018)(71200400001)(55016003)(6506007)(9686003)(966005)(316002)(26005)(186003)(8676002)(478600001)(82960400001)(4326008)(7696005)(66946007)(54906003)(76116006)(86362001)(122000001)(38070700005)(38100700002)(66556008)(2906002)(5660300002)(52536014)(6916009)(8936002)(33656002)(66446008)(66476007)(41300700001)(64756008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?XTfVCeTFUk111u3YuaRbu3kPUmEOS0HoB4BxXZM9xZo46M5Ztd8ITZRwTwTb?= =?us-ascii?Q?5ZzX45Gv1e1cON1DaJGp4pD3xVozpjcTV1n+M0+XePUU1UH0KLxiTEl7wb8F?= =?us-ascii?Q?F36jJP5hkJ+fZLGGpfWax5Rgw9Vd+IYSCtRpUw1rurj70pLyc70+6Wyc6Rqo?= =?us-ascii?Q?y9xA28ISg21YSNvkjQNxGGNwff5mkT0hFsZiTZgIbvZYbiWQtpcHIPh7sQDV?= =?us-ascii?Q?v6THafKjvvPjudcVny5lHE3JKE3aK71xUS+k9iTNb+pLlbfDGHcjX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pe/Gv+GysQ3WgB37exbCjMsbvBH7o+z/LyO6rlq?= =?us-ascii?Q?yyrYtNYgfRlMWeiXVWz0HCoAaBCYxcYdh52NKQXWNacN0F+FrDWJMUIAnreU?= =?us-ascii?Q?dj3dSBlAtJpSkFCJvzDfEa8Qv3hPu6M8GNuo5wP1vQpGPwbr+rIGabmUYt9o?= =?us-ascii?Q?XOGXpIe7VQI2uoDzyujdv2n4A0tnDB+s+UpdttgjmGeoseAY439Ass87PNez?= =?us-ascii?Q?E2jgc/8a87p+wA0X9NhrSK5Hzkh17zL3M7n+fmku9gET3FsYegmbqsES51oa?= =?us-ascii?Q?nkfb5ERkEkiIdO2go9buUE272zeXxxtI2n4Bjf1S0nJ+YWhUW7Ta1Tpg11uC?= =?us-ascii?Q?08faG3VHTvnIGkqSTy2e3HSGUlxlaj3THJ1+ubA6FeKU8AoyWareLCX6eTdM?= =?us-ascii?Q?GvYnMBpj5TrwnqVo1l6mZsrJasK54hFlrJWkNess?= 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: 7a424b3b-e92e-457f-1e2f-08db0059ef0b X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jan 2023 11:30:46.5004 (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: 6oXJl1dOfqxJRPDdd0WtYssy3XkYdkXESD6cbdIHwslx0YeRwCqAGVRyPBZYm/th0EExB0Vh4SkY2wS04CefoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7036 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 > > > What is the reason to create a new TdxHelperLib btw.? > Are there any problems with the code being in PlatformInitLib? >=20 When tdx-measurement is being enabled in OvmfPkgX64, we find below function= s are needed. - ProcessTdHob - MeasureTdHob - MeasureCfvImage - BuildGuidHobForTdxMeasurement The first one was implemented in PlatformInitLib. The others were implement= ed in PeilessStartupLib. These 4 functions should be implemented in one lib= so that they could be called in both OvmfPkgX64 and IntelTdxX64. So there are below 2 options 1) Implement all these 4 functions in PlatformInitLib 2) Implement all these 4 functions in a new TdxHelperLib We choose option-2 (a new TdxHelperLib). 1. TdxHelperLib contains all the tdx specific helper functions as the lib n= ame indicates. 2. We can avoid PlatformInitLib getting bigger and bigger by adding more an= d more functions. (these functions can be implemented in a separate lib) 3. Furthermore, PlatformTdxPublishRamRegions in PlatformInitLib can be move= d to TdxHelperLib as well (we will submit a separate patch-set later). So t= hat we can have a general-purpose PlatformInitLib. Based on above consideration, we create a new TdxHelperLib. Thanks Min