From: "Trevor Gamblin" <tgamblin@baylibre.com>
To: "Yoann Congal" <yoann.congal@smile.fr>, <tgamblin@baylibre.com>,
<Harish.Sadineni@windriver.com>,
<openembedded-core@lists.openembedded.org>
Cc: <Randy.MacLeod@windriver.com>, <Sundeep.Kokkonda@windriver.com>
Subject: Re: [OE-core] [wrynose][PATCH] qemuriscv.inc: use fw_dynamic.elf as BIOS when KERNEL_DEBUG is enabled
Date: Thu, 17 Sep 2026 16:38:33 -0400 [thread overview]
Message-ID: <DLHVQBRWWOF1.2PKU3CWY21S6J@baylibre.com> (raw)
In-Reply-To: <DLHEG7H935N8.2JKMAZRCTBS17@smile.fr>
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,
prev parent reply other threads:[~2026-09-17 21:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DLHVQBRWWOF1.2PKU3CWY21S6J@baylibre.com \
--to=tgamblin@baylibre.com \
--cc=Harish.Sadineni@windriver.com \
--cc=Randy.MacLeod@windriver.com \
--cc=Sundeep.Kokkonda@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=yoann.congal@smile.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.