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.12221.1643202254251192667 for ; Wed, 26 Jan 2022 05:04:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UcyyLref; 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=1643202253; 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=hfczadQbFe1e/BqoHhe1OIZt8QJghDSTNWtkl1v0W4c=; b=UcyyLrefQJc4TZv5T4pdCnfss0mc6PIRchAcFzQ3fVemaHDZegBP1b3uWnZHo/pUzZRc2Z vi/O4mMY8kGTMS0Y+wlb1v+NADUg9naCFElXi9mif2vn3mOAdXS97857LrtUVAXNClrSke IsiNiTi78Vk8sORjiJJxFKV2J6nP/2A= 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-75-jREcoRfON2e8EIUvY1jm7w-1; Wed, 26 Jan 2022 08:04:07 -0500 X-MC-Unique: jREcoRfON2e8EIUvY1jm7w-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 A3C771006AA0; Wed, 26 Jan 2022 13:04:05 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C3867B6ED; Wed, 26 Jan 2022 13:04:05 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 68D7E18000AA; Wed, 26 Jan 2022 14:04:03 +0100 (CET) Date: Wed, 26 Jan 2022 14:04:03 +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 Subject: Re: [PATCH V5 22/33] OvmfPkg: Add PlatformInitLib Message-ID: <20220126130403.ygra7qoqnl5r3vav@sirius.home.kraxel.org> References: 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 On Sun, Jan 23, 2022 at 09:36:53AM +0800, Min Xu wrote: > RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 > > There are multi-variants of PlatformPei in OvmfPkg, for example, > - OvmfPkg/PlatformPei > - OvmfPkg/Bhyve/PlatformPei > - OvmfPkg/XenPlatformPei > These PlatformPeis share a lot of duplicated codes. It makes difficulty > for reviwers and maintainers. > > The goal of PlatformInitLib is to wrap the common functions in these > PlatformPei. As the first stage, below functions are included: > - Cmos functions > - System memory related functions > - Platform initialization functions > - Hob functions > > PlatformInitLib is designed for SEC and PEIM. So global variables cannot > be used to pass information between different functions. Dynamic PCDs > are not available either. Can we please reorganize and split this and the next patch into smaller, review-able pieces instead of two 50k monster patches? Possibly it makes sense to split this into a separate series. Specifically changing code and moving code should be separate patches. I'd suggest to struct the patch series like this: (1) create an empty PlatformInitLib (2) apply code changes needed to make the code usable in sec phase (one patch per change). (3) move over the code (without modifications) to PlatformInitLib. thanks, Gerd