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 DE27A740041 for ; Fri, 17 May 2024 07:22:05 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=lghsFJVM1yjkqKtfjJ+b55g9B5hcb4uLZEcSuEpJEvg=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc: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=1715930524; v=1; b=M09Xq0VHOTm9TkCg5nBbN0WlnL/BoxddE01VFHhNKv4171d73JUVxaaQUKRROy2BuBaxSmTi 5yS004KhMPKfmHh79G14nXqaa1CfvHFHvAF/NNtHrhv/IsO0OZv6mEZYoFeCJbjEGAmdGjx0plV c6NMg7HXo5g7x+etqlz6WTBMP2NJijTm0Hl3skjQcLsoX1R93xG4vvVg8qFqVDauZbQtaqXUw5Y SVBfOEf1uzwoR3xlDcH0kGkYsTWyZDM05UWkl5el4PqaLGsIg9frY8ERhgGNoUY6mifvRos0is8 m2qVWqJ1L7i/W0uG0x8w31CVxkafQ0+GPYRvKIW51N/Cw== X-Received: by 127.0.0.2 with SMTP id FQqkYY7687511xQWn4xJ5L4v; Fri, 17 May 2024 00:22:04 -0700 X-Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.35027.1715930523350634988 for ; Fri, 17 May 2024 00:22:03 -0700 X-Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C041461798 for ; Fri, 17 May 2024 07:22:02 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58D55C4AF0A for ; Fri, 17 May 2024 07:22:02 +0000 (UTC) X-Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-51f60817e34so2067157e87.2 for ; Fri, 17 May 2024 00:22:02 -0700 (PDT) X-Gm-Message-State: 7lgR2miCiFofIVANlt8zOymTx7686176AA= X-Google-Smtp-Source: AGHT+IHQwL2wdmP5IT4vyvypZ8Io2neXd3Do8YcZ05Ga8sOLa10pk/HTpwGsLBNF5yO23fGjqMxBQq+KGSVxzU9UPJY= X-Received: by 2002:ac2:5049:0:b0:51d:8ff3:d156 with SMTP id 2adb3069b0e04-5220fb6aec0mr13232846e87.19.1715930520553; Fri, 17 May 2024 00:22:00 -0700 (PDT) MIME-Version: 1.0 References: <20240517071729.188409-1-lichao@loongson.cn> In-Reply-To: <20240517071729.188409-1-lichao@loongson.cn> From: "Ard Biesheuvel" Date: Fri, 17 May 2024 09:21:49 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH v1 0/2] Add a new FdtNorFalshQemuLib and enable it in To: devel@edk2.groups.io, lichao@loongson.cn Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Gerd Hoffmann , Jiewen Yao 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: Fri, 17 May 2024 00:22:03 -0700 Resent-From: ardb@kernel.org Reply-To: devel@edk2.groups.io,ardb@kernel.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=M09Xq0VH; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=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 Hello Chao Li, You sent two series in quick succession. Is there any difference between the two? On Fri, 17 May 2024 at 09:17, Chao Li wrote: > > Patch1: Added a new library called FdtNorFlashQemuLib in OvmfPkg/Library > which is non-hardcode dependency. > Patch2: Enable the new library in ArmVirtQemu.dsc and > ArmVirtQemuKernel.dsc. > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4770 > > I have verified on both of the two platforms: > Prepare: > install libvirt, virt-manager, qemu-systemaarch64. > > Step 1: > Built the two platforms with ArmVirtQemu.dsc and > ArmVirtQemuKernel.dsc, and then using the command create the pflash > files: > Build the two platforms firmware using ArmVirtQemu.dsc and > ArmVirtQemuKernel.dsc, and then create the pflash files using following > command: > cat QEMU_EFI.fd /dev/zero | head -c 64m > ./QEMU_EFI-pflash.raw > cat QEMU_VARS.fd /dev/zero | head -c 64m > ./vars-template-pflash.raw > qemu-img convert -f raw -O qcow2 -o cluster_size=4096 -S 4096 QEMU_EFI-pflash.raw QEMU_EFI-pflash.qcow2 > qemu-img convert -f raw -O qcow2 -o cluster_size=4096 -S 4096 vars-template-pflash.raw vars-template-pflash.qcow2 > > Download a AARCH64 QCOW2 image. > Copy them into /usr/share/edk2/aarch64/. > > Step 2: > Verification the pflash working: > ArmVirtQemu: > Run the QEMU ARM virt machine using the following command: > qemu-system-aarch64 \ > -blockdev '{"driver":"file","filename":"/usr/share/edk2/aarch64/QEMU_EFI-pflash.qcow2","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \ > -blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"qcow2","file":"libvirt-pflash0-storage"}' \ > -blockdev '{"driver":"file","filename":"/usr/share/edk2/aarch64/vars-template-pflash.qcow2","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \ > -blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"qcow2","file":"libvirt-pflash1-storage"}' \ > -machine virt,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,acpi=on \ > -cpu cortex-a57 \ > -m size=2097152k \ > -serial stdio \ > -net none \ > -device ramfb \ > -device nec-usb-xhci \ > -device usb-mouse \ > -device usb-kbd > > ArmVirtQemuKernel: > Run the QEMU kernel ARM virt machine using the following command: > qemu-system-aarch64 \ > -blockdev '{"driver":"file","filename":"/usr/share/edk2/aarch64/vars-template-pflash.raw","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \ > -blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \ > -machine virt,usb=off,dump-guest-core=off,gic-version=3,pflash1=libvirt-pflash1-format \ > -cpu cortex-a57 \ > -m 4096 \ > -smp 1,sockets=1,cores=1,threads=1 \ > -no-user-config \ > -nodefaults \ > -device virtio-gpu-pci \ > -kernel /usr/share/edk2/aarch64/QEMU_EFI-pflash.raw \ > -serial stdio \ > -device nec-usb-xhci \ > -device usb-mouse \ > -device usb-kbd \ > -hda /usr/share/edk2/aarch64/openEuler-22.03-LTS-SP3-aarch64.qcow2 \ > -monitor tcp::3333,server,nowait > > Step 3: > After the virt-machines starts, enter "F2" to enter the setup UI, try to > change the boot order or some ther variables stored in the flash, then > enter "F10" to save the changes and reboot it. > After restarting, enter "F2" to enter the setup UI and check whether the > changes before the restart operation have been saved. > > > Using the above three steps, both platforms will works fine. > > I have not created the PR in github yet, I will create it once the edk2 > merge window reopens. > > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Cc: Sami Mujawar > Cc: Gerd Hoffmann > Cc: Jiewen Yao > > Chao Li (2): > OvmfPkg: Add no hardcode version of FtdNorFlashQemuLib > ArmVirtPkg: Enable the non-hardcode version FtdNorFlashQemuLib > > ArmVirtPkg/ArmVirtQemu.dsc | 21 ++- > ArmVirtPkg/ArmVirtQemuKernel.dsc | 20 ++- > ArmVirtPkg/VarStore.fdf.inc | 5 +- > .../FdtNorFlashQemuLib/FdtNorFlashQemuLib.c | 165 ++++++++++++++++++ > .../FdtNorFlashQemuLib/FdtNorFlashQemuLib.inf | 46 +++++ > 5 files changed, 249 insertions(+), 8 deletions(-) > create mode 100644 OvmfPkg/Library/FdtNorFlashQemuLib/FdtNorFlashQemuLib.c > create mode 100644 OvmfPkg/Library/FdtNorFlashQemuLib/FdtNorFlashQemuLib.inf > > -- > 2.27.0 > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118990): https://edk2.groups.io/g/devel/message/118990 Mute This Topic: https://groups.io/mt/106149594/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-