lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 17 Oct 2013 10:30:33 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Sarah Sharp <sarah.a.sharp@...ux.intel.com>
cc:	Gerd Hoffmann <kraxel@...hat.com>,
	Hans de Goede <hdegoede@...hat.com>, Jan Kara <jack@...e.cz>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Kernel development list <linux-kernel@...r.kernel.org>,
	USB list <linux-usb@...r.kernel.org>
Subject: Re: [PATCH v2] xhci: fix usb3 streams

On Wed, 16 Oct 2013, Sarah Sharp wrote:

> > > xhci maintains a radix tree for each stream endpoint because it must
> > > be able to map a trb address to the stream ring.  Each ring segment
> > > must be added to the ring for this to work.  Currently xhci sticks
> > > only the first segment of each stream ring into the radix tree.

> > There may be a simpler approach to this problem.
> > 
> > When using a new ring segment, keep the first TRB entry in reserve.  
> > Don't put a normal TRB in there, instead leave it as a no-op entry
> > containing a pointer to the stream ring.  (Make the prior Link TRB
> > point to the second entry in the new segment instead of the first.)
> > 
> > Then you won't have to add to or remove anything from the radix tree.
> 
> I don't understand how this would help.  Are you advocating a different
> way of mapping TRB DMA addresses to stream rings that would allow us to
> ditch the radix tree all together?
> 
> Ok, so with your solution, we have a virtual stream ring pointer as the
> first TRB of the segment.  We get an event with the DMA address of a TRB
> in one of many stream rings on an endpoint.  From that, I think we can
> infer the DMA address of the first TRB on the segment, due to the
> alignment requirements and ring size.
> 
> And then what do we do with that?  We don't have the virtual address of
> that first TRB, so the xHCI driver can't read the ring pointer from it.
> I'm confused as to what the next steps would be to solve this.

My mistake; I misunderstood the original description of the problem.  
I didn't realize that "map a trb address" referred to the TRB's DMA
address.

BTW, ohci-hcd faces the same problem (of mapping DMA addresses to
kernel addresses).  It solves the problem with a hash table rather than
a radix tree.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ