<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>15872</bug_id>
          
          <creation_ts>2025-05-21 12:49:57 +0000</creation_ts>
          <short_desc>genericarm64/aarch64/qemuarm64 u-boot hangs with kvm</short_desc>
          <delta_ts>2025-06-05 14:21:56 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BSPs</product>
          <component>bsps-meta-yocto</component>
          <version>5.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.3 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mikko Rapeli">mikko.rapeli</reporter>
          <assigned_to name="Mikko Rapeli">mikko.rapeli</assigned_to>
          <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
    
    <cc>yoann.congal</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>Regression (Used to work)</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>102017</commentid>
    <comment_count>0</comment_count>
    <who name="Mikko Rapeli">mikko.rapeli</who>
    <bug_when>2025-05-21 12:49:57 +0000</bug_when>
    <thetext>On a aarch64/arm64 build host where kvm is supported and working:

$ cat /etc/os-release 
PRETTY_NAME=&quot;Ubuntu 24.04 LTS&quot;
NAME=&quot;Ubuntu&quot;
VERSION_ID=&quot;24.04&quot;
VERSION=&quot;24.04 LTS (Noble Numbat)&quot;
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL=&quot;https://www.ubuntu.com/&quot;
SUPPORT_URL=&quot;https://help.ubuntu.com/&quot;
BUG_REPORT_URL=&quot;https://bugs.launchpad.net/ubuntu/&quot;
PRIVACY_POLICY_URL=&quot;https://www.ubuntu.com/legal/terms-and-policies/privacy-policy&quot;
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

$ kvm-ok 
INFO: /dev/kvm exists
KVM acceleration can be used

build genericarm64 machine image core-image-base and u-boot:

$ bitbake core-image-base u-boot

Run the image with qemu and kvm which boots via u-boot but hangs:

$ runqemu slirp nographic novga snapshot kvm
runqemu - INFO - Running bitbake -e  ...
runqemu - INFO - Continuing with the following parameters:
KERNEL: []
BIOS: [/home/mcfrisk/src/base/repo/poky/build_genericarm64/tmp/deploy/images/genericarm64/u-boot.bin]
MACHINE: [genericarm64]
FSTYPE: [wic (no-kernel-in-fs)]
ROOTFS: [/home/mcfrisk/src/base/repo/poky/build_genericarm64/tmp/deploy/images/genericarm64/core-image-base-genericarm64.rootfs-20250521112852.wic]
CONFFILE: [/home/mcfrisk/src/base/repo/poky/build_genericarm64/tmp/deploy/images/genericarm64/core-image-base-genericarm64.rootfs-20250521112852.qemuboot.conf]

runqemu - INFO - Network configuration: ip=dhcp
runqemu - INFO - Port forward: hostfwd=tcp:127.0.0.1:2222-:22 hostfwd=tcp:127.0.0.1:2323-:23
runqemu - INFO - Running /home/mcfrisk/src/base/repo/poky/build_genericarm64/tmp/work/aarch64-linux/qemu-helper-native/1.0/recipe-sysroot-native/usr/bin/qemu-system-aarch64 -device virtio-net-pci,netdev=net0,mac=52:54:00:12:35:02 -netdev user,id=net0,hostfwd=tcp:127.0.0.1:2222-:22,hostfwd=tcp:127.0.0.1:2323-:23,tftp=/home/mcfrisk/src/base/repo/poky/build_genericarm64/tmp/deploy/images/genericarm64 -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 -drive id=root,file=/home/mcfrisk/src/base/repo/poky/build_genericarm64/tmp/deploy/images/genericarm64/core-image-base-genericarm64.rootfs-20250521112852.wic,if=none,format=raw -device virtio-blk-pci,drive=root   -machine virt -cpu host -machine gic-version=3 -smp 4 -enable-kvm -m 256 -snapshot -serial mon:stdio -serial null -nographic -vga none -bios /home/mcfrisk/src/base/repo/poky/build_genericarm64/tmp/deploy/images/genericarm64/u-boot.bin

runqemu - INFO - Host uptime: 15741092.71

The boot hangs here. Using ctrl-a-c to access qemu debug console works and the emulation can be stopped.

Root cause was traced by ilias.apalodimas@linaro.org to u-boot commit 53d5a221632e  &quot;emulation: Use bloblist to hold tables&quot; and was reported upstream in https://lists.denx.de/pipermail/u-boot/2025-May/590103.html

Revert is tricky but a config change is enough to fix this:

--- a/configs/qemu_arm64_defconfig
+++ b/configs/qemu_arm64_defconfig
@@ -2,7 +2,6 @@ CONFIG_ARM=y
 CONFIG_POSITION_INDEPENDENT=y
 CONFIG_ARCH_QEMU=y
 CONFIG_SYS_MALLOC_LEN=0x1000000
-CONFIG_BLOBLIST_SIZE_RELOC=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x40200000
 CONFIG_ENV_SIZE=0x40000
@@ -27,7 +26,7 @@ CONFIG_USE_PREBOOT=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_PCI_INIT_R=y
-CONFIG_BLOBLIST=y
+# CONFIG_BLOBLIST is not set
 CONFIG_CMD_SMBIOS=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_BOOTEFI_SELFTEST=y

I think we should improve the testing in oe-core to cover this, but there is a hard dependency on build/test machines to have working kvm also on aarch64/arm64.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102018</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2025-05-21 12:54:04 +0000</bug_when>
    <thetext>Our selftest-armhost run will only run on Altras now, so we should be able to enable KVM in that build run which might be sufficient.

Alternatively, add qemuarm64-armhost to explicitly test with KVM enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102019</commentid>
    <comment_count>2</comment_count>
    <who name="Mikko Rapeli">mikko.rapeli</who>
    <bug_when>2025-05-21 13:53:13 +0000</bug_when>
    <thetext>Fix/workaround in https://lists.openembedded.org/g/openembedded-core/message/217030</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102024</commentid>
    <comment_count>3</comment_count>
    <who name="Kevin Hao">kexin.hao</who>
    <bug_when>2025-05-22 07:24:57 +0000</bug_when>
    <thetext>@Mikko, it looks like you&apos;ve already created a patch to fix this issue. Is there anything else I need to do on my side? Also, should I update the bug to assign it to you?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102025</commentid>
    <comment_count>4</comment_count>
    <who name="Mikko Rapeli">mikko.rapeli</who>
    <bug_when>2025-05-22 07:28:35 +0000</bug_when>
    <thetext>I&apos;ll try to fix this. Also thinking about adding a test case. KVM boot to qemu and kernel is tested vi selftests, but u-boot apparently not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102060</commentid>
    <comment_count>5</comment_count>
    <who name="Mikko Rapeli">mikko.rapeli</who>
    <bug_when>2025-05-23 09:20:21 +0000</bug_when>
    <thetext>v3 of workaround/fix and selftest to test this feature submitted to review:

https://lists.openembedded.org/g/openembedded-core/message/217105
https://lists.openembedded.org/g/openembedded-core/message/217106
https://lists.openembedded.org/g/openembedded-core/message/217107</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102143</commentid>
    <comment_count>6</comment_count>
    <who name="Mikko Rapeli">mikko.rapeli</who>
    <bug_when>2025-06-05 14:21:56 +0000</bug_when>
    <thetext>Workarounds and selftest merged to poky master branch now.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>