From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 8CD35D801B0 for ; Wed, 15 Nov 2023 12:52:26 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=GgCobdM2lUnK9f4xJSldkzc3B9VVxrp5EkBIsWPAGxM=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1700052745; v=1; b=oIWBFB7MZ2cskLdphBwNvTLn7/AFLKb6000GesaJTcAZdcLIgl5qQPQ97WJGbr32/eZ/6Frv LxlLQ6ZwfKq+OXtQgb5WYy9jNRmG9UFdQObN8FYDQKY+0U/Djumi/Pi4NC1VNNvpiAc2sQqFixf G60wYwLhfdqOONDaBzK2AS9A= X-Received: by 127.0.0.2 with SMTP id NywyYY7687511x6ORaOoqsZC; Wed, 15 Nov 2023 04:52:25 -0800 X-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.web11.12138.1700052744393987199 for ; Wed, 15 Nov 2023 04:52:24 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-600-L3yflgKLOnW6OjhVwkoeZg-1; Wed, 15 Nov 2023 07:52:19 -0500 X-MC-Unique: L3yflgKLOnW6OjhVwkoeZg-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 999AF85A58A; Wed, 15 Nov 2023 12:52:18 +0000 (UTC) X-Received: from [10.39.192.211] (unknown [10.39.192.211]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA0B61121307; Wed, 15 Nov 2023 12:52:16 +0000 (UTC) Message-ID: <4c3ac39a-3ae6-91a5-10c4-c5abcadd879d@redhat.com> Date: Wed, 15 Nov 2023 13:52:15 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v2 24/30] OvmfPkg/LoongArchVirt: Add platform boot manager library To: devel@edk2.groups.io, lichao@loongson.cn, Gerd Hoffmann Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Xianglai Li , Bibo Mao References: <20231106032521.2251143-1-lichao@loongson.cn> <20231106033021.2294243-1-lichao@loongson.cn> <0e2c2f4d-c559-f9f9-881a-143eec02de4d@redhat.com> <3e97f949-1ad3-4685-901f-945d8101a7df@loongson.cn> <7cc254fe-ac77-ea93-2c8d-d9ac2549da69@redhat.com> From: "Laszlo Ersek" In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: StlB8t5OnwWv2kwG8sS5gGh7x7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=oIWBFB7M; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none) Hi Chao, On 11/15/23 04:21, Chao Li wrote: > Well, let's discuss the ARM version name once moved. > > I have two plans: > > *Plan A:* > > Merge the ARM version into PlatformBootmanagerLib and modify the inf > file to separate X64 and other ARCH, like be: > > [Sources.Common] > >     QemuKernel.c > >     BdsPlatform.h > > [Sources.X64, Sources.IA32] > >     BdsPlatform.c > >     PaltformData.c > > [Sources.ARM, Sources.AARCH64, Sources.RISCV64, Source.LOONGARCH64] > >     PlatformBm.c > > [LibraryClasses.Common] > >     BaseLib > >     BaseMemoryLib > >     BootLogoLib > >     DebugLib > >     DevicePathLib > >     MemoryAllocationLib > >     PcdLib > >     ... > > [LibraryClasses.X64, LibraryClasses.IA32] > >     QemuFwCfgLib > >     QemuFwCfgS3Lib > >     ... > > [LibraryClasses.ARM, LibraryClasses.AARCH64, LibraryClasses.RISCV, > LibraryClasses.LOONGARCH64] > >     TpmPlatformHierarchyLib > >     ... > > > The above pseudocode are unverified and will definitely be subject to > modification. > > > *Plan B:* > > Moved the ARM version into OvmfPkg and got a new name. In my opinion, > the X86 version takes into account the STR, Tcg2 and Xen platform, so it > look like more complete(only for X86, just my opinion). In this case, I > think what about  the X86 version still being named > PlatformBootManagerLib and the ARM version being named > PlatformBootManagerLibLight? > > > Both of the above plans can achieve the goal. I prefer Plan A. I want to > know your opinions, so hope hear back from you! I prefer Plan B. ArmVirtPkg's PlatformBootManagerLib instance does not carry the cruft that had accumulated in OVMF's instance (before we created ArmVirtPkg's instance), and that has continued growing in OVMF's instance since we created ArmVirtPkg's instance. I'm sure there are some bits that are duplicated between both platforms, but in this case, the benefits of the separation strongly outweigh any disadvantages of code duplication, for me anyway. Whenever I want to refer to a pristine PlatformBootManagerLib instance, I use ArmVirtPkg's. I like *not* being tripped up by the quirks and customizations of OvmfPkg's lib instance, whenever I look at the source code. Even if we could find technical solutions for disabling those customizations for ArmVirt at build time or at runtime, they'd still be unwelcome distractions, when reading the source code, or browsing the edk2 directory tree. There is no generic rule for deciding between "customization in place" vs. "duplicating for customization". Both have benefits and costs. AFAICT, we usually pick one versus the other based on "audience homogeneity" -- the code structure is supposed to follow the community structure. In this case, I prefer Plan B. Thanks, Laszlo -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111272): https://edk2.groups.io/g/devel/message/111272 Mute This Topic: https://groups.io/mt/102413902/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-