qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@sig21.net>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Shawn Starr <shawn.starr@rogers.com>,
	qemu-devel@nongnu.org, gerd@kraxel.org
Subject: Re: [Qemu-devel] EHCI USB regression in 1.2.0 - ehci_state_fetchqtd() asserting
Date: Mon, 8 Oct 2012 18:11:55 +0200	[thread overview]
Message-ID: <20121008161155.GA618@sig21.net> (raw)
In-Reply-To: <5072EB3C.70004@redhat.com>

Hi,

On Mon, Oct 08, 2012 at 05:03:24PM +0200, Hans de Goede wrote:
> On 10/08/2012 04:49 PM, Johannes Stezenbach wrote:
> >On Mon, Oct 08, 2012 at 03:51:08PM +0200, Hans de Goede wrote:
> >>the real problem is the
> >>"ehci warning: guest updated active QH" message, which most likely indicates
> >>that the guest has hit the doorbell (IAAD) in the EHCI controller, and then
> >>has not gotten an IAA interrupt within
> >>a certain amount of time triggering its IAAD watchdog (some real EHCI
> >>hardware is broken wrt delivering IAA interrupt) causing us to not see
> >>an unlinked qh as unlinked, and then later on triggering the
> >>"warning: guest updated active QH" message.
> >>
> >>This is unavoidable when we get too large latencies, the ehci hardware
> >>simple was not designed to be virtualized, anything but actually.
> >
> >OK, thanks for this explanation.
> >I haven't much clue about qemu but isn't the issue that qemu
> >delivers timer irqs to the guest (for EHCI_HRTIMER_IAA_WATCHDOG) while
> >failing to handle the IAAD -> IAA interrupt generation?
> >(via qemu_bh_schedule -> ehci_advance_async_state -> ehci_raise_irq,
> >why does ehci_raise_irq() not call ehci_update_irq() for USBSTS_IAA?)
> 
> We need to throttle the interrupt generation inside ehci both per
> the spec, and because otherwise we may trigger:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=361aabf395e4a23cf554cf4ec0c0c6963b8beb01
> 
> Which is present in all but the very latest linux kernels.

Not nice :-(

> We do our best to make the whole usb-redir code and ehci emulation as
> proof as possible against latency spikes, and some of the patches
> from my latest patchset may help there, but in the end, esp. for
> isoc devices, the code will always be sensitive to too large latencies.

OK, I read up on the EHCI interrupt threshold and found how
ehci_frame_timer() calls ehci_commit_irq().  I agree it is
hard to fix.  I wonder if it would be sufficient if qemu would
guarantee ehci_frame_timer() runs before sending the timer irq
that triggers the IAA timeout, but I guess it depends on what the
guest processes first.  I also wonder if this is not a generic problem
for all emulated hw if the driver uses some timeout?


Thanks
Johannes

  reply	other threads:[~2012-10-08 16:12 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19 16:42 [Qemu-devel] EHCI USB regression in 1.2.0 - ehci_state_fetchqtd() asserting Shawn Starr
2012-09-19 16:53 ` Shawn Starr
2012-09-20 15:37 ` Hans de Goede
2012-09-20 19:08   ` Shawn Starr
2012-09-20 23:28   ` Shawn Starr
     [not found]   ` <6177450.mT8I4ey0nz@segfault.sh0n.net>
2012-09-21  0:04     ` Shawn Starr
2012-09-21 12:19       ` Hans de Goede
2012-09-21 15:39         ` Shawn Starr
2012-09-21 17:35           ` Hans de Goede
2012-09-21 18:46             ` Shawn Starr
2012-09-23 10:03               ` Hans de Goede
2012-09-23 18:00                 ` Shawn Starr
2012-09-23 18:20                   ` Shawn Starr
2012-09-23 18:52                     ` Shawn Starr
2012-09-24  9:52                       ` Hans de Goede
2012-09-24 14:24                         ` Shawn Starr
2012-09-24  9:50                     ` Hans de Goede
2012-09-24 14:20                       ` Shawn Starr
2012-09-24 14:36                         ` Hans de Goede
2012-09-24 14:38                           ` Shawn Starr
2012-10-02 15:26                             ` Shawn Starr
2012-10-08 11:27                               ` Hans de Goede
2012-10-08 13:01                                 ` Johannes Stezenbach
2012-10-08 13:51                                   ` Hans de Goede
2012-10-08 14:49                                     ` Johannes Stezenbach
2012-10-08 15:03                                       ` Hans de Goede
2012-10-08 16:11                                         ` Johannes Stezenbach [this message]
2012-10-08 20:10                                           ` Hans de Goede
2012-10-08 20:18                                             ` Shawn Starr
2012-10-08 21:32                                               ` Hans de Goede
2012-10-08 21:37                                                 ` Shawn Starr

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=20121008161155.GA618@sig21.net \
    --to=js@sig21.net \
    --cc=gerd@kraxel.org \
    --cc=hdegoede@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=shawn.starr@rogers.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).