qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] UHCI idle detection
@ 2011-01-04 11:48 Stefan Hajnoczi
  2011-01-04 12:13 ` [Qemu-devel] " Gerd Hoffmann
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Hajnoczi @ 2011-01-04 11:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: maxk, Gerd Hoffmann, David Ahern

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.

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.

Unfortunately the UHCI frame list, transfer descriptor, and QH
structure is complicated.  I didn't figure out whether it is feasible
to protect all the necessary guest memory pages.

Also, I'm not sure how easy it is for QEMU to protect guest memory in
this fashion (for TCG and KVM).  It seems like the VGA dirty memory
stuff polls - it accumulates dirty memory bits and gets checked by the
VGA emulation code in the necessary places - rather than intercepts
writes.

Any thoughts on this approach?

Stefan

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-01-04 15:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-04 11:48 [Qemu-devel] UHCI idle detection Stefan Hajnoczi
2011-01-04 12:13 ` [Qemu-devel] " Gerd Hoffmann
2011-01-04 12:47   ` Stefan Hajnoczi
2011-01-04 13:43     ` Gerd Hoffmann
2011-01-04 13:49       ` Anthony Liguori
2011-01-04 14:16         ` Gerd Hoffmann
2011-01-04 14:22           ` Anthony Liguori
2011-01-04 15:51             ` Alexander Graf

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