From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.6157.1632478052701747016 for ; Fri, 24 Sep 2021 03:07:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NIDSd5Ra; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632478051; 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=Lb9NyJlPKXx/9KwZ6Pr6qSeSPixJm2MXhRoiG4B/Ze0=; b=NIDSd5RaeQ+NpsdbXa1ZxgI3YLvJCQzjVGJup9qVZ3vjsV/AsZRRr4UgRZNqS2h8JUR1NL BXYkhDx6AHj72Djstann2HjvH0Z+zO3ZWKtUydnQXiPcC0HimFdfpZ9+eI6+accfnJWCCH Qr4F889gKbO3bUATr7IzmmOLsKYPOM0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-381-9-zoXYwkOric94llXeUDHg-1; Fri, 24 Sep 2021 06:07:30 -0400 X-MC-Unique: 9-zoXYwkOric94llXeUDHg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BCBCD835DE4; Fri, 24 Sep 2021 10:07:28 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.134]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 36B245172D; Fri, 24 Sep 2021 10:07:28 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8069F180063A; Fri, 24 Sep 2021 12:07:26 +0200 (CEST) Date: Fri, 24 Sep 2021 12:07:26 +0200 From: "Gerd Hoffmann" To: "Xu, Min M" Cc: Brijesh Singh , "Yao, Jiewen" , "devel@edk2.groups.io" , Ard Biesheuvel , "Justen, Jordan L" , Erdem Aktas , James Bottomley , Tom Lendacky Subject: Re: [edk2-devel] [PATCH V7 1/1] OvmfPkg: Enable TDX in ResetVector Message-ID: <20210924100726.m33otbjod4fo3vur@sirius.home.kraxel.org> References: <20210923084821.yxizus3loa2p6hms@sirius.home.kraxel.org> <7c9aeb95-5c33-bd8d-4f0c-40133f4c7c3d@amd.com> <20210924052825.2qljhtvweonbov5q@sirius.home.kraxel.org> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 Hi, > > The question why TDX_BFV_RAW_DATA_OFFSET and > > TDX_BFV_RAW_DATA_SIZE are needed and why TDX_BFV_MEMORY_BASE + > > TDX_BFV_MEMORY_SIZE can't be used is still open. > Here is a BFV metadata. > 37 <1> _Bfv: > 38 00000140 00400800 <1> DD TDX_BFV_RAW_DATA_OFFSET > 39 00000144 00C03700 <1> DD TDX_BFV_RAW_DATA_SIZE > 40 00000148 0040C8FF00000000 <1> DQ TDX_BFV_MEMORY_BASE > 41 00000150 00C0370000000000 <1> DQ TDX_BFV_MEMORY_SIZE > 42 00000158 00000000 <1> DD TDX_METADATA_SECTION_TYPE_BFV > 43 0000015C 01000000 <1> DD TDX_METADATA_ATTRIBUTES_EXTENDMR > > TDX_BFV_RAW_DATA_OFFSET/TDX_BFV_RAW_DATA_SIZE indicates the offset/size of BFV in Ovmf.fd. > TDX_BFV_MEMORY_BASE/ TDX_BFV_MEMORY_SIZE is the physical memory address which is to be mapped. > TDX-QEMU use these information to 1) do the measurement of the BFV 2) map the BFV to the physical memory TDX_BFV_RAW_DATA_SIZE + TDX_BFV_MEMORY_SIZE are identical. Why do you need both? Yes, I know, some entries have RAW_DATA_SIZE=0 because nothing is loaded for them. You can also figure that by looking at the section type. TDX_BFV_RAW_DATA_OFFSET can be calculated from TDX_BFV_MEMORY_BASE, it's a fixed offset (depending on firmware size). At least as long as the firmware loading uses to the usual x86 workflow (place right below 4G). Also: When placing the firmware below 4G MEMORY_BASE + MEMORY_SIZE can be DD. The attribute field can be added to the ovmf meta data, or we make that part of the section type. > *Config-A* enables a minimum functionality in OvmfPkgX64.dsc without > breaking existing functionality. > *Config-B* is a separate platform configuration file can be used to > provide all the security guarantees that TDX provides. Why does config-b need a completely different initialization code path (i.e. skip PEI, see slide 11 of the tdvf design review)? take care, Gerd