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.web12.8005.1646141474926263681 for ; Tue, 01 Mar 2022 05:31:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a52xre37; 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=1646141474; 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=M1+QMBuYsbVmmlOtnJUq5MBwMlDIXeQxsrehvB7fCoQ=; b=a52xre37yQ3Ygv2QyH7YJods0JE4JtS9VbI8lfoI2PTIBVGsC3A3alsXOlMhvJY3RRse7u +XxbYJPMn2L7wVAi0Iqmh0nk4Hdu+0VxAobKSZ1b3DAONFnjbQGK87Lpf8vIStLw/ONA6C 9KlqOc8B4qYhfoqo40Pkgln6XYmFTso= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-620-yb_Q0hLiMNCxi5RP78TvEw-1; Tue, 01 Mar 2022 08:31:09 -0500 X-MC-Unique: yb_Q0hLiMNCxi5RP78TvEw-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 0B3AF1006AA7; Tue, 1 Mar 2022 13:31:08 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.195.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA6177D3D4; Tue, 1 Mar 2022 13:31:07 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0801F180039D; Tue, 1 Mar 2022 14:31:06 +0100 (CET) Date: Tue, 1 Mar 2022 14:31:06 +0100 From: "Gerd Hoffmann" To: Min Xu Cc: devel@edk2.groups.io, Michael D Kinney , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky Subject: Re: [PATCH V4 04/10] OvmfPkg: Add PeilessStartupLib Message-ID: <20220301133106.7zgie2mz5nkw55ds@sirius.home.kraxel.org> References: <20220228081631.681-1-min.m.xu@intel.com> <20220228081631.681-5-min.m.xu@intel.com> MIME-Version: 1.0 In-Reply-To: <20220228081631.681-5-min.m.xu@intel.com> 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 On Mon, Feb 28, 2022 at 04:16:25PM +0800, Min Xu wrote: > RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 > > PeilessStarupLib provides a function (PeilessStartup) which brings > up both Legacy and Tdx guest from SEC phase to DXE phase. PEI phase > is skipped so that the attack surfaces are reduced as much as possible. > > PeilessStartup() does below tasks: > 1. Contruct the FW hoblist. > Since PEI is skipped, we must find a memory region which is the > largest one below 4GB. Then this memory region will be used as the > firmware hoblist. > 2. Initialize the platform. > 3. Build various Hobs, such as SecFv Hob, DxeFv Hob, Stack Hob, etc. > 4. At last DXE Core is located / loaded and transfer control to it. > > Cc: Michael D Kinney > Cc: Brijesh Singh > Cc: Erdem Aktas > Cc: James Bottomley > Cc: Jiewen Yao > Cc: Tom Lendacky > Cc: Gerd Hoffmann > Signed-off-by: Min Xu > --- > OvmfPkg/Include/Library/PeilessStartupLib.h | 34 + > OvmfPkg/IntelTdx/PeilessStartupLib/DxeLoad.c | 218 ++++ > OvmfPkg/IntelTdx/PeilessStartupLib/Hob.c | 130 +++ > .../PeilessStartupLib/PeilessStartup.c | 241 +++++ > .../PeilessStartupInternal.h | 55 ++ > .../PeilessStartupLib/PeilessStartupLib.inf | 86 ++ > .../PeilessStartupLib/X64/PageTables.h | 206 ++++ > .../PeilessStartupLib/X64/VirtualMemory.c | 935 ++++++++++++++++++ > OvmfPkg/OvmfPkg.dec | 4 + > 9 files changed, 1909 insertions(+) > create mode 100644 OvmfPkg/Include/Library/PeilessStartupLib.h > create mode 100644 OvmfPkg/IntelTdx/PeilessStartupLib/DxeLoad.c Shouldn't this better go to OvmfPkg/Library? Otherwise Acked-by: Gerd Hoffmann take care, Gerd