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.web10.10472.1674029089699898833 for ; Wed, 18 Jan 2023 00:04:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KlOMlQaC; 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=1674029088; 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=OlnOjGuArtlYXUVMAJjz/VTE2+L7/SKfAQY16JP0mOc=; b=KlOMlQaChg+8QRsUeb3RnZkmIWZ1HpYJvFxxhJ75kD/DD8ODnOpu18fPLuQWs6QIJftv4Q rnya9ld/lwjWeYUroAvPB8kD75eC6eAaY3if8wl9aKxNpvGqDqInD6vkUymzBOMFe8R+UX UUBf+0HkDLbgX220CZHbYtn3Cm0+CGQ= 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-630-9Oi1fMqLMKymovmxVyTCEw-1; Wed, 18 Jan 2023 03:04:45 -0500 X-MC-Unique: 9Oi1fMqLMKymovmxVyTCEw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B2E042804829; Wed, 18 Jan 2023 08:04:44 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.186]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7AF0240C6EC4; Wed, 18 Jan 2023 08:04:44 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1A8AC1800091; Wed, 18 Jan 2023 09:04:43 +0100 (CET) Date: Wed, 18 Jan 2023 09:04:43 +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: [edk2-devel] [PATCH V1 1/7] OvmfPkg: Add Tdx measurement data structure in WorkArea Message-ID: <20230118080443.i2h6lgwzgthr54aj@sirius.home.kraxel.org> References: <20230117074016.1056-1-min.m.xu@intel.com> <20230117074016.1056-2-min.m.xu@intel.com> <20230117112554.opz5cc7edq26raty@sirius.home.kraxel.org> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jan 18, 2023 at 01:41:15AM +0000, Xu, Min M wrote: > On January 17, 2023 7:26 PM, Gerd Hoffmann wrote: > > So the measurement is done early and the hashes are stored to create the > > event log entries later, correct? > Yes. > > > > Why both TdHob and CFV are handled this way? It should be needed for > > TdHob only, right? The work area has a fixed size, IMHO we should not store > > data there unless we absolutely have to, and for CFV I don't see the > > justification. > In our first design CFV was measured and extended in PEI phase. Because CFV is consumed in PlatformInitEmuVariableNvStore. > But then we find a problem. That we must either refactor the HashLibBaseCryptoRouterPei or introduce a new HashLib in PEI phase. > 1) If HashLibBaseCryptoRouterPei is to be refactored to support tdx-measurement, then it must detect the tdx-guest in run-time so that it can determine to call Tpm2PcrExtend or call TdxExtendRtmr. > 2) If we import a new HashLib in PEI phase, we are facing another problem, that we have to load either the new HashLib or HashLibBaseCryptoRouterPei in run-time. So, in short, we don't have support for TDX measurements in PEI, so you are doing it in SEC instead. Can you note that in the commit message? thanks, Gerd