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 98FCDD80186 for ; Thu, 21 Mar 2024 11:40:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=I2VYCxpZRImk6hTFXgWEzyZJwTQVbeBCUAFJXEBedCA=; c=relaxed/simple; d=groups.io; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition:Content-Transfer-Encoding; s=20240206; t=1711021223; v=1; b=Eg04/gyy1BOi5EmfdoA3TcAwYVhNmDSKvOa2mLDD+5cn4mDK7RyXQhgXT1KHHCogy5Au1fVT VYguL6o4bfCI4F0TR86/9asCV/Tg0q5OMombO2HaBLb1DUg5T04SokKu1usAwlZtBhiuyvu8fuj 9M9SpNox8QGYZHbXPASLByJOQ+vGqujvrxz8UkVQkP+MAhJjYJES1YDDRQqZemtZpVtpUiu5FuA weKD/vWyyKaGak2WA05JKQMENH4pD0BDqLyI6+4V5L6ujd1yIpMFFQ5rI6F4PWCy4MgkC8tuWw6 4KbdiaFC7e+9ehnMHsbokSswoTuy01GUMKPx1Mu9QOzZA== X-Received: by 127.0.0.2 with SMTP id bRxzYY7687511xkHE7MMKYnn; Thu, 21 Mar 2024 04:40:23 -0700 X-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.5239.1711021222685138999 for ; Thu, 21 Mar 2024 04:40:22 -0700 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-517-8WMzaojmOlKxLK2ozVvfEA-1; Thu, 21 Mar 2024 07:40:15 -0400 X-MC-Unique: 8WMzaojmOlKxLK2ozVvfEA-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 CB0E21018985; Thu, 21 Mar 2024 11:40:14 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.134]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6CE253C23; Thu, 21 Mar 2024 11:40:14 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 646051800DCA; Thu, 21 Mar 2024 12:39:53 +0100 (CET) Date: Thu, 21 Mar 2024 12:39:53 +0100 From: "Gerd Hoffmann" To: Chao Li Cc: devel@edk2.groups.io, lixianglai , Ard Biesheuvel , Jiewen Yao , Jordan Justen , Bibo Mao , Dongyan Qian Subject: Re: [edk2-devel] [PATCH v1 21/26] OvmfPkg/LoongArchVirt: Add FdtQemuFwCfgLib Message-ID: References: <20240311093631.1251466-1-lichao@loongson.cn> <20240311093924.1254576-1-lichao@loongson.cn> <01d94c67-de3d-7709-84d4-ec97dc7a01ec@loongson.cn> <2teja7rxfli7fxvxlii54tbdaj2y6jz2qlvprf7pfpzzjyycrz@gp5axpziekwh> <949717bb-5dbd-4298-9482-a3b12ded650a@loongson.cn> MIME-Version: 1.0 In-Reply-To: <949717bb-5dbd-4298-9482-a3b12ded650a@loongson.cn> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 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 Resent-Date: Thu, 21 Mar 2024 04:40:22 -0700 Reply-To: devel@edk2.groups.io,kraxel@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: jx5Jcv7WHlaLSLkTFnutGNMSx7686176AA= Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b="Eg04/gyy"; 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, > QemuFwCfgLibMmio.inf is looks like a DXE stage library, while this patch is > the PEI stage library we are dicussing. > > I have tow plans: > > *Plan A:* Keep this library under LoongArchQemuVirt. > > *Plan  B:* Create a new INF named QemuFwCfgPeiLibMmio.inf under > OvmfPkg/Library/QemuFwCfgLib/, which will obtain the resources from FDT, and > store them in the HOB or dynamic PCD. > > Which one do you like? I'm leaning toward B because more people will be > served if it's under OvmfPkg/Library. Yes, Plan (b) is better. Also try avoid code duplication. The existing code can be splitted into two files. Move the code which works in DXE only (i.e. the bits using FdtClientProtocol to find the fw_cfg mmio address, maybe more) to QemuFwCfgLibMmioDxe.c, keep the code which can work for both PEI and DXE in QemuFwCfgLibMmio.c. Add QemuFwCfgLibMmioPei.c for the PEI-specific code. The ioport version of the library uses the same approach with QemuFwCfgLib.c + QemuFwCfgDxe.c + QemuFwCfgPei.c take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116958): https://edk2.groups.io/g/devel/message/116958 Mute This Topic: https://groups.io/mt/104859897/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-