amd64/133592: [busdma] [patch] busdma incorrectly calculates bounce buffer requirements for userspace buffers

Kostik Belousov kostikbel at gmail.com
Mon Apr 13 12:29:32 PDT 2009


On Mon, Apr 13, 2009 at 11:56:35AM -0400, John Baldwin wrote:
> On Sunday 12 April 2009 3:30:44 pm Kostik Belousov wrote:
> > On Sun, Apr 12, 2009 at 03:20:06PM +0000, Scott Long wrote:
> > > The following reply was made to PR amd64/133592; it has been noted by 
> GNATS.
> > > 
> > > From: Scott Long <scottl at samsco.org>
> > > To: bug-followup at FreeBSD.org, jason.harmening at gmail.com
> > > Cc:  
> > > Subject: Re: amd64/133592: [busdma] [patch] busdma incorrectly calculates
> > >  bounce buffer requirements for userspace buffers
> > > Date: Sun, 12 Apr 2009 08:53:47 -0600
> > > 
> > >  You're right, it's definitely a problem.  The patch looks correct, feel
> > >  free to commit to i386, amd64, and ia64.  Arm needs a similar fix, but
> > >  the code looks to be somewhat different.
> > 
> > Below is updated patch. It was compile-tested on all affected arches.
> > Scott, any notes ?
> 
> I've had a similar patch in a branch for years, it should definitely go in.

Thanks, I committed this.
As discussed with Scott, the bus_dmamap_load_uio() KPI does not look as an
easy to use. For uio from UIO_USERSPACE, at least, the pages backing uio
chunks must be held by the caller, otherwise the pages may be repurposed
at any moment. Also, please note that there is no real error check for
the result of pmap_extract().

Some time ago I already looked for the KPI that would hold the pages from
uio, possibly topped by some per-process or per-user limit. Also, this
KPI should check that all addresses are valid. It seems that we do not
have such utility. Hope to be wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-amd64/attachments/20090413/3baf3b06/attachment.pgp


More information about the freebsd-amd64 mailing list