Description of problem: Redirected usb-hid devices do not work when using an emulated xhci controller Version-Release number of selected component (if applicable): qemu-2.7.0-1.fc25.x86_64 How reproducible: Steps to Reproduce: 1. Start qemu-system-x86_64 with -device nec-usb-xhci + options needed for spice usb-redirection 2. Connect to qemu with e.g. remote-viewer, select a usb-hid device keyboard to redirect 3. Try to use redirected keyboard in guest, nothing happings Actual results: Try to use redirected keyboard in guest, nothing happings. Expected results: Redirected keyboard can be used to type in guest. Additional info: Things do work when replacing "-device nec-usb-xhci" with "-readconfig /etc/qemu/ich9-ehci-uhci.cfg" on the qemu commandline, suggesting that this is a problem with interrupt endpoint handling in the xhci emulation. remote-viewer in Fedora 25 currently has issues with updating the guest screen, see bug 1382325, when testing with spice either use the workaround described there, or a Fedora 24 spice-client. Note this should reproduce with host-redirection too, so using spice is not necessary.
> Things do work when replacing "-device nec-usb-xhci" with "-readconfig > /etc/qemu/ich9-ehci-uhci.cfg" on the qemu commandline, suggesting that this > is a problem with interrupt endpoint handling in the xhci emulation. > > Note this should reproduce > with host-redirection too, so using spice is not necessary. Well, it doesn't, usb-host is doing fine. I suspect it is a missing usb_wakeup() call somewhere in the redirection code. ehci and uhci don't fall over in that case because we must poll anyway for correctness reasons. Worst case is a delay in case ehci throttles polling due to inactivity on the usb bus. xhci depends on wakeup calls though. The different hardware design allows us to *not* poll constantly. Care to have a look? You know the redirection code better than me ...
Created attachment 1208771 [details] qemu-2.7.0-usb-redirect-wakeup.patch Hi Gerd, You were right, although the wakeup was there it was being called too early, it seems that now a days more work is done directly (rather then being scheduled) as a result of the call to wakeup and usbredir.c was not ready to handle this when it called usb_wakeup(). This patch fixes this. I've kicked of F25+ builds with this patch and I'll create an update. Can you take care of upstreaming this ? Feel free to add my S-o-b, I created the patch using the Fedora pkgs, as I no longer have a qemu git clone around. Regards, Hans
qemu-2.7.0-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-1db1147b8e
qemu-2.7.0-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.