qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: UHCI idle detection


From: Gerd Hoffmann
Subject: [Qemu-devel] Re: UHCI idle detection
Date: Tue, 04 Jan 2011 13:13:28 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Red Hat/3.1.7-3.el6_0 Thunderbird/3.1.7

On 01/04/11 12:48, Stefan Hajnoczi wrote:
CPU utilization is a known issue with UHCI emulation.  I spent a short
time poking around the code and USB specifications trying to come up
with a way to detect "idle" periods where we don't need to poll the
frame list at 1000 Hz.

Check out

http://cgit.freedesktop.org/spice/qemu/log/?h=usb.3

It adds remote wakeup support to uhci, hub and hid emulation. This allows the guest to suspend the usb bus when it is idle, the 1000 Hz wakeup goes away then.

Only problem with that is guests don't do that by default because there is way too much broken hardware out there. That includes the current qemu usb hid emulation which advertises remote wakeup support although it isn't implemented :(

Windows guests needs some registry hackery and Linux guests some udev rules to enable remote wakeup permanently.

I was hoping to find a solution to detect an "idle" UHCI state, i.e. a
stable state where the guest is waiting for UHCI to report events and
the guest isn't issuing new transfers.  If the idle state can be
detected, then UHCI stops its frame timer and protects the frame list
and other control structure guest memory pages.
>
When the guest writes to those memory pages again in order to issue a
new USB transaction, we catch the write.  UHCI unprotects the guest
memory pages and turns the frame timer back on.

It isn't that simple. "idle" state depends on the usb devices too. With a usb tablet connected (and no remote-wakeup being used) uhci will poll the tablet in regular intervals and the usb tablet will either send the next event in the queue or NACK the transfer in case there is no event available.

cheers,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]