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.129.124]) by mx.groups.io with SMTP id smtpd.web10.39291.1656319297057739241 for ; Mon, 27 Jun 2022 01:41:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TwL74G0F; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656319296; 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=Bl2gN0tKzS1+QIa/oolWe7ACDFjceZ2uGWj3O2e3alo=; b=TwL74G0FnuwQxfAYzuwFwZaWGqni8DggSOkbvND0/LcBR4aJc10HRVbvFEIn9yaaqG+6oF jqN0jHdKgVM+tjTO6YYxYo+u7yBW1eU9hAvfTJ7nOUDN29FRUtI9HOXesyYw5eLveavwXL FWZlk+KAo66UJTk9shvRZOf9acmkUGg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-3-251IK6WbOKG4i8dBkVzVXg-1; Mon, 27 Jun 2022 04:41:34 -0400 X-MC-Unique: 251IK6WbOKG4i8dBkVzVXg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CE9A785A582; Mon, 27 Jun 2022 08:41:33 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 876E441637B; Mon, 27 Jun 2022 08:41:33 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AF77F18003BA; Mon, 27 Jun 2022 10:41:29 +0200 (CEST) Date: Mon, 27 Jun 2022 10:41:29 +0200 From: "Gerd Hoffmann" To: devel@edk2.groups.io, min.m.xu@intel.com Cc: "Aktas, Erdem" , James Bottomley , "Yao, Jiewen" , Tom Lendacky Subject: Re: [edk2-devel] [PATCH V2 1/8] OvmfPkg: Move TdxValidateCfv from PeilessStartupLib to PlatformInitLib Message-ID: <20220627084129.ijjbdbblh7xwpu6n@sirius.home.kraxel.org> References: <20220627070216.z65kzpjzy5tvybsu@sirius.home.kraxel.org> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jun 27, 2022 at 08:04:06AM +0000, Min Xu wrote: > On June 27, 2022 3:02 PM, Gerd Hoffmann wrote: > > On Sun, Jun 26, 2022 at 11:05:50AM +0800, Min Xu wrote: > > > From: Min M Xu > > > > > > TdxValidateCfv validates the integrity of Configuration FV (CFV). It > > > was implemented in PeilessStartupLib which is included in IntelTdxX64. > > > > > --- a/OvmfPkg/Library/PlatformInitLib/IntelTdx.c > > > +++ b/OvmfPkg/Library/PlatformInitLib/IntelTdx.c > > > > > +/** > > > + Check the integrity of CFV data. > > > + > > > + @param[in] TdxCfvBase - A pointer to CFV header @param[in] > > > + TdxCfvSize - CFV data size > > > + > > > + @retval TRUE - The CFV data is valid. > > > + @retval FALSE - The CFV data is invalid. > > > + > > > +**/ > > > +BOOLEAN > > > +EFIAPI > > > +TdxValidateCfv ( > > > + IN UINT8 *TdxCfvBase, > > > + IN UINT32 TdxCfvSize > > > + ) > > > > Hmm, is there anything tdx-specific in this function? > > Looks like generic verification of varstore structure to me. > > > There is no tdx-specific in this function. I will rename it to something more generic. Also move out of IntelTdx.c please. Does it make sense to call it right before calling PlatformInitEmuVariableNvStore()? take care, Gerd