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.web11.4786.1646828700037364524 for ; Wed, 09 Mar 2022 04:25:00 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BhcqOejJ; 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=1646828699; 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=oNPkmzNcRVQbGkK96/SL77/vrmEFYrLnAVUT659KguM=; b=BhcqOejJ08TcDkppj6h/bTwHmGnB9/3ua4BpNxsHsriLc5RuUTyf2kPRyHjRvy5F/D5Vuj 8Uca1Plnmbgz1IkKcCMsuv1Ju5hX2pYoQOUtRqSlty9Z2uiMQFJ18n3OqV6JbdP9bxFcfO CyeQLbmifnJAU3zZy4Z3IgM3zidjFLE= 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-433-LicAb7ONNlSaoDMdsFi_9Q-1; Wed, 09 Mar 2022 07:24:55 -0500 X-MC-Unique: LicAb7ONNlSaoDMdsFi_9Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9A34E51E0; Wed, 9 Mar 2022 12:24:53 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 020F37887F; Wed, 9 Mar 2022 12:24:53 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 29DBA1800098; Wed, 9 Mar 2022 13:24:51 +0100 (CET) Date: Wed, 9 Mar 2022 13:24:51 +0100 From: "Gerd Hoffmann" To: Min Xu Cc: devel@edk2.groups.io, Ard Biesheuvel , Jordan Justen , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Sebastien Boeuf Subject: Re: [PATCH 00/14] Introduce PlatformInitLib in OvmfPkg Message-ID: <20220309122451.caywlaymnk3xj7zk@sirius.home.kraxel.org> References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 Tue, Mar 08, 2022 at 10:36:01AM +0800, Min Xu wrote: > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 > > There are 3 variants of PlatformPei in OvmfPkg: > - OvmfPkg/PlatformPei > - OvmfPkg/Bhyve/PlatformPei > - OvmfPkg/XenPlatformPei > > A lot of common code can be shared in above PlatformPeis. Further more, > with the upstreaming of TDVF (Pei-less boot mode), a library which > wraps the common functions is needed. PlatformInitLib is designed > to meet this requirement. > > PlatformInitLib is designed to run in both PEI and SEC. So global > variables and dynamic PCDs are avoided. > > As the first stage, OvmfPkg/PlatformPei will be refactored with > PlatformInitLib. In the future we will refactor other PlatformPeis > with this lib as well. > > Patch 1 - 2: > Create initial version of PlatformInitLib and move Cmos / Hob functions > to the lib. > > Patch 3: > Move global variables in PlatformPei to PlatformInfoHob. Changes are > all in OvmfPkg/PlatformPei. > > Patch 4 - 12: > These patches restruct the functions which set PCDs into two, one for > PlatformInitLib, one for PlatformPei. > > Patch 13 - 14: > Pure move from PlatformPei to PlatformInitLib. > > Code at: https://github.com/mxu9/edk2/tree/platform-init-lib-v1 Looks all sane to me, also survived a smoke test with pc + q35 + microvm. Acked-by: Gerd Hoffmann take care, Gerd