From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mXltO-0004pH-Og for mharc-grub-devel@gnu.org; Tue, 05 Oct 2021 10:58:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXltN-0004lG-C3 for grub-devel@gnu.org; Tue, 05 Oct 2021 10:58:05 -0400 Received: from mout.gmx.net ([212.227.15.15]:33919) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXltK-0000DP-Vt for grub-devel@gnu.org; Tue, 05 Oct 2021 10:58:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1633445874; bh=FF9F100ZljQyLppHQya5gt6uemEp94NZ2Z2fqE+XsWI=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=Qyw0X6keHvEaOC+OBcRvVJoE2gFMcazomFjAhrxHu/reQtl5kTPAqf3BYwUd9S4Td dPIaPMPpJwaBUU6P/yanoO3L3gF4w8klfIVm643rLVNjs5JSGxLaHVXurVrRHL6w2c cx5o6tUHdn0Si3SgZCrPPb0GVturkdHJlCIj7iek= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.55] ([88.152.144.157]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N95iH-1mtXQE3rsd-016AbV; Tue, 05 Oct 2021 16:57:54 +0200 Message-ID: Date: Tue, 5 Oct 2021 16:57:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: [PATCH v2 3/7] efi: implemented LoadFile2 initrd loading protocol for Linux Content-Language: en-US To: Andreas Schwab Cc: Nikita Ermakov , GRUB development mailing list , Ard Biesheuvel , Atish Patra , Daniel Kiper , Leif Lindholm References: <20210602211235.377366-1-arei@altlinux.org> <20210602211235.377366-4-arei@altlinux.org> <87zgs3h4de.fsf@igel.home> <2cd1f905-8b96-131d-ccbb-34e535a030c5@gmx.de> <87ee8zkcry.fsf@igel.home> From: Heinrich Schuchardt In-Reply-To: <87ee8zkcry.fsf@igel.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:/Xz3WKp7fQWK0waTEPGLZYWbLTqOJ2gXZ2Z0lhPW9yNev9rzTEO tjEvVqgXjKIgYHeyCRjpnoXmZzhqABgGmi7HWiO5R3wx4qbBOGBsIvGPgz40z2hIcSgQa+s 0OwpCFn4hGAhV23FG7QRZA6/1VOs2tj3g7ztkEwfADeuYDGeHZ0MBWryyr0o5pDTdfK6qg4 Apya/PcAjjkSH5G1K69tg== X-UI-Out-Filterresults: notjunk:1;V03:K0:/aZ22+ok7XQ=:AmwZnamL+kxrB4kU+Lo9Ub YKTXhySVCzwolj9fP8t3QOVodtvTFj2uI46U1bm9aTTKu2o4NcY2myRRGeuNSyq603/FkZDOX Tw7Fj6aRlpfdDLlX7IobsTaBEH1T0FEZEp8gJuakmWu/qv632j0wh6QrDpC1u7WpjWtojqbZI fcFwM8Wae8uVz7wSkJRrhtH9qWFDdXtV9pMKBFkvARkyBF2WRJUt872BvveezOntTE6atf66g +j5waG016VcwNPZvYPi3wIOlDOrcVrCeYjRI9Qt3S9gE1kp3dcNub3qBkxgxKu93eV6nLyiSV 49BhVtNH6D+W3UiD0jouetebcInjWnLOgjWHEN4IN2OCvBYrMkrSXWNNEOpKmNz9RUU624Emo 3RbDQ7r89JGgPxR7SMsxdhgLWlHxT/FGGjiJCAS+MBViAyuDnYGVFIOJ89bdtnlOCIbCXMPrC nM36RCqjTJDPFWVofFvX9LeNVhqXArxcT2lswfxZ2i7tAuus4rpkZsBNajL/OKWYe4ocvwOP/ W7f2ufvMF9fspamqnY4aCfbskZgsuOsWGE4mqWKY2NJN9hvdo8a+d/2Psx+q6kX9511v08ZTa zNngS9SkJmnErtKf6ECPfE3xhzVaAP4wGyRxMRVW0QBsn8YarepEeXizLy8+K9i2bqYEMrhPA e+MlFfbDDwcpwX4uCCjjq+laesFtDLwZGLFoXXew4fATBf5TRdvILXNX0AVr6kKvwH3iFZXzI N1m+S4L/h0ZlNwNnxUMcDaVGoPDKszbqzFOLAO9PyahsJQr0z3itLRpc4jfEOJDK3QP89ANns 2cJdwTGTG6QzLf8ETfLSJQGBASjFK2dJ0fcFI/yJ6iAQih1w453piJzMe1e9qzPCLeJOyo64x IcltjOWf+HYGmYa2aQ595nRsfy5Ety7tSMDGEvSGRigYBrdrFrwoRUXmPeXKsqlbPn0qU/78w P/1tm1DWNrp+yvGmZC8NqOUqsKtWoCytQeRGT5a/xECwaF39kJTj6Y+fi7otaYd70AOMWd1TU Bz8PBdFlMBenhSOj7Eei++nhxyLnjrcI5YnG6MxjEqy5nYNvj7hwJdJl/gqiWBuhcoRvbiQ/7 J3Oh5dzyB/F+iQ= Received-SPF: pass client-ip=212.227.15.15; envelope-from=xypron.glpk@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2021 14:58:05 -0000 On 10/5/21 12:05, Andreas Schwab wrote: > On Okt 05 2021, Heinrich Schuchardt wrote: > >> Do you think this problem is RISC-V specific > > No, I don't think so. > >> and related to the series? > > Since network download of the kernel works, this seems to be related to > the use of the LoadFile2 protocol. > > Andreas. > Which firmware did you use? U-Boot or EDK II? Which version? I have appended a log for U-Boot v2021.10-rc4 on the Unmatched board below= . Before the 'boot' command the communication via TFTP seems to work fine. The init command can identify which file exists on the TFTP server. The boot command calls ShutDown() and Stop() on the SNP protocol and closes it. And then tries to open it again for the LOAD_FILE2 protocol. The question remains why the protocol cannot be reopened. It is unclear if this is a GRUB or a U-Boot issue. Best regards Heinrich =3D> load mmc 0:f $fdt_addr_r sifive/hifive-unmatched-a00.dtb 9740 bytes read in 15 ms (633.8 KiB/s) =3D> load mmc 0:f $kernel_addr_r grubriscv64.efi 1306624 bytes read in 1193 ms (1 MiB/s) =3D> bootefi $kernel_addr_r $fdt_addr_r grub> debug=3Dlinux,loader,fdt grub> net_dhcp net/drivers/efi/efinet.c:155: Trying to reopen SNP exclusively grub> linux (tftp,192.168.0.3)/riscv64/vmlinuz loader/efi/linux.c:70: UEFI stub kernel: loader/efi/linux.c:71: PE/COFF header @ 00000040 loader/efi/linux.c:85: LoadFile2 initrd loading enabled loader/efi/linux.c:430: kernel file size: 29496832 loader/efi/linux.c:432: kernel numpages: 7202 loader/efi/linux.c:449: kernel @ 0xdd040000 grub> initrd (tftp,192.168.0.3)/risv64/initrd error: File not found. grub> initrd (tftp,192.168.0.3)/riscv64/initrd loader/efi/linux.c:368: LoadFile2 initrd loading protocol installed grub> boot net/drivers/efi/efinet.c:214: Closing the SNP protocol loader/efi/linux.c:168: linux command line: 'BOOT_IMAGE=3D(tftp,192.168.0.3)/riscv64/vmlinuz' loader/efi/linux.c:183: starting image 0xff745320 EFI stub: Booting Linux Kernel... EFI stub: Using DTB from configuration table loader/efi/linux.c:320: Providing initrd via LOAD_FILE2_PROTOCOL net/drivers/efi/efinet.c:155: Trying to reopen SNP exclusively net/drivers/efi/efinet.c:162: Failed to open SNP protocol! net/drivers/efi/efinet.c:79: Transmit() returned: 8000000000000013 error: couldn't send network packet. net/drivers/efi/efinet.c:79: Transmit() returned: 8000000000000013 error: couldn't send network packet. ... EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path EFI stub: Exiting boot services and installing virtual address map... [ 0.000000] Linux version 5.13.0-1004-generic (buildd@riscv64-qemu-lcy01-074) (gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.37) #4-Ubuntu SMP Thu Sep 30 05:02:57 UTC 2021 (Ubuntu 5.13.0-1004.4-generic 5.13.14) [ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000 [ 0.000000] Machine model: SiFive HiFive Unmatched A00 [ 0.000000] efi: EFI v2.80 by Das U-Boot [ 0.000000] efi: RTPROP=3D0xfe6fb040 SMBIOS=3D0xfe6f7000 MEMRESERVE=3D0xd2b92040 [ 0.000000] secureboot: Secure boot disabled ... [ 3.001432] ---[ end Kernel panic - not syncing: No working init found. Try passing init=3D option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. ]-