Skip to content

RISC-V 64 System Emulator fdt imporperly created after machine init is done

Host environment

  • Operating system: Ubuntu 22.04
  • OS/kernel version: Linux ubuntu 5.15.0-1044
  • Architecture: x86_64
  • QEMU flavor: qemu-system-riscv64
  • QEMU version: 8.1.1
  • QEMU command line: qemu-system-riscv64 -M virt -device guest-loader,addr=0x80400000,kernel=<...>,bootargs="<...>"

Emulated/Virtualized environment

  • Operating system: Linux
  • OS/kernel version: Linux 6.5.6
  • Architecture: RISC-V 64

Description of problem

In commit 49554856 the creation of FDT is moved to virt_machine_done() However, adding guest loader device requires the presence of fdt at hw/core/guest-loader.c:50 when the fdt ptr is still 0x0. Thus adding of guest loader device will fail.

Steps to reproduce

  1. Compile Qemu with riscv64 system emulator target
  2. Compile Xen hypervisor platform (not necessary)
  3. Instruct Qemu start with virt machine and any valid guest-loader device specification.

Additional information

Commit that changes order of fdt creation: 49554856

Edited by 许志轩
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information