Hi Ard,


Thanks,
Chao
On 2024/5/6 18:24, Ard Biesheuvel wrote:
On Mon, 6 May 2024 at 12:02, Chao Li <lichao@loongson.cn> wrote:
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?

It uses the -kernel QEMU command line argument, not the -bios one.

This uses the Linux/arm64 kernel boot protocol (and runs the firmware
entirely from RAM) rather than booting from NOR flash.

Alright, I got it.

Does this mean that after this change, I just verify that the -kernel command line can boot the OS and that it can load/store some variables via the Linux OS?

If so, I have some plans:

1. Port the ARM version to OvmfPkg and add the setting PCD method. Done.

2. Enable the new library on ArmVirtQemu.dsc and remove the hardcode in INC file, verify this platform. Done.

3. Enable the new library on ArmVirtQemuKernel.dsc and verify this platform. Just verfiy booting OS and load/store some variables via Linux kernel. In progress.

4. Remove the ARM NorFlashQemuLib. Pending.

Is the plans mentioned above possible?





_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

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

_._,_._,_