qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Benjamin Herrenschmidt <benh@au1.ibm.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	li zhang <zhlcindy@gmail.com>,
	qemu-devel@nongnu.org, zhlcindy@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [qemu-devel][RFC] Enable usb with default options
Date: Thu, 07 Jun 2012 10:52:51 +0200	[thread overview]
Message-ID: <4FD06BE3.3070506@redhat.com> (raw)
In-Reply-To: <1339058438.24838.15.camel@pasglop>

Hi,

On 06/07/2012 10:40 AM, Benjamin Herrenschmidt wrote:
> On Thu, 2012-06-07 at 10:32 +0200, Hans de Goede wrote:
>> Hi,
>>
>> 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 ?

No.

> 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.

Regards,

Hans

  parent reply	other threads:[~2012-06-07  8:52 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-05  9:48 [Qemu-devel] [qemu-devel][RFC] Enable usb with default options li zhang
2012-06-06  2:52 ` li zhang
2012-06-06  3:31   ` Benjamin Herrenschmidt
2012-06-06  5:42     ` Anthony Liguori
2012-06-06  6:03       ` li zhang
2012-06-06 21:13       ` Benjamin Herrenschmidt
2012-06-07  1:15         ` Anthony Liguori
2012-06-07  3:00           ` Benjamin Herrenschmidt
2012-06-07  3:03             ` Anthony Liguori
2012-06-07  4:52             ` li zhang
2012-06-07  4:39           ` li zhang
2012-06-07  4:43             ` Anthony Liguori
2012-06-07  4:53               ` li zhang
2012-06-07  8:07           ` Markus Armbruster
2012-06-07  9:19             ` Anthony Liguori
2012-06-07 10:05               ` Markus Armbruster
2012-06-07 11:51                 ` Anthony Liguori
2012-06-12  8:06                   ` Markus Armbruster
2012-06-07  8:32         ` Hans de Goede
2012-06-07  8:40           ` Benjamin Herrenschmidt
2012-06-07  8:49             ` Paolo Bonzini
2012-06-07  8:52             ` Hans de Goede [this message]
2012-06-07  9:05               ` Gerd Hoffmann
2012-06-07  9:17                 ` Benjamin Herrenschmidt
2012-06-07  9:29                   ` Li Zhang
2012-06-07  9:16               ` Benjamin Herrenschmidt
2012-06-07  9:50                 ` Hans de Goede
2012-06-07 11:19                   ` Benjamin Herrenschmidt
2012-06-07 11:35                   ` Gerd Hoffmann
2012-06-07  8:54             ` Gerd Hoffmann
2012-06-06 22:14     ` Andreas Färber
  -- strict thread matches above, loose matches on Subject: below --
2012-06-05  7:19 Li Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FD06BE3.3070506@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=benh@au1.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhlcindy@gmail.com \
    --cc=zhlcindy@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).