USB Controller Initialization Error

I was testing the usb_hid_raw application from the Genode 26.05 release on an HP ProDesk 600 G1 hardware platform. The following error occurs during USB controller initialization:

[init -> usb -> usb] Error: INVALID RPC: sigh
[init -> usb -> usb] Error: attempt of IPC call to an invalid object

To investigate the issue in more detail, I reproduced the same problem in QEMU using the following command:

sudo qemu-system-x86_64 \
  -display sdl \
  -device nec-usb-xhci,id=xhci0 \
  -device usb-mouse,bus=xhci0.0 \
  -serial mon:stdio \
  -m 800 \
  -drive format=raw,file=build/x86_64/var/run/usb_hid_raw.img \
  -machine q35 \
  -cpu Skylake-Client \
  -net nic,model=e1000,netdev=net0 \
  -netdev user,id=net0 \
  -device ich9-usb-ehci1,id=ehci

However, the issue does not occur under either of the following conditions:

  1. Changing the EHCI PCI address by explicitly assigning it to addr=0x5:
-device ich9-usb-ehci1,id=ehci,addr=0x5
  1. Initializing the EHCI controller before the xHCI controller.

In both cases, usb_hid_raw starts and operates correctly.

This suggests that the issue may be related to the PCI address/BDF assignment or the initialization order of the xHCI and EHCI USB controllers.

Hi hamed,

I can reproduce this issue, thanks to your Qemu line and description. The problem is more related to the innovations of release 26.05 with respect to MSI and MSI-x support. Within the Linux emulation environment accidentally the GSI number 11 was tried to open for the EHCI controller as well as the XHCI controller (both controller share the same line here), although the XHCI controler was already using the device in MSI fashion. Resulting side-effect was an invalid interrupt capability returned to the Linux emulation layer that was used to register a signal handler, which resulted in the fault you have seen.
I’ve opened an issue in our issue tracker and provided a patch there.
Thank you for your report!

Hi Stefan,

Thanks for the patch. I applied it to my 26.05 tree and can confirm that the problem is solved. The USB controllers now initialize correctly, and the USB mouse works as expected.

Thanks for fixing the issue!