riscv: v2025.10-rc2 fails on QEMU with "Failed to reserve memory for fdt"
Vivian Wang
wangruikang at iscas.ac.cn
Tue Aug 12 17:17:42 CEST 2025
Hi,
On QEMU 10.0.2 (NixOS unstable), U-Boot v2025.10-rc2 with
qemu-riscv64_smode_defconfig fails to boot a loaded kernel, with a
"Failed to reserve memory for fdt" error. Explicitly loading an FDT
seems to fix this, so this looks like a problem with reusing the boot FDT.
My steps are:
mkdir -p vmshare/extlinux
echo 'label 0' > vmshare/extlinux/extlinux.conf
echo ' linux /Image' >> vmshare/extlinux/extlinux.conf
cp .../Image vmshare/ # Grab a Linux kernel
qemu-system-riscv64 -m 1G -M virt -nographic -kernel u-boot.bin \
-drive file=fat:ro:vmshare,format=raw,read-only=on
Resulting in:
Device 0: 1af4 VirtIO Block Device
Type: Hard Disk
Capacity: 504.0 MB = 0.4 GB (1032192 x 512)
... is now current device
Scanning virtio 0:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
1: 0
Retrieving file: /Image
Moving Image from 0x84000000 to 0x80200000, end=0x81e88000
## Flattened Device Tree blob at bee8f640
Booting using the fdt blob at 0xbee8f640
Working FDT set to bee8f640
Failed to reserve memory for fdt at 0xbee8f640
FDT creation failed! hanging...### ERROR ### Please RESET the board ###
(See bottom for full output including OpenSBI)
The same steps succeeds with U-Boot 2025.07, so this appears to be a
regression. I haven't yet done a bisection or any (successful)
debugging, but this check seems to be added in [1].
Sughosh Ganu: This message seems to be added by [1]. Do you have any idea?
Vivian "dramforever" Wang
[1]:
https://lore.kernel.org/u-boot/20250617104346.1379981-1-sughosh.ganu@linaro.org/
Full log output:
OpenSBI v1.5.1
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|____/_____|
| |
|_|
Platform Name : riscv-virtio,qemu
Platform Features : medeleg
Platform HART Count : 1
Platform IPI Device : aclint-mswi
Platform Timer Device : aclint-mtimer @ 10000000Hz
Platform Console Device : uart8250
Platform HSM Device : ---
Platform PMU Device : ---
Platform Reboot Device : syscon-reboot
Platform Shutdown Device : syscon-poweroff
Platform Suspend Device : ---
Platform CPPC Device : ---
Firmware Base : 0x80000000
Firmware Size : 327 KB
Firmware RW Offset : 0x40000
Firmware RW Size : 71 KB
Firmware Heap Offset : 0x49000
Firmware Heap Size : 35 KB (total), 2 KB (reserved), 11 KB (used), 21 KB (free)
Firmware Scratch Size : 4096 B (total), 416 B (used), 3680 B (free)
Runtime SBI Version : 2.0
Domain0 Name : root
Domain0 Boot HART : 0
Domain0 HARTs : 0*
Domain0 Region00 : 0x0000000000100000-0x0000000000100fff M: (I,R,W) S/U: (R,W)
Domain0 Region01 : 0x0000000010000000-0x0000000010000fff M: (I,R,W) S/U: (R,W)
Domain0 Region02 : 0x0000000002000000-0x000000000200ffff M: (I,R,W) S/U: ()
Domain0 Region03 : 0x0000000080040000-0x000000008005ffff M: (R,W) S/U: ()
Domain0 Region04 : 0x0000000080000000-0x000000008003ffff M: (R,X) S/U: ()
Domain0 Region05 : 0x000000000c400000-0x000000000c5fffff M: (I,R,W) S/U: (R,W)
Domain0 Region06 : 0x000000000c000000-0x000000000c3fffff M: (I,R,W) S/U: (R,W)
Domain0 Region07 : 0x0000000000000000-0xffffffffffffffff M: () S/U: (R,W,X)
Domain0 Next Address : 0x0000000080200000
Domain0 Next Arg1 : 0x00000000bfe00000
Domain0 Next Mode : S-mode
Domain0 SysReset : yes
Domain0 SysSuspend : yes
Boot HART ID : 0
Boot HART Domain : root
Boot HART Priv Version : v1.12
Boot HART Base ISA : rv64imafdch
Boot HART ISA Extensions : sstc,zicntr,zihpm,zicboz,zicbom,sdtrig,svadu
Boot HART PMP Count : 16
Boot HART PMP Granularity : 2 bits
Boot HART PMP Address Bits: 54
Boot HART MHPM Info : 16 (0x0007fff8)
Boot HART Debug Triggers : 2 triggers
Boot HART MIDELEG : 0x0000000000001666
Boot HART MEDELEG : 0x0000000000f0b509
U-Boot 2025.10-rc2 (Jan 01 1980 - 00:00:00 +0000)
CPU: riscv
Model: riscv-virtio,qemu
DRAM: 1 GiB
using memory 0xbee91000-0xbf6b1000 for malloc()
Core: 27 devices, 14 uclasses, devicetree: board
Flash: 32 MiB
Loading Environment from nowhere... OK
In: serial,usbkbd
Out: serial,vidconsole
Err: serial,vidconsole
No USB controllers found
Net: No ethernet found.
Working FDT set to bee8f640
Hit any key to stop autoboot: 0
Device 0: unknown device
Device 0: 1af4 VirtIO Block Device
Type: Hard Disk
Capacity: 504.0 MB = 0.4 GB (1032192 x 512)
... is now current device
Scanning virtio 0:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
1: 0
Retrieving file: /Image
Moving Image from 0x84000000 to 0x80200000, end=0x81e88000
## Flattened Device Tree blob at bee8f640
Booting using the fdt blob at 0xbee8f640
Working FDT set to bee8f640
Failed to reserve memory for fdt at 0xbee8f640
FDT creation failed! hanging...### ERROR ### Please RESET the board ###
More information about the U-Boot
mailing list