From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 839BDAC10DA for ; Mon, 6 May 2024 10:02:23 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=+XZuyj+CRy9UwT+qq8t4LCB7UaKjijsjPtgiwombi+s=; 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:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1714989742; v=1; b=Mo6yYC9TM1a12SAweQ9jTMOumREbS33PfxRHthmrFDIh4fEIYvkIgqi+Exv2Q4dlh3nOZgM3 vD53qcm/1oR8XiJEOw18Q/wIkGZeRZzq/PFaffdwuLglHiOQzQvwKyVXwY1n2m1FO3LNOeL6CA8 0FFILtjmVkpCJP5P/nisGOip38mECTGt1aa+MKPWVq5rT0px5oLH+Cs8X97SPOflT15auyd/bLw UMximSDLqLqtE7f5qEreoj00QkOCXkicpTG5iLkVw7ugertON66wjqzCLmLLys+FzX02xliKpyd 8Fi4Zl2gO/qEnZBzVAxuaJIWUVjjJUD4lDd6uz2CoiPlA== X-Received: by 127.0.0.2 with SMTP id n2k9YY7687511xJXZkRT5AXD; Mon, 06 May 2024 03:02:22 -0700 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web11.16914.1714989740276189380 for ; Mon, 06 May 2024 03:02:21 -0700 X-Received: from loongson.cn (unknown [10.40.24.149]) by gateway (Coremail) with SMTP id _____8Ax6umoqjhmFhwIAA--.10418S3; Mon, 06 May 2024 18:02:16 +0800 (CST) X-Received: from [10.40.24.149] (unknown [10.40.24.149]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxBlenqjhmvHESAA--.20653S3; Mon, 06 May 2024 18:02:15 +0800 (CST) Message-ID: Date: Mon, 6 May 2024 18:02:15 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v1 20/26] OvmfPkg/LoongArchVirt: Add NorFlashQemuLib To: Gerd Hoffmann Cc: lixianglai , devel@edk2.groups.io, Ard Biesheuvel , Jiewen Yao , Jordan Justen , Bibo Mao , Dongyan Qian References: <20240311093631.1251466-1-lichao@loongson.cn> <20240311093919.1254515-1-lichao@loongson.cn> <7nqe7k3oi3cph7mhqc4t5ea7qair3u2i7dy6oli6wurovyaoqa@apkw6d7gneam> <51c896fa-60bb-127f-c346-dc69179d288f@loongson.cn> From: "Chao Li" In-Reply-To: X-CM-TRANSID: AQAAf8AxBlenqjhmvHESAA--.20653S3 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQAJCGY4RRQE1QACsc 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: Mon, 06 May 2024 03:02:21 -0700 Resent-From: lichao@loongson.cn Reply-To: devel@edk2.groups.io,lichao@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: tHXjWd9eDcRKQ4Mync8vnuwTx7686176AA= Content-Type: multipart/alternative; boundary="------------2A2v1oCSdiUAO4lbkloMQ0mU" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=Mo6yYC9T; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io --------------2A2v1oCSdiUAO4lbkloMQ0mU Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Gerd, Thanks, Chao On 2024/3/19 16:03, Gerd Hoffmann wrote: > Hi, > >>>> I can't tell the implementation scheme of the current lib and existing >>>> lib implementation scheme which one is better, Could you give we some >>>> advice? >>> I'd suggest to merge your code as OvmfPkg/Library/FdtNorFlashQemuLib as >>> it is not really loongarch-specific. >>> >>> If you want try switch aarch64 to use the same code that'll be great, >>> but sorting that out later is also fine with me. >> If you think this design is looks better, then I'm prepare to commit this >> change under the OvmfPkg/Library as a public library. And I will enable it >> in aarch64 after merging this change, because I think it may be tweaked and >> validated in aarch64 for many platforms. Do you think that is good? > The VirtNorFlashDxe is optimized for qemu-emulated pflash. It tries to > avoid switching between read and write mode much, because that operation > has a significant overhead in virtualization. So it's really only used > by ArmVirtPkg and not lots of other arm platforms. I'm moving the ARM version of the library to OvmfPkg and adding the set PCD method, I have verified successfully on ArmVirtQemu.dsc(both -bios and pflash), but I found that the ArmVirtQemuKernel.dsc also depends this library, so what's the difference between the two platforms? When I try to verify on ArmVirtQemuKernel.dsc that it works based on -bios option,  I use the command line "qemu-system-aarch64 -M virt -cpu cortex-a57 -bios LA_Virt_FW/AARCH64/QEMU_EFI.fd -net none -serial stdio -hdb /home/lichao/Software/Qemu/SctPkg/share.imag -device ramfb -device nec-usb-xhci -device usb-mouse -device usb-kbd", and it tells me "Could not open option rom 'vgabios-ramfb.bin': No such file or directory", I tried removing the option "-device ramfb", it looks like can't work. How does ArmVirtQemuKernel.dsc work? > > Doing it separate from this patch series makes sense nevertheless. > > Speaking of this series: maybe split it into two? The first part > of this series with the Mde*Pkg + UefiPkg changes looks almost ready > to merge to me, so maybe we can get that in while still sorting out > the remaining issues in the OvmfPkg patches ... > > take care, > Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118594): https://edk2.groups.io/g/devel/message/118594 Mute This Topic: https://groups.io/mt/104859896/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- --------------2A2v1oCSdiUAO4lbkloMQ0mU Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi Gerd,


Thanks,
Chao
On 2024/3/19 16:03, Gerd Hoffmann wrote:
  Hi,

I can't tell the implementation scheme of the current lib and existing
lib implementation scheme which one is better, Could you give we some
advice?
I'd suggest to merge your code as OvmfPkg/Library/FdtNorFlashQemuLib as
it is not really loongarch-specific.

If you want try switch aarch64 to use the same code that'll be great,
but sorting that out later is also fine with me.
If you think this design is looks better, then I'm prepare to commit this
change under the OvmfPkg/Library as a public library. And I will enable it
in aarch64 after merging this change, because I think it may be tweaked and
validated in aarch64 for many platforms. Do you think that is good?
The VirtNorFlashDxe is optimized for qemu-emulated pflash.  It tries to
avoid switching between read and write mode much, because that operation
has a significant overhead in virtualization.  So it's really only used
by ArmVirtPkg and not lots of other arm platforms.

I'm moving the ARM version of the library to OvmfPkg and adding the set PCD method, I have verified successfully on ArmVirtQemu.dsc(both -bios and pflash), but I found that the ArmVirtQemuKernel.dsc also depends this library, so what's the difference between the two platforms?

When I try to verify on ArmVirtQemuKernel.dsc that it works based on -bios option,  I use the command line "qemu-system-aarch64 -M virt -cpu cortex-a57 -bios LA_Virt_FW/AARCH64/QEMU_EFI.fd -net none -serial stdio -hdb /home/lichao/Software/Qemu/SctPkg/share.imag -device ramfb -device nec-usb-xhci -device usb-mouse -device usb-kbd", and it tells me "Could not open option rom 'vgabios-ramfb.bin': No such file or directory", I tried removing the option "-device ramfb", it looks like can't work. 

How does ArmVirtQemuKernel.dsc work?


Doing it separate from this patch series makes sense nevertheless.

Speaking of this series: maybe split it into two?  The first part
of this series with the Mde*Pkg + UefiPkg changes looks almost ready
to merge to me, so maybe we can get that in while still sorting out
the remaining issues in the OvmfPkg patches ...

take care,
  Gerd
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

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

_._,_._,_
--------------2A2v1oCSdiUAO4lbkloMQ0mU--