Bug 16150

Summary: AB-INT: oe-selftest-armhost: Failed to start QEMU (hangs with drm)
Product: [QA/Testing] Runtime Testing Reporter: Mathieu Dubois-Briand <mathieu.dubois-briand>
Component: oeqa/runtimeAssignee: Unassigned <unassigned>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Medium CC: kexin.hao, randy.macleod, richard.purdie, ross.burton, yoann.congal
Version: unspecified   
Target Milestone: 6.1   
Hardware: ARM   
OS: Multiple   
Whiteboard: AB-INT
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Mathieu Dubois-Briand 2026-01-26 15:10:15 UTC
We got this failure on master:

RuntimeError: core-image-minimal - FAILED to start qemu - check the task log and the boot log
...
WARNING: Target didn't reach login banner in 1000 seconds (01/26/26 01:56:02)
WARNING: Last 25 lines of login console (17587):
[    0.770309] pci 0000:00:01.0: BAR 1 [mem 0x10040000-0x10040fff]: assigned
[    0.770336] pci 0000:00:02.0: BAR 1 [mem 0x10041000-0x10041fff]: assigned
[    0.770355] pci 0000:00:03.0: BAR 1 [mem 0x10042000-0x10042fff]: assigned
[    0.770367] pci 0000:00:05.0: BAR 1 [mem 0x10043000-0x10043fff]: assigned
[    0.770379] pci 0000:00:06.0: BAR 1 [mem 0x10044000-0x10044fff]: assigned
[    0.770397] pci 0000:00:03.0: BAR 0 [io  0x1000-0x107f]: assigned
[    0.770412] pci 0000:00:05.0: BAR 0 [io  0x1080-0x10bf]: assigned
[    0.770430] pci 0000:00:01.0: BAR 0 [io  0x10c0-0x10df]: assigned
[    0.770440] pci 0000:00:02.0: BAR 0 [io  0x10e0-0x10ff]: assigned
[    0.770453] pci_bus 0000:00: resource 4 [io  0x0000-0xffff]
[    0.770456] pci_bus 0000:00: resource 5 [mem 0x10000000-0x3efeffff]
[    0.770457] pci_bus 0000:00: resource 6 [mem 0x8000000000-0xffffffffff]
[    0.770488] pci 0000:00:04.0: enabling device (0000 -> 0002)
[    0.772410] virtio-pci 0000:00:01.0: enabling device (0000 -> 0003)
[    0.775087] virtio-pci 0000:00:02.0: enabling device (0000 -> 0003)
[    0.777370] virtio-pci 0000:00:03.0: enabling device (0000 -> 0003)
[    0.779704] virtio-pci 0000:00:05.0: enabling device (0000 -> 0003)
[    0.784075] virtio-pci 0000:00:06.0: enabling device (0000 -> 0002)
[    0.826674] [drm] pci: virtio-gpu-pci detected at 0000:00:06.0
[    0.827030] [drm] features: -virgl +edid -resource_blob -host_visible
[    0.827033] [drm] features: -context_init
[    0.828017] [drm] number of scanouts: 1
[    0.828023] [drm] number of cap sets: 0
[    0.844502] [drm] Initialized virtio_gpu 0.1.0 for 0000:00:06.0 on minor 0
[    0.881866] Console: switching to colour frame buffer device 160x50

Note, we had a similar error a few months ago, that was linked with qemu upgrade:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=16001
Comment 1 Mathieu Dubois-Briand 2026-01-26 15:28:58 UTC
oe-selftest-armhost ubuntu2504-vk-arm1 master completed at 2026-01-26 02:48:56+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/3221/steps/15/logs/stdio
Comment 2 Randy MacLeod 2026-01-29 15:37:42 UTC
Richard checked the logs after this occurred but didn't find anything useful.
Comment 3 Mathieu Dubois-Briand 2026-02-27 11:05:33 UTC
qemuarm64-ptest ubuntu2204-vk-arm2 master completed at 2026-02-27 10:42:08+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/61/builds/3131/steps/13/logs/stdio
Comment 5 Richard Purdie 2026-02-27 11:09:21 UTC
One note is that there is no corresponding qemu_boot_log.20260227100156
That serial port seems to only have data after console init.

https://valkyrie.yocto.io/pub/shared-failure-data/16150-success/ contains output from a successful ptest run from the same build for comparison
Comment 6 Richard Purdie 2026-02-27 11:12:07 UTC
Interestingly, one log has "printk: legacy console [hvc0] enabled", the other does not
Comment 7 Richard Purdie 2026-02-27 12:51:20 UTC
Since I was curious, I tried this:

Index: printk/printk.c
===================================================================
--- a/kernel/printk.orig/printk.c
+++ b/kernel/printk/printk.c
@@ -3979,6 +3979,9 @@ void register_console(struct console *ne
 	u64 init_seq;
 	int err;
 
+	if (strcmp(newcon->name, "hvc") == 0)
+		mdelay(500);
+
 	console_list_lock();
 
 	for_each_console(con) {

which did change the logs to look like:

[    0.691950] virtio-pci 0000:00:05.0: enabling device (0000 -> 0003)
[    0.693791] virtio-pci 0000:00:06.0: enabling device (0000 -> 0002)
[    0.762657] [drm] pci: virtio-gpu-pci detected at 0000:00:06.0
[    0.763553] [drm] features: -virgl +edid -resource_blob -host_visible
[    0.763557] [drm] features: -context_init
[    0.766006] [drm] number of scanouts: 1
[    0.766028] [drm] number of cap sets: 0
[    1.261454] printk: legacy console [hvc0] enabled
[    1.261948] [drm] Initialized virtio_gpu 0.1.0 for 0000:00:06.0 on minor 0
[    1.268542] Console: switching to colour frame buffer device 160x50
[    1.273368] virtio-pci 0000:00:06.0: [drm] fb0: virtio_gpudrmfb frame buffer device
[    1.278279] brd: module loaded
[    1.278859] virtio_blk virtio2: 4/0/0 default/read/poll queues

so I was able to delay the console line to after most of the drm lines but now the virtio_gpu line and not the console switching
Comment 8 Richard Purdie 2026-02-27 13:23:04 UTC
I was pointed at:

https://www.kernel.org/doc/Documentation/admin-guide/serial-console.rst

"""
The behavior is more complicated when the same device type is defined more
times. In this case, there are the following two rules:

1. The output will appear only on the first device of each defined type.

2. ``/dev/console`` will be associated with the first registered device.
   Where the registration order depends on how kernel initializes various
   subsystems.
"""

so is /dev/console sometimes going somewhere else? Would that explain the "hang"?
Comment 9 Richard Purdie 2026-02-27 17:35:11 UTC
To try and rule out ordering completely, I deferred the hvc console init by patching:

Index: drivers/tty/hvc/hvc_console.c
===================================================================
--- a/drivers/tty/hvc/hvc_console.c
+++ b/drivers/tty/hvc/hvc_console.c
@@ -243,7 +243,7 @@ static int __init hvc_console_init(void)
        register_console(&hvc_console);
        return 0;
 }
-console_initcall(hvc_console_init);
+late_initcall(hvc_console_init);
 
 /* callback when the kboject ref count reaches zero. */
 static void hvc_port_destruct(struct tty_port *po

This did move the printk line much later in the boot but didn't reproduce the "hang". It seems there is therefore something else going on here...
Comment 10 Mathieu Dubois-Briand 2026-03-23 08:55:25 UTC
pkgman-non-rpm debian12-vk-7 master&master-next completed at 2026-03-19 16:10:23+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/67/builds/3445/steps/19/logs/stdio
Comment 11 Mathieu Dubois-Briand 2026-03-27 09:53:49 UTC
qemuarm-tc debian12-vk-9 master-next completed at 2026-03-26 19:24:51+00:00
https://valkyrie.yocto.io/pub/non-release/20260326-108/testresults/qemuarm-tc/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/42/builds/3415/steps/13/logs/stdio
Comment 12 Mathieu Dubois-Briand 2026-04-03 08:14:24 UTC
qemuarm64-musl-ptest ubuntu2504-vk-arm1 master-next completed at 2026-04-02 11:01:54+00:00
https://valkyrie.yocto.io/pub/non-release/20260402-63/testresults/qemuarm64-musl-ptest/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/109/builds/204/steps/13/logs/stdio
Comment 13 Mathieu Dubois-Briand 2026-04-07 08:45:36 UTC
qemuarm-alt ubuntu2510-vk-1 master-next completed at 2026-04-04 00:04:53+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/74/builds/3496/steps/15/logs/stdio
Comment 14 Mathieu Dubois-Briand 2026-04-15 13:29:07 UTC
oe-selftest-armhost ubuntu2404-vk-arm1 mathieu/master-next completed at 2026-04-14 19:33:19+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/3762/steps/15/logs/stdio
Comment 15 Randy MacLeod 2026-04-15 15:24:04 UTC
A BSP-ish issue, CCing Kexin from our BSP team who -may be able- to find time to work on this.
Comment 16 Yoann Congal 2026-04-17 08:13:41 UTC
qemuarm64-ptest ubuntu2404-vk-arm1 whinlatter completed at 2026-04-17 02:24:36+00:00
https://autobuilder.yoctoproject.org/valkyrie/?#/builders/61/builds/3503
Comment 17 Mathieu Dubois-Briand 2026-04-24 06:54:17 UTC
qemuarm64-ptest ubuntu2404-vk-arm1 master completed at 2026-04-24 02:07:47+00:00
https://valkyrie.yocto.io/pub/non-release/20260424-8/testresults/qemuarm64-ptest/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/61/builds/3554/steps/13/logs/stdio
Comment 18 Mathieu Dubois-Briand 2026-05-05 07:59:46 UTC
qemuarm-alt debian12-vk-9 mathieu/master-next completed at 2026-05-05 07:23:33+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/74/builds/3677/steps/14/logs/stdio
Comment 19 Mathieu Dubois-Briand 2026-05-26 08:56:10 UTC
oe-selftest-armhost ubuntu2404-vk-arm1 master&master-next completed at 2026-05-19 07:15:33+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/3968/steps/15/logs/stdio
Comment 20 Randy MacLeod 2026-05-28 13:16:30 UTC
Bulk move of 6.0 Medium bugs to 6.1.
Comment 21 Mathieu Dubois-Briand 2026-06-05 08:15:30 UTC
qemuarm64-musl-ptest ubuntu2404-vk-arm2 master&master-next completed at 2026-06-04 00:51:57+00:00
https://valkyrie.yocto.io/pub/non-release/20260603-116/testresults/qemuarm64-musl-ptest/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/109/builds/494/steps/13/logs/stdio
Comment 22 Mathieu Dubois-Briand 2026-06-25 10:23:41 UTC
qemuarm debian12-vk-7 mathieu/master-next completed at 2026-06-24 08:54:32+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/16/builds/4026/steps/14/logs/stdio
Comment 23 Mathieu Dubois-Briand 2026-06-29 08:29:58 UTC
oe-selftest-armhost ubuntu2404-vk-arm1 master&mathieu/master-next completed at 2026-06-26 12:15:05+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/4208/steps/15/logs/stdio
Comment 24 Mathieu Dubois-Briand 2026-07-01 16:18:22 UTC
qemuarm-oecore debian11-vk-3 master completed at 2026-06-30 11:54:53+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/40/builds/4015/steps/13/logs/stdio
Comment 25 Mathieu Dubois-Briand 2026-07-09 15:39:17 UTC
oe-selftest-armhost ubuntu2404-vk-arm2 mathieu/master-next completed at 2026-07-08 19:41:22+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/4306/steps/15/logs/stdio
Comment 26 Mathieu Dubois-Briand 2026-07-22 15:08:55 UTC
qemuarm64-ptest ubuntu2404-vk-arm1 master-next completed at 2026-07-21 17:23:03+00:00
https://valkyrie.yocto.io/pub/non-release/20260721-84/testresults/qemuarm64-ptest/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/61/builds/4066/steps/13/logs/stdio