aarch64 u-boot reset loop with qemu USB and KVM
Mikko Rapeli
mikko.rapeli at linaro.org
Mon Jun 2 13:24:22 CEST 2025
Hi,
On Mon, Jun 02, 2025 at 01:28:38PM +0300, Mikko Rapeli wrote:
> As was discussed over yocto/OE-Core mailing list
> https://lists.openembedded.org/g/openembedded-core/topic/113306017#msg217258
> qemu machine with USB and KVM enabled goes into reset loop with
> u-boot. I've tested u-boot 2025.04 and latest master branch 2025.07-rc3
> ( b22a276f039f818d5564bec6637071cfc8a7e432 ) with qemu_arm64_defconfig
> from tree and CONFIG_BLOBLIST disabled since that to has issues with KVM
> ( https://lists.denx.de/pipermail/u-boot/2025-May/590101.html )-
>
> To reproduce:
>
> * qemu 10 or 8.2.2, version does not seem to matter
>
> * aarch64 native machine with KVM support
>
> * qemu-system-aarch64 command line:
>
> $ qemu-system-aarch64 -machine virt -cpu host -machine gic-version=3 -smp 1 -enable-kvm \
> -m 256 -serial mon:stdio -serial null -nographic -vga none \
> -bios u-boot.bin \
> -device qemu-xhci -device usb-tablet -device usb-kbd
>
> U-Boot 2025.07-rc3 (May 30 2025 - 19:44:05 +0000)
>
> DRAM: 256 MiB
> using memory 0x4e662000-0x4f6a2000 for malloc()
> Core: 51 devices, 14 uclasses, devicetree: board
> Flash: 64 MiB
> Loading Environment from Flash... *** Warning - bad CRC, using default environment
>
> In: serial,usbkbd
> Out: serial,vidconsole
> Err: serial,vidconsole
> Register 8001040 NbrPorts 8
> Starting the controller
> "Synchronous Abort" handler, esr 0x96000010, far 0x10100040
> elr: 000000000005a360 lr : 000000000005a344 (reloc)
> elr: 000000004f6fc360 lr : 000000004f6fc344
> x0 : 0000000010100040 x1 : 0000000000000001
> x2 : 0000000000000000 x3 : 0000000000003e80
> x4 : 0000000000000038 x5 : 000000004e66fed2
> x6 : 0000000000000000 x7 : 0000000000000000
> x8 : 0000000000000000 x9 : 000000000001869f
> x10: 000000000000000d x11: 0000000000000006
> x12: 000000004e561a68 x13: 000000004e561dd0
> x14: 0000000000000002 x15: 0000000000000000
> x16: 000000004f6ee774 x17: 0000000000000000
> x18: 000000004e661dd0 x19: 000000004e670480
> x20: 0000000000000000 x21: 0000000010100040
> x22: 0000000010100000 x23: 0000000000000000
> x24: 0000000000000000 x25: 0000000000000000
> x26: 0000000000000000 x27: 0000000000000000
> x28: 0000000000000000 x29: 000000004e670360
>
> Code: d5033fbf aa1503e0 5287d003 52800002 (b8004401)
> Resetting CPU ...
>
> resetting ...
>
> With KVM disabled, or the qemu USB devices disabled, boot with u-boot prompt and
> to full target system works.
I've bisected this now and first breaking commit is:
05e2fa79310ab30dd3e3fe522333aef3cfb1c421 is the first bad commit
commit 05e2fa79310ab30dd3e3fe522333aef3cfb1c421
Author: Alper Nebi Yasak <alpernebiyasak at gmail.com>
Date: Mon Aug 14 20:39:43 2023 +0300
arm: qemu: Enable usb keyboard as an input device
Commit 02be57caf730 ("riscv: qemu: Enable usb keyboard as an input
device") adds PCI xHCI support to QEMU RISC-V virtual machines and
enables using a USB keyboard as one of the input devices. Similarly,
enable those for ARM virtual machines as well.
Signed-off-by: Alper Nebi Yasak <alpernebiyasak at gmail.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Bin Meng <bmeng at tinylab.org>
arch/arm/Kconfig | 5 +++++
board/emulation/qemu-arm/qemu-arm.c | 5 +++++
board/emulation/qemu-arm/qemu-arm.env | 2 +-
configs/qemu_arm64_defconfig | 2 --
configs/qemu_arm_defconfig | 2 --
doc/board/emulation/qemu-arm.rst | 4 ++++
6 files changed, 15 insertions(+), 5 deletions(-)
So looks like with KVM, CONFIG_USB=y triggers the reset loop.
Cheers,
-Mikko
More information about the U-Boot
mailing list