riscv64: Ubuntu doesn't boot with EDK2, although it boots with u-boot Description of problem: Ubuntu doesn't boot with `edk2-riscv-code.fd`: ```bash wget https://cloud-images.ubuntu.com/noble/20240822/noble-server-cloudimg-riscv64.img qemu-system-riscv64 -M virt -m 2048 -nographic -hda noble-server-cloudimg-riscv64.img \ -drive if=pflash,format=raw,readonly=on,file=/usr/local/share/qemu/edk2-riscv-code.fd ``` ``` Loading Linux 6.8.0-41-generic ... Loading initial ramdisk ... InstallProtocolInterface: 4006C0C1-FCB3-403E-996D-4A6C8724E06D FDB3F3C8 InstallProtocolInterface: 09576E91-6D3F-11D2-8E39-00A0C969723B FDB3F380 [Security] 3rd party image[0] can be loaded after EndOfDxe: MemoryMapped(0x2,0xF9CC4000,0xFC194000). InstallProtocolInterface: 5B1B31A1-9562-11D2-8E3F-00A0C969723B FF29C2C0 Loading driver at 0x000F732C000 EntryPoint=0x000F817FEA6 InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF FF29CC18 ProtectUefiImageCommon - 0xFF29C2C0 - 0x00000000F732C000 - 0x0000000002598000 SetUefiImageMemoryAttributes - 0x00000000F732C000 - 0x0000000000001000 (0x0000000000004000) SetUefiImageMemoryAttributes - 0x00000000F732D000 - 0x0000000000FFF000 (0x0000000000020000) SetUefiImageMemoryAttributes - 0x00000000F832C000 - 0x0000000001598000 (0x0000000000004000) TimerDriverSetTimerPeriod(0x0) SetUefiImageMemoryAttributes - 0x00000000FFEC7000 - 0x000000000000C000 (0x0000000000000000) SetUefiImageMemoryAttributes - 0x00000000FFEBC000 - 0x000000000000B000 (0x0000000000000000) SetUefiImageMemoryAttributes - 0x00000000FFEAC000 - 0x0000000000010000 (0x0000000000000000) SetUefiImageMemoryAttributes - 0x00000000FFEA1000 - 0x000000000000B000 (0x0000000000000000) SetUefiImageMemoryAttributes - 0x00000000FFE84000 - 0x000000000001D000 (0x0000000000000000) SetUefiImageMemoryAttributes - 0x00000000FFE79000 - 0x000000000000B000 (0x0000000000000000) SetUefiImageMemoryAttributes - 0x00000000FFE6E000 - 0x000000000000B000 (0x0000000000000000) SetUefiImageMemoryAttributes - 0x00000000FFE63000 - 0x000000000000B000 (0x0000000000000000) SetUefiImageMemoryAttributes - 0x00000000FFE59000 - 0x000000000000A000 (0x0000000000000000) (hangs here) ``` The same disk image still boots when `uboot.elf` is specified as the kernel image: ```bash wget https://github.com/lima-vm/u-boot-qemu-mirror/releases/download/2023.07%2Bdfsg-1/qemu-riscv64_smode_uboot.elf qemu-system-riscv64 -M virt -m 2048 -nographic -hda noble-server-cloudimg-riscv64.img \ -kernel qemu-riscv64_smode_uboot.elf ``` ``` Loading Linux 6.8.0-41-generic ... Loading initial ramdisk ... syscon-poweroff poweroff: pm_power_off already claimed for sbi_srst_power_off -.mount etc-machine\x2did.mount systemd-journald.service dev-hugepages.mount ... Ubuntu 24.04 LTS ubuntu ttyS0 ubuntu login: ``` Steps to reproduce: See above Additional information: