[Top][All Lists]

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

Re: [Qemu-devel] [qemu-devel][RFC] Enable usb with default options

From: Hans de Goede
Subject: Re: [Qemu-devel] [qemu-devel][RFC] Enable usb with default options
Date: Thu, 07 Jun 2012 10:52:51 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1


On 06/07/2012 10:40 AM, Benjamin Herrenschmidt wrote:
On Thu, 2012-06-07 at 10:32 +0200, Hans de Goede wrote:

Sorry for jumping in the middle of the thread, I missed the beginning
of this. Enabling USB by default, esp. emulating a USB mouse by default
is a *bad* idea. They way the periodic schedule of the various USB
controllers works means that emulating a USB device means a 1000 vm exits
per second extra, even when the vm is completely idle! USB powermanagement
can be used to negate this, but this is off in both Linux and Windows for
HID devices by default because there are too many broken HID devices.

On the other hand it is the only choice of input device on some
platforms such as pseries (and MacG5 when I get to make it work :-)

Ok, then we can make it default on those platforms, but not everywhere?

Would it be possible to "whitelist" the QEMU emulated HID devices
in the kernel to enable dynamic PM for them (at least when they sit
alone on the bus) ?

Yes, Linux already does this for the qemu usb tablet (not in the kernel
but with udev rules, but the result is the same), but this won't help
windows vms. IOW lets not have usb on by default on x86 please :)

Or is our emulation busted too ?


At least that would improve the situation in the long run...

Side note: It might be able to add an option at least to OHCI and EHCI
to relax a bit the correctness of the emulation and dramatically reduce
the number of exits.

One way to do that is to simply reduce the timer by a factor of 10 or
100 (and increment frame numbers in bulk). This could be reasonably
safely done when SOF interrupts aren't enabled, especially when only HID
devices are on the bus. We could alternatively schedule additional
arbitrary frames in between whenever a HID event is actually present.

We (me and Gerd Hoffmann) have investigated that, and experimented with it.
It will work for simply devices, but isochronous devices break. The real
solution at least for x86 vms is to get the XHCI emulation finished, as
the XHCI controller has a much nicer hw interface from an emulation pov,
and it can handle usb 1-3 devices.



reply via email to

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