Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Apr 2009 22:29:13 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Scott Long <scottl@samsco.org>, freebsd-amd64@freebsd.org
Subject:   Re: amd64/133592: [busdma] [patch] busdma incorrectly calculates bounce buffer requirements for userspace buffers
Message-ID:  <20090413192913.GZ3014@deviant.kiev.zoral.com.ua>
In-Reply-To: <200904131156.36255.jhb@freebsd.org>
References:  <200904121520.n3CFK6G8032035@freefall.freebsd.org> <20090412193044.GN3014@deviant.kiev.zoral.com.ua> <200904131156.36255.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--3h0UNLyY10zL13pE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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=
=20
> GNATS.
> > >=20
> > > From: Scott Long <scottl@samsco.org>
> > > To: bug-followup@FreeBSD.org, jason.harmening@gmail.com
> > > Cc: =20
> > > Subject: Re: amd64/133592: [busdma] [patch] busdma incorrectly calcul=
ates
> > >  bounce buffer requirements for userspace buffers
> > > Date: Sun, 12 Apr 2009 08:53:47 -0600
> > >=20
> > >  You're right, it's definitely a problem.  The patch looks correct, f=
eel
> > >  free to commit to i386, amd64, and ia64.  Arm needs a similar fix, b=
ut
> > >  the code looks to be somewhat different.
> >=20
> > Below is updated patch. It was compile-tested on all affected arches.
> > Scott, any notes ?
>=20
> I've had a similar patch in a branch for years, it should definitely go i=
n.

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.

--3h0UNLyY10zL13pE
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAknjkokACgkQC3+MBN1Mb4jC1gCg349C0B4O7ov/2Cf2O3bC0W45
358AnRe2G/aKsGg5VlAdh9+5IwNhuOTu
=3HJq
-----END PGP SIGNATURE-----

--3h0UNLyY10zL13pE--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090413192913.GZ3014>