All of lore.kernel.org
 help / color / mirror / Atom feed
* [wrynose][PATCH] qemuriscv.inc: use fw_dynamic.elf as BIOS when KERNEL_DEBUG is enabled
@ 2026-09-16 12:15 Harish.Sadineni
  2026-09-16 19:55 ` Trevor Gamblin
  0 siblings, 1 reply; 4+ messages in thread
From: Harish.Sadineni @ 2026-09-16 12:15 UTC (permalink / raw)
  To: openembedded-core; +Cc: Randy.MacLeod, Sundeep.Kokkonda, tgamblin

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 --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"
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [wrynose][PATCH] qemuriscv.inc: use fw_dynamic.elf as BIOS when KERNEL_DEBUG is enabled
  2026-09-16 12:15 [wrynose][PATCH] qemuriscv.inc: use fw_dynamic.elf as BIOS when KERNEL_DEBUG is enabled Harish.Sadineni
@ 2026-09-16 19:55 ` Trevor Gamblin
  2026-09-17  7:06   ` [OE-core] " Yoann Congal
  0 siblings, 1 reply; 4+ messages in thread
From: Trevor Gamblin @ 2026-09-16 19:55 UTC (permalink / raw)
  To: Harish.Sadineni, openembedded-core
  Cc: Randy.MacLeod, Sundeep.Kokkonda, tgamblin

On Wed Sep 16, 2026 at 8:15 AM EDT, Harish.Sadineni wrote:
> 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.

It'd be good to understand exactly why this doesn't work and what changed
upstream. I'm looking into it in a local checkout, but I probably won't have an
answer for a day or two.

Trevor
>
> [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 --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"




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OE-core] [wrynose][PATCH] qemuriscv.inc: use fw_dynamic.elf as BIOS when KERNEL_DEBUG is enabled
  2026-09-16 19:55 ` Trevor Gamblin
@ 2026-09-17  7:06   ` Yoann Congal
  2026-09-17 20:38     ` Trevor Gamblin
  0 siblings, 1 reply; 4+ messages in thread
From: Yoann Congal @ 2026-09-17  7:06 UTC (permalink / raw)
  To: tgamblin, Harish.Sadineni, openembedded-core
  Cc: Randy.MacLeod, Sundeep.Kokkonda

On Wed Sep 16, 2026 at 9:55 PM CEST, Trevor Gamblin via lists.openembedded.org wrote:
> On Wed Sep 16, 2026 at 8:15 AM EDT, Harish.Sadineni wrote:
>> 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.
>
> It'd be good to understand exactly why this doesn't work and what changed
> upstream. I'm looking into it in a local checkout, but I probably won't have an
> answer for a day or two.

Thanks Trevor!

Harish, this patch is for master isn't it?
If that's the case, would you mind resending it witout the [wrynose] tag
so it can be picked-up there?

Thanks!

>
> Trevor
>>
>> [YOCTO #16409]
FYI, I have not seen this specific error on wrynose (kernel 6.18).

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

Regards,
-- 
Yoann Congal
Smile ECS



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OE-core] [wrynose][PATCH] qemuriscv.inc: use fw_dynamic.elf as BIOS when KERNEL_DEBUG is enabled
  2026-09-17  7:06   ` [OE-core] " Yoann Congal
@ 2026-09-17 20:38     ` Trevor Gamblin
  0 siblings, 0 replies; 4+ messages in thread
From: Trevor Gamblin @ 2026-09-17 20:38 UTC (permalink / raw)
  To: Yoann Congal, tgamblin, Harish.Sadineni, openembedded-core
  Cc: Randy.MacLeod, Sundeep.Kokkonda

On Thu Sep 17, 2026 at 3:06 AM EDT, Yoann Congal wrote:
> On Wed Sep 16, 2026 at 9:55 PM CEST, Trevor Gamblin via lists.openembedded.org wrote:
>> On Wed Sep 16, 2026 at 8:15 AM EDT, Harish.Sadineni wrote:
>>> 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.
>>
>> It'd be good to understand exactly why this doesn't work and what changed
>> upstream. I'm looking into it in a local checkout, but I probably won't have an
>> answer for a day or two.
>
> Thanks Trevor!
>
> Harish, this patch is for master isn't it?
> If that's the case, would you mind resending it witout the [wrynose] tag
> so it can be picked-up there?

One of my colleagues recently ran into a similar issue working on meta-cheri,
and remedied it in the same way:

https://github.com/CHERI-Alliance/meta-cheri/commit/c81a323888357acc1ee244fbf8f23df4b1c1288b

I went and compared kernel image sizes across four configurations:

|6.18:
|
|lrwxrwxrwx. 2 tgamblin tgamblin  1M Sep 17 13:51 Image -> Image--6.18.52+git0+9e9d8b1f91_08edce0ecd-r0-qemuriscv64-20260917173344.bin
|-rw-r--r--. 2 tgamblin tgamblin 27M Sep 17 13:51 Image--6.18.52+git0+9e9d8b1f91_08edce0ecd-r0-qemuriscv64-20260917173344.bin
|
|6.18, KERNEL_DEBUG = "True":
|
|lrwxrwxrwx. 2 tgamblin tgamblin  1M Sep 17 14:08 Image -> Image--6.18.52+git0+9e9d8b1f91_08edce0ecd-r0-qemuriscv64-20260917180541.bin
|-rw-r--r--. 2 tgamblin tgamblin 33M Sep 17 14:08 Image--6.18.52+git0+9e9d8b1f91_08edce0ecd-r0-qemuriscv64-20260917180541.bin
|
|7.2:
|
|lrwxrwxrwx. 2 tgamblin tgamblin  1M Sep 17 14:33 Image -> Image--7.2.6+git0+b5d69636e3_d8a1ec518a-r0-qemuriscv64-20260917183100.bin
|-rw-r--r--. 2 tgamblin tgamblin 27M Sep 17 14:33 Image--7.2.6+git0+b5d69636e3_d8a1ec518a-r0-qemuriscv64-20260917183100.bin
|
|7.2, KERNEL_DEBUG = "True":
|
|lrwxrwxrwx. 2 tgamblin tgamblin  1M Sep 17 14:15 Image -> Image--7.2.6+git0+b5d69636e3_d8a1ec518a-r0-qemuriscv64-20260917181151.bin
|-rw-r--r--. 2 tgamblin tgamblin 33M Sep 17 14:15 Image--7.2.6+git0+b5d69636e3_d8a1ec518a-r0-qemuriscv64-20260917181151.bin

It's no surprise that turning on debug increases the image size, but it's a
little weird that 7.2 is fine when 6.18 isn't. My guess is that the content
where the FDT would overlap is different. I took the time to try a memory
dump from the QEMU monitor in the hanging case, and I could see the FDT magic
string where some kernel data should be:

1. Do 'runqemu nographic snapshot'
2. CTRL+A then 'c'
3. Do 'pmemsave 0x82200000 0x2000 dtb_dump.bin'
4. Inspect it like:

|tgamblin@megalith ~/workspace/ypbuilds/poky-qemuriscv64/build $ od -An -tx1 -N16 dtb_dump.bin
|d0 0d fe ed 00 00 35 ec 00 00 00 38 00 00 23 e8

'd0 0d fe ed' is in the kernel's scripts/dtc/libfdt/fdt.h:

|#define FDT_MAGIC       0xd00dfeed      /* 4: version, 4: total size */

The debug case (or other kernel customizations) may increase the kernel image
size to the point where we risk this overlap. I could dig a bit further, but I
think it's safer to use fw_dynamic.elf in general, starting with master. There
needs to be more info explaining why we did it though, both in the commit
message and as a comment near the change.
>
> Thanks!
>
>>
>> Trevor
>>>
>>> [YOCTO #16409]
> FYI, I have not seen this specific error on wrynose (kernel 6.18).
>
>>>
>>> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
>>> ---
>>>  meta/conf/machine/include/riscv/qemuriscv.inc | 5 ++++-
>>>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> Regards,




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-17 21:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-16 12:15 [wrynose][PATCH] qemuriscv.inc: use fw_dynamic.elf as BIOS when KERNEL_DEBUG is enabled Harish.Sadineni
2026-09-16 19:55 ` Trevor Gamblin
2026-09-17  7:06   ` [OE-core] " Yoann Congal
2026-09-17 20:38     ` Trevor Gamblin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.