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 BD3B27803D2 for ; Thu, 21 Mar 2024 12:27:18 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=MG1biU1qwT0AR1+Gv1pJqU+vvYG7tbFLUc21+RxVWxE=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From: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; s=20240206; t=1711024037; v=1; b=B8cplrdYvxmJGSUx3Uu87XQIN5SKud+VJcp+mhTo5HOTvOp/FxeX+A9hTdAoRAMLg+Dqqu8S pumEHqlGwnDAIuxQsJj/+X8D5wdN9maNDDNBUotoZ6ySY3sA/U0yuIUE7QD8v/GfykyCbUWEBQJ Gl1UadqvromsigRcWtJKRqd8chv4KzF542dfnFE6cyIkg67LuN3H8rohKT2XN4wt3wcwOuyp0PS S6Tr5V/Q+OMZKC4sAadEc5ptYrD3E9bKORYU3vqvaIyYn1dwgUF4/LbQCiz7AQTglKSPO3bFXI1 5b7bZuFan6pxqIMiXWclpjG1XM9bPlAqP8avlQm9lYnrg== X-Received: by 127.0.0.2 with SMTP id s8uRYY7687511xZb9fcU27fB; Thu, 21 Mar 2024 05:27:17 -0700 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web11.6168.1711024035055300745 for ; Thu, 21 Mar 2024 05:27:16 -0700 X-Received: from loongson.cn (unknown [10.40.24.149]) by gateway (Coremail) with SMTP id _____8CxF+ifJ_xl2dwbAA--.46230S3; Thu, 21 Mar 2024 20:27:11 +0800 (CST) X-Received: from [10.40.24.149] (unknown [10.40.24.149]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxVMycJ_xlrghgAA--.59415S3; Thu, 21 Mar 2024 20:27:08 +0800 (CST) Message-ID: <087ba48a-223f-4e5e-be8a-7a81f3164e2f@loongson.cn> Date: Thu, 21 Mar 2024 20:27:08 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v1 21/26] OvmfPkg/LoongArchVirt: Add FdtQemuFwCfgLib To: devel@edk2.groups.io, kraxel@redhat.com Cc: lixianglai , Ard Biesheuvel , Jiewen Yao , Jordan Justen , Bibo Mao , Dongyan Qian 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> From: "Chao Li" In-Reply-To: X-CM-TRANSID: AQAAf8BxVMycJ_xlrghgAA--.59415S3 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQADCGX77+gD5gABs3 X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== 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 05:27:16 -0700 Reply-To: devel@edk2.groups.io,lichao@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: XjjQ1JzFOeOIhw6Xlxf6e6f9x7686176AA= Content-Type: multipart/alternative; boundary="------------FtbhPiGQ4KZXG83r2DLrcxy8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=B8cplrdY; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io --------------FtbhPiGQ4KZXG83r2DLrcxy8 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Gerd, Thanks, Chao On 2024/3/21 19:39, Gerd Hoffmann wrote: > 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 OK, I'm going to do the plan B next and commit it with the next version, which will probably be called "Part 3 patch set, enable LoongArchVirtQemu in OvmfPkg". > > take care, > Gerd > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116960): https://edk2.groups.io/g/devel/message/116960 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] -=-=-=-=-=-=-=-=-=-=-=- --------------FtbhPiGQ4KZXG83r2DLrcxy8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi Gerd,


Thanks,
Chao
On 2024/3/21 19:39, Gerd Hoffmann wrote:
  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
OK, I'm going to do the plan B next and commit it with the next version, which will probably be called "Part 3 patch set, enable LoongArchVirtQemu in OvmfPkg".

take care,
  Gerd





_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116960) | | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--------------FtbhPiGQ4KZXG83r2DLrcxy8--