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 D3E8AD81195 for ; Mon, 6 May 2024 10:24:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=uRl2CRrBxV/eFj99QSgstn/QHvo1mPb4+UgvGHcq9zY=; 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:Content-Transfer-Encoding; s=20240206; t=1714991069; v=1; b=UW4Ja55gYuMI6ZL2qc7S06Ae6j++VKMZfZpX9iKEqWgagOz2S3h9Zu2gx+CoQBEQN7Zja76+ mrFuxP6lKWW9Yyy97AUvIRDnXBGqsJ/CCoAJYaOaZxrV8GLR5ZToX33Kd55mY56w5rKyI7hu6Et tLQRKLrCnVcMqf5iEWqfr3JCdM1uiM7cdJONRHNG4fsTlk9cv9aOcCyheG2oBB/8oEfrcO0Eo67 yQkrLDoPsTkyB8vnFUNX8bUBdihYznYzwi1DNt1ZRQ1pTrtXkFSpF9jZlEaVn+NVgyYIB1vxZGW ADX4k+Uuh2ZjOSuYerzbCUSaboOFv67h//e4ShSHSFu3A== X-Received: by 127.0.0.2 with SMTP id uLRmYY7687511xM8oyVgCEyR; Mon, 06 May 2024 03:24:29 -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.17185.1714991068458776213 for ; Mon, 06 May 2024 03:24:28 -0700 X-Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E3EF16116E for ; Mon, 6 May 2024 10:24:27 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F59DC116B1 for ; Mon, 6 May 2024 10:24:27 +0000 (UTC) X-Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2df9af57b5eso22386671fa.2 for ; Mon, 06 May 2024 03:24:27 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWQ6FT/TadGzDgfWL4k5P1zAhOBRrIpDkgOrz63zfpMDtUfLCewlevkN2caeGHAW4bqxPaAsBmtvFFIwJUZMMulpm6liQ== X-Gm-Message-State: VkPsrfg0BxqOwm1mw7cjkaVsx7686176AA= X-Google-Smtp-Source: AGHT+IF9zsYM0OEhDCpXo+2hC2sKyLjcO3og+EfLtXs2lX7DP3wg10H98wDvHEDJxPt4MJssMavF2HjiiEb8IwMr3oE= X-Received: by 2002:a2e:9791:0:b0:2e1:e4bb:d6eb with SMTP id y17-20020a2e9791000000b002e1e4bbd6ebmr8000937lji.17.1714991065959; Mon, 06 May 2024 03:24:25 -0700 (PDT) MIME-Version: 1.0 References: <20240311093631.1251466-1-lichao@loongson.cn> <20240311093919.1254515-1-lichao@loongson.cn> <7nqe7k3oi3cph7mhqc4t5ea7qair3u2i7dy6oli6wurovyaoqa@apkw6d7gneam> <51c896fa-60bb-127f-c346-dc69179d288f@loongson.cn> In-Reply-To: From: "Ard Biesheuvel" Date: Mon, 6 May 2024 12:24:14 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH v1 20/26] OvmfPkg/LoongArchVirt: Add NorFlashQemuLib To: Chao Li Cc: Gerd Hoffmann , lixianglai , devel@edk2.groups.io, Ard Biesheuvel , Jiewen Yao , Jordan Justen , Bibo Mao , Dongyan Qian 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:24:28 -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" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=UW4Ja55g; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) On Mon, 6 May 2024 at 12:02, Chao Li 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 i= t > in aarch64 after merging this change, because I think it may be tweaked a= nd > 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 P= CD method, I have verified successfully on ArmVirtQemu.dsc(both -bios and p= flash), but I found that the ArmVirtQemuKernel.dsc also depends this librar= y, so what's the difference between the two platforms? > > When I try to verify on ArmVirtQemuKernel.dsc that it works based on -bio= s 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 o= ption "-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. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118595): https://edk2.groups.io/g/devel/message/118595 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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-