From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.100184.1674820187603465270 for ; Fri, 27 Jan 2023 03:49:47 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YH74g2qX; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674820186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bO1Y/ChVGIdpAQ2bq3oF788PFVM6YztN7KS33LgVrAU=; b=YH74g2qXMlaZYF418jgSg6m/0tYsON55LrwSbLFpbOhx/9sldI1yl8HQKVraYfh6G01aqJ 9gFNFuzMb4EVjPoeDTocqT/J8njPoXB5IydcxZGRaqjgUAaMvFp8fgFp/4ZV5vM3svi0FM UQVawVmMvVl/8d1gro/qD/wGrZ0mR98= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-84-NnPXqZt1O2CMwofwwjYbOQ-1; Fri, 27 Jan 2023 06:49:43 -0500 X-MC-Unique: NnPXqZt1O2CMwofwwjYbOQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 23C293C0DDBC; Fri, 27 Jan 2023 11:49:43 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB6E72166B26; Fri, 27 Jan 2023 11:49:42 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 60E8F1800606; Fri, 27 Jan 2023 12:49:41 +0100 (CET) Date: Fri, 27 Jan 2023 12:49:41 +0100 From: "Gerd Hoffmann" To: "Xu, Min M" 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 Message-ID: <20230127114941.qcgsajqw5a7ujbji@sirius.home.kraxel.org> References: <20230127001106.2038-1-min.m.xu@intel.com> <20230127001106.2038-7-min.m.xu@intel.com> <20230127075419.72x2sbvn2fcau3jw@sirius.home.kraxel.org> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jan 27, 2023 at 11:30:46AM +0000, Xu, Min M wrote: > 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=4243 > > > > > What is the reason to create a new TdxHelperLib btw.? > > Are there any problems with the code being in PlatformInitLib? > > > When tdx-measurement is being enabled in OvmfPkgX64, we find below functions are needed. > - ProcessTdHob > - MeasureTdHob > - MeasureCfvImage > - BuildGuidHobForTdxMeasurement > > The first one was implemented in PlatformInitLib. The others were implemented 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 name indicates. > 2. We can avoid PlatformInitLib getting bigger and bigger by adding more and more functions. (these functions can be implemented in a separate lib) > 3. Furthermore, PlatformTdxPublishRamRegions in PlatformInitLib can be moved to TdxHelperLib as well (we will submit a separate patch-set later). So that we can have a general-purpose PlatformInitLib. > > Based on above consideration, we create a new TdxHelperLib. Ok, makes sense to me. thanks, Gerd