U-Boot qemu_arm64_defconfig crashes under KVM

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Oct 9 08:35:17 CEST 2024


Hi,

This is a heads up that the U-Boot image generated by qemu_arm64_defconfig
crashes during xhci-pci probe when running under KVM on a native ARM host:

  Bus xhci_pci: Register 8001040 NbrPorts 8
  Starting the controller
  "Synchronous Abort" handler, esr 0x96000010, far 0x10090040
  elr: 0000000000055114 lr : 00000000000550f8 (reloc)
  elr: 000000004f724114 lr : 000000004f7240f8
  x0 : 0000000010090040 x1 : 0000000000000001
  x2 : 0000000000000000 x3 : 0000000000003e80
  x4 : 0000000000000038 x5 : 000000004e58e7a2
  x6 : 0000000000000000 x7 : 0000000000000000
  x8 : 000000004e58ec30 x9 : 00000000ffffffd8
  x10: 000000000000000d x11: 0000000000000006
  x12: 000000004e58ea88 x13: 000000004e58ed90
  x14: 0000000000000000 x15: 000000004e58e7a2
  x16: 000000004f716d84 x17: 0000000000000000
  x18: 000000004e68ed90 x19: 000000004e695b00
  x20: 0000000000000000 x21: 0000000010090040
  x22: 0000000010090000 x23: 000000004f79553c
  x24: 0000000000000000 x25: 0000000000000000

This was noticed by a patch series[1] for OpenEmbedded-core that added
simple "Do barebox and U-Boot reach their shell?" tests.

After investigation and help from the Qemu/KVM maintainers[2], it turns
out that this is a known quirk: software that wants to run under KVM
needs to take care what instructions it uses for MMIO accesses.

Linux doesn't suffer from this issue, because it implements readl/writel
in assembly and makes sure they use KVM-friendly instructions.

I'll suggest on the OE-core mailing list that the bootloader tests
should be conducted with KVM disabled.

Nevertheless, running barebox under KVM alerted me to some issues that
exist outside of KVM too, so I prepared a series that enables barebox
to run under KVM[3].

I thought to mention that here in case someone is interested in getting
U-Boot to work under KVM as well. Also feel free to backport any other
barebox goodies along the way. :-)

[1]: https://lore.kernel.org/all/b77f2c6737c330ef9ecce325d50a4aaa25b3e536.camel@linuxfoundation.org
[2]: https://lore.kernel.org/all/89f184d6-5b61-4c77-9f3b-c0a8f6a75d60@pengutronix.de
[3]: https://lore.kernel.org/barebox/20241009060511.4121157-5-a.fatoum@pengutronix.de

Cheers,
Ahmad

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the U-Boot mailing list