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 4950CD80186 for ; Thu, 21 Mar 2024 01:38:22 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=oIIuWD1os77znWMgY+SIXHS016sGfPH4iUXAj7XOfpM=; 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=1710985100; v=1; b=p+zmpnS1uywONz0MWIDenm96naiAuyRo6yFy13ItZJU5v+AE1Bx1+KM/YSkTsDYy1uRIBXVD Pm1b9HMTjy3dYxjnLut87ATV7xjf50lqlhUBuPHPml7k+9zsIOb9S4cxQNlAxDN1+ahoW0fwu4q 1X9Qa2RVZL7e8wU6du+A5kfZiZpwW1xt+E2uBZH8Hr3tCirRH9sP9PmRQC0p+7AOR6M4PsC8cHP 8jnBIte8x1QG45URkPMpKuU2QGV/cELlGBwOLfmDZ3rJSFTjRO7Iuadx9gqlMg8AboSY4UOrlAU wSKQwZR/IOKd8nMrpohZmgVVGfZ8D3iL/9RaVgHKUp8gA== X-Received: by 127.0.0.2 with SMTP id Ks8UYY7687511xCIlhADpd5h; Wed, 20 Mar 2024 18:38:20 -0700 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web11.4510.1710985099354555883 for ; Wed, 20 Mar 2024 18:38:20 -0700 X-Received: from loongson.cn (unknown [10.40.24.149]) by gateway (Coremail) with SMTP id _____8Cx2uiHj_tlC6AbAA--.46282S3; Thu, 21 Mar 2024 09:38:15 +0800 (CST) X-Received: from [10.40.24.149] (unknown [10.40.24.149]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxjhOEj_tl+TxfAA--.63268S3; Thu, 21 Mar 2024 09:38:12 +0800 (CST) Message-ID: <949717bb-5dbd-4298-9482-a3b12ded650a@loongson.cn> Date: Thu, 21 Mar 2024 09:38:12 +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> From: "Chao Li" In-Reply-To: X-CM-TRANSID: AQAAf8AxjhOEj_tl+TxfAA--.63268S3 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQADCGX6nmgGkwABs3 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: Wed, 20 Mar 2024 18:38:20 -0700 Reply-To: devel@edk2.groups.io,lichao@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Kx4ZXvONHdovlGmBEW7FgCK7x7686176AA= Content-Type: multipart/alternative; boundary="------------zkKdMSocd7D00lB8r3ejA98L" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=p+zmpnS1; 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=none --------------zkKdMSocd7D00lB8r3ejA98L Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Gerd, Thanks, Chao On 2024/3/20 18:16, Gerd Hoffmann wrote: > On Mon, Mar 18, 2024 at 04:28:17PM +0100, Gerd Hoffmann wrote: >> On Sat, Mar 16, 2024 at 10:17:00AM +0800, lixianglai wrote: >>> Hi Gerd: >>>> On Mon, Mar 11, 2024 at 02:39:31AM -0700, Chao Li wrote: >>>>> This library for PEI phase, and obtains the QemuFwCfg base address by >>>>> directly parsing the FDT, reads and writes the data in QemuFwCfg by >>>>> operating on the QemuFwCfg base address. >>>>> create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/FdtQemuFwCfgPeiLib.c >>>>> create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/FdtQemuFwCfgPeiLib.inf >>>>> create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/QemuFwCfgLibInternal.h >>>>> create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/QemuFwCfgPei.c >>>> Is there anything LoongArch-specific in there? >>> No,The main function of this lib library is to obtain the fwcfg base address by parsing fdt in the pei stage, >>>  and provide access to fwcfg through mmio mode, >>>  the difference between it and the existing library is that the fwcfg base address is not hard-coded in the compilation stage, >>>  and is accessed through mmio rather than io port. >> That would be the case for risc-v and aarch64 too, although I think they >> don't need fw_cfg right now (they get all info needed via fdt). > Oops, I was wrong, we have OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf 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. > > take care, > Gerd > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116944): https://edk2.groups.io/g/devel/message/116944 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] -=-=-=-=-=-=-=-=-=-=-=- --------------zkKdMSocd7D00lB8r3ejA98L Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi Gerd,


Thanks,
Chao
On 2024/3/20 18:16, Gerd Hoffmann wrote:
On Mon, Mar 18, 2024 at 04:28:17PM +0100, Gerd Hoffmann wrote:
On Sat, Mar 16, 2024 at 10:17:00AM +0800, lixianglai wrote:
Hi Gerd:
On Mon, Mar 11, 2024 at 02:39:31AM -0700, Chao Li wrote:
This library for PEI phase, and obtains the QemuFwCfg base address by
directly parsing the FDT, reads and writes the data in QemuFwCfg by
operating on the QemuFwCfg base address.
 create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/FdtQemuFwCfgPeiLib.c
 create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/FdtQemuFwCfgPeiLib.inf
 create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/QemuFwCfgLibInternal.h
 create mode 100644 OvmfPkg/LoongArchVirt/Library/FdtQemuFwCfgLib/QemuFwCfgPei.c
Is there anything LoongArch-specific in there?
No,The main function of this lib library is to obtain the fwcfg base address by parsing fdt in the pei stage,
 and provide access to fwcfg through mmio mode,
 the difference between it and the existing library is that the fwcfg base address is not hard-coded in the compilation stage,
 and is accessed through mmio rather than io port.
That would be the case for risc-v and aarch64 too, although I think they
don't need fw_cfg right now (they get all info needed via fdt).
Oops, I was wrong, we have OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf

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.


take care,
  Gerd





_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

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

_._,_._,_
--------------zkKdMSocd7D00lB8r3ejA98L--