Usb passthrough of devices plugged to AMD FCH USB OHCI Controller failing on q35.

Bug #1505759 reported by José Pekkarinen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Invalid
Undecided
Unassigned

Bug Description

I'm trying to setup a q35 vm with windows 7 guest for vga passthrough. The machine works well for this purpose, but the usb devices passed to the vm does not. I receive the following errors on screen:

qemu-system-x86_64: libusb_release_interface: -4 [NO_DEVICE]
libusb: error [_open_sysfs_attr} open
/sys/bus/usb/devices/3-5/bConfigurationValue failed ret=-1 errno=2
qemu-system-x86_64: libusb_release_interface: -4 [NO_DEVICE]
libusb: error [_open_sysfs_attr} open
/sys/bus/usb/devices/4-1/bConfigurationValue failed ret=-1 errno=2
Disabling IRQ #18
Disabling IRQ #17

And from the system log I can see the following:

Oct 13 20:13:25 koalita kernel: vfio-pci 0000:01:00.1: enabling device (0400 -> 0402)
Oct 13 20:13:29 koalita kernel: usb 3-5: reset low-speed USB device number 2 using ohci-pci
Oct 13 20:13:30 koalita kernel: usb 4-1: reset low-speed USB device number 2 using ohci-pci
Oct 13 20:13:30 koalita kernel: usb 10-2: reset low-speed USB device number 2 using xhci_hcd
Oct 13 20:13:31 koalita kernel: usb 10-2: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
Oct 13 20:13:31 koalita kernel: usb 10-2: ep 0x1 - rounding interval to 64 microframes, ep desc says 80 microframes
Oct 13 20:13:31 koalita kernel: usb 3-5: reset low-speed USB device number 2 using ohci-pci
Oct 13 20:13:31 koalita kernel: usb 10-2: reset low-speed USB device number 2 using xhci_hcd
Oct 13 20:13:32 koalita kernel: usb 10-2: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
Oct 13 20:13:32 koalita kernel: usb 10-2: ep 0x1 - rounding interval to 64 microframes, ep desc says 80 microframes
Oct 13 20:13:32 koalita kernel: usb 4-1: reset low-speed USB device number 2 using ohci-pci
Oct 13 20:13:33 koalita kernel: usb 3-5: reset low-speed USB device number 2 using ohci-pci
Oct 13 20:13:33 koalita kernel: usb 4-1: reset low-speed USB device number 2 using ohci-pci
Oct 13 20:13:34 koalita kernel: usb 3-5: reset low-speed USB device number 2 using ohci-pci
Oct 13 20:13:34 koalita kernel: usb 10-2: reset low-speed USB device number 2 using xhci_hcd
Oct 13 20:13:35 koalita kernel: usb 10-2: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
Oct 13 20:13:35 koalita kernel: usb 10-2: ep 0x1 - rounding interval to 64 microframes, ep desc says 80 microframes
Oct 13 20:13:35 koalita kernel: usb 10-2: reset low-speed USB device number 2 using xhci_hcd
Oct 13 20:13:35 koalita kernel: usb 10-2: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
Oct 13 20:13:35 koalita kernel: usb 10-2: ep 0x1 - rounding interval to 64 microframes, ep desc says 80 microframes

I tried to any combination of usb devices, and even disabling the ICH9 usb devices to make the setup looks close to the 440fx machine that is working for me.

Version of qemu is 2.2.1(all newer versions fails on usb passthrough, even in 440fx machines), and kernel is 4.1.8.

The script to launch it is the following:

qemu-system-x86_64 -enable-kvm -M q35 -vga none -cpu host -smp 3,cores=3,threads=1 -m 6144 \
        -L /usr/x86_64-pc-linux-gnu/usr/share/qemu \
        -nodefaults -nodefconfig \
        -device ioh3420,multifunction=on,id=pcie \
        -device vfio-pci,host=01:00.0,addr=1c.0,x-vga=on,multifunction=on,bus=pcie \
        -device vfio-pci,host=01:00.1,addr=1c.1,bus=pcie \
        -netdev user,id=user.0 -device virtio-net-pci,netdev=user.0 \
        -device usb-ehci,id=ehci -device nec-usb-xhci,id=xhci \
        -usb -usbdevice host:03f0:134a -usbdevice host:03f0:0024 -usbdevice host:0079:0006 \
        -drive file=q35_win7.img,format=raw,cache=none,aio=native,if=virtio

Thanks!

Revision history for this message
José Pekkarinen (koalinux) wrote :

Narrowing this down, I launched the vm passing the usb devices one by one. I boot correctly with the game pad and the mouse. For any strange reason the keyboard is the faulty device with q35. The model is the following:

Bus 004 Device 002: ID 03f0:0024 Hewlett-Packard KU-0316 Keyboard.

It's a bit surprising because using this device using 440fx vm is totally functional, and I can happily play games with it. Any possible explanation on this?

Thanks!

Revision history for this message
José Pekkarinen (koalinux) wrote :

Actually moving the device to some other port made it work, so then the suspicious is not the keyboard, but the controller where it's unplugged, which is the following one:

00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11).

summary: - Usb passthrough on q35 broken.
+ Usb passthrough of devices plugged to AMD FCH USB OHCI Controller
+ failing on q35.
Revision history for this message
José Pekkarinen (koalinux) wrote :

Finally, I tried several combination of ports for this, until I figure out and arrangement that worked for me. Seems like the problem is that 2 hp usb devices cannot share the same bus, so no matter if it's using an ohci controller, an ehci, controller, or even xhci, if the devices are in the same bus, some fancy error will come to the screen, and no keyboard and mouse turns up in the vm.

Revision history for this message
Thomas Huth (th-huth) wrote :

The QEMU project is currently considering to move its bug tracking to another system. For this we need to know which bugs are still valid and which could be closed already. Thus we are setting older bugs to "Incomplete" now.
If you still think this bug report here is valid, then please switch the state back to "New" within the next 60 days, otherwise this report will be marked as "Expired". Or mark it as "Fix Released" if the problem has been solved with a newer version of QEMU already. Thank you and sorry for the inconvenience.

Changed in qemu:
status: New → Incomplete
Revision history for this message
José Pekkarinen (koalinux) wrote :

I found a different arrangement that made it for me, so that particular case,
I don't know if it works for me, or if it still fails the same, and versions
has gone so far to check, I'd simply mark this invalid and forget of it.

Best regards.

José.

Changed in qemu:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.