diff mbox series

[wrynose] qemuriscv.inc: use fw_dynamic.elf as BIOS when KERNEL_DEBUG is enabled

Message ID 20260916121517.1513695-1-Harish.Sadineni@windriver.com
State New
Delegated to: Yoann Congal
Headers show
Series [wrynose] qemuriscv.inc: use fw_dynamic.elf as BIOS when KERNEL_DEBUG is enabled | expand

Commit Message

Harish Sadineni Sept. 16, 2026, 12:15 p.m. UTC
From: Harish Sadineni <Harish.Sadineni@windriver.com>

QEMU RISC-V hangs (qemu hang-up) when using fw_jump.elf as the
default BIOS while kernel debugging is enabled. This has been
observed with the 6.18 kernel (exact version where it was
introduced is not known).

As a workaround, switch to fw_dynamic.elf when KERNEL_DEBUG is
enabled, which avoids the hang and works correctly with debug
builds. The default behaviour is unchanged and continues to use
fw_jump.elf when KERNEL_DEBUG is not set.

[YOCTO #16409]

Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
 meta/conf/machine/include/riscv/qemuriscv.inc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/conf/machine/include/riscv/qemuriscv.inc b/meta/conf/machine/include/riscv/qemuriscv.inc
index bac376ce5a..6e7d4a8adf 100644
--- a/meta/conf/machine/include/riscv/qemuriscv.inc
+++ b/meta/conf/machine/include/riscv/qemuriscv.inc
@@ -29,7 +29,10 @@  QB_SMP ?= "-smp 4"
 QB_KERNEL_CMDLINE_APPEND = "earlycon=sbi"
 QB_CPU:riscv64 ?= "-cpu rva23s64,pmp=true"
 QB_MACHINE = "-machine virt"
-QB_DEFAULT_BIOS = "fw_jump.elf"
+# Workaround: fw_jump.elf causes QEMU RISC-V to hang when KERNEL_DEBUG
+# is enabled, use fw_dynamic.elf in that case instead.
+# See https://bugzilla.yoctoproject.org/show_bug.cgi?id=16409 for more details.
+QB_DEFAULT_BIOS = "${@bb.utils.contains('KERNEL_DEBUG', 'True', 'fw_dynamic.elf', 'fw_jump.elf', d)}"
 QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
 QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@"
 QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0"