From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail04.groups.io (mail04.groups.io [45.79.224.9]) by spool.mail.gandi.net (Postfix) with ESMTPS id D4E47941040 for ; Wed, 17 Apr 2024 02:53:32 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=7uyx4w93p5KXGb74BtnyWf+hZ63UhzpVmN96GL6IvKY=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:From:To:Cc:Reply-To:References:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1713322411; v=1; b=LichSZqS1khzcbEY2InKqgedpMv9kMCE4pCugvWbEo4Zp14zG37GLqi4kDtE5hHYYkxf8HIW 6HA9AlruvkV3azoBVQ1aW+pHSglSBCn0eAABVWPYsW2tUGyXzw/HlNyud9nYp62lk2G5RvkSr3w O5mbg69WBE1iAUtTyJP6+tyif0avM/3POB4u99QtAMkAAOjtCH/A+mIwmj06UkOnr3BPF59QrHO txzSnMCza384+AtIAdzAF/jUMZLY/fMwcDQvZ+BPaaFdwMdXa6kN6+JIgQDkhxF7B/SG73dMEC5 HHtN3SdzREg727IjgbVutr/QHvLb+OSxtMPRD5WnNlhcQ== X-Received: by 127.0.0.2 with SMTP id nEhNYY7687511xKVYP8GcWfe; Tue, 16 Apr 2024 19:53:31 -0700 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web11.3899.1713322409542955985 for ; Tue, 16 Apr 2024 19:53:30 -0700 X-Received: from loongson.cn (unknown [10.40.24.149]) by gateway (Coremail) with SMTP id _____8CxqrqlOR9m4JwoAA--.10987S3; Wed, 17 Apr 2024 10:53:25 +0800 (CST) X-Received: from [10.40.24.149] (unknown [10.40.24.149]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxRMyhOR9m3ZJ9AA--.34026S3; Wed, 17 Apr 2024 10:53:21 +0800 (CST) Message-ID: <323033d0-8749-4885-a4b1-7f6f854b6487@loongson.cn> Date: Wed, 17 Apr 2024 10:53:21 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v1 21/26] OvmfPkg/LoongArchVirt: Add FdtQemuFwCfgLib From: "Chao Li" To: devel@edk2.groups.io, kraxel@redhat.com Cc: lixianglai , Ard Biesheuvel , Jiewen Yao , Jordan Justen , Bibo Mao , Dongyan Qian Reply-To: devel@edk2.groups.io,lichao@loongson.cn 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> <17BEC74BB37915EC.2828@groups.io> In-Reply-To: <17BEC74BB37915EC.2828@groups.io> X-CM-TRANSID: AQAAf8AxRMyhOR9m3ZJ9AA--.34026S3 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQAKCGYeNusH8gABsS 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: Tue, 16 Apr 2024 19:53:30 -0700 Resent-From: lichao@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: oNjoedNF6KPBqGLor8RzpIO4x7686176AA= Content-Type: multipart/alternative; boundary="------------CQEMquR0DIl2H20r2SBXvArW" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=LichSZqS; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.9 as permitted sender) smtp.mailfrom=bounce@groups.io --------------CQEMquR0DIl2H20r2SBXvArW Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Gerd, Part 2 has been be merged, I'm separating  this Lib into two serve the PEI stage and DXE stage. Currently, This DXE library uses three global variables, and when I simulate the no-mmio version: MmioLib.c + Dxe.c + Pei.c, I can abstract some helper functions as the public functions in Mmio version. Do you mind if I replace these three vaiables with three dynamically typed PCDs? If so, the PEI and DXE stage libraries can using  some of the same APIs. Thanks, Chao On 2024/3/21 20:27, Chao Li wrote: > > Hi Gerd, > > 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 (#117891): https://edk2.groups.io/g/devel/message/117891 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] -=-=-=-=-=-=-=-=-=-=-=- --------------CQEMquR0DIl2H20r2SBXvArW Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi Gerd,

Part 2 has been be merged, I'm separating  this Lib into two serve the PEI stage and DXE stage.

Currently, This DXE library uses three global variables, and when I simulate the no-mmio version: MmioLib.c + Dxe.c + Pei.c, I can abstract some helper functions as the public functions in Mmio version.

Do you mind if I replace these three vaiables with three dynamically typed PCDs? If so, the PEI and DXE stage libraries can using  some of the same APIs.


Thanks,
Chao
On 2024/3/21 20:27, Chao Li wrote:

Hi Gerd,

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 (#117891) | | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--------------CQEMquR0DIl2H20r2SBXvArW--