qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <dwg@au1.ibm.com>
To: kraxel@redhat.com
Cc: Wei Yang <weiyang@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, anthony@codemonkey.ws
Subject: Re: [Qemu-devel] [PATCH] USB OHCI bug fixes
Date: Tue, 28 Feb 2012 15:03:54 +1100	[thread overview]
Message-ID: <20120228040354.GN3433@truffala.fritz.box> (raw)
In-Reply-To: <1330401082-10073-1-git-send-email-david@gibson.dropbear.id.au>

On Tue, Feb 28, 2012 at 02:51:22PM +1100, David Gibson wrote:
> This patch fixes two bugs in the OHCI device where the device writes
> back data to system memory that should be exclusively under the
> control of the guest side driver.
> 
> In OHCI specification Section 5.2.7, it mentioned "In all cases, Host
> Controller Driver is responsible for the insertion and removal of all
> Endpoint Descriptors in the various Host Controller Endpoint
> Descriptor lists".  In the ohci_frame_boundary(), ohci_put_hcca()
> writes the entire hcca back including the interrupt ED lists which
> should be under driver control. This violates the specification and
> can race with a host driver updating that list at the same time.
> 
> In the OHCI Spec Section 4.6, Transfer Descriptor Queue Processing, it
> mentioned "Since the TD pointed to by TailP is not accessed by the HC,
> the Host Controller Driver can initialize that TD and link at least
> one other to it without creating a coherency or synchronization
> problem".  While the function ohci_put_ed() writes the entire endpoint
> descriptor back including the TailP which should under driver
> control. This violate the specification and can race with a host
> driver updating the TD list at the same time.
> 
> In each case the solution is to make sure we don't write data which is
> under driver control.

Arrrgh, sorry, screwed up yet again.  This version has some redundant
#defines left in.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

      reply	other threads:[~2012-02-28  4:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-28  3:51 [Qemu-devel] [PATCH] USB OHCI bug fixes David Gibson
2012-02-28  4:03 ` David Gibson [this message]

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=20120228040354.GN3433@truffala.fritz.box \
    --to=dwg@au1.ibm.com \
    --cc=anthony@codemonkey.ws \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weiyang@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).