risc-v: 0.968 hypervisor: 0.963 architecture: 0.933 graphic: 0.922 virtual: 0.887 kernel: 0.884 network: 0.859 performance: 0.856 PID: 0.855 debug: 0.837 device: 0.837 semantic: 0.832 register: 0.830 vnc: 0.818 mistranslation: 0.783 socket: 0.781 files: 0.757 arm: 0.746 permissions: 0.744 boot: 0.706 ppc: 0.695 VMM: 0.687 assembly: 0.663 peripherals: 0.662 TCG: 0.635 x86: 0.540 user-level: 0.496 KVM: 0.487 i386: 0.360 RISC-V 64 System Emulator fdt imporperly created after machine init is done 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: 49554856f0b6f622ab6afdcc275d4ab2ecb3625c