From owner-svn-src-head@FreeBSD.ORG Fri Jan 3 18:22:07 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D9C2411; Fri, 3 Jan 2014 18:22:07 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 94CA715CC; Fri, 3 Jan 2014 18:22:05 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id s03ILxq6092682; Fri, 3 Jan 2014 20:21:59 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s03ILxq6092682 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id s03ILxTB092681; Fri, 3 Jan 2014 20:21:59 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 3 Jan 2014 20:21:59 +0200 From: Konstantin Belousov To: Ian Lepore Subject: Re: svn commit: r260165 - head/sys/dev/ahci Message-ID: <20140103182159.GR59496@kib.kiev.ua> References: <201401012026.s01KQ8KU017949@svn.freebsd.org> <20140101203212.GF59496@kib.kiev.ua> <1388767752.1158.264.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Gx6yhVhPSPzNJpj4" Content-Disposition: inline In-Reply-To: <1388767752.1158.264.camel@revolution.hippie.lan> User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: Zbigniew Bodek , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jan 2014 18:22:07 -0000 --Gx6yhVhPSPzNJpj4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 03, 2014 at 09:49:12AM -0700, Ian Lepore wrote: > On Wed, 2014-01-01 at 22:32 +0200, Konstantin Belousov wrote: > > On Wed, Jan 01, 2014 at 08:26:08PM +0000, Zbigniew Bodek wrote: > > > Author: zbb > > > Date: Wed Jan 1 20:26:08 2014 > > > New Revision: 260165 > > > URL: http://svnweb.freebsd.org/changeset/base/260165 > > >=20 > > > Log: > > > Use only mapped BIOs on ARM > > > =20 > > > Using unmapped BIOs causes failure inside bus_dmamap_sync, since > > > this function requires valid MVA address, which is not present > > > if mapping is not set up. > > > =20 > > > Submitted by: Wojciech Macek > > > Obtained from: Semihalf > > >=20 > > > Modified: > > > head/sys/dev/ahci/ahci.c > > >=20 > > > Modified: head/sys/dev/ahci/ahci.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/sys/dev/ahci/ahci.c Wed Jan 1 20:22:29 2014 (r260164) > > > +++ head/sys/dev/ahci/ahci.c Wed Jan 1 20:26:08 2014 (r260165) > > > @@ -3066,7 +3066,15 @@ ahciaction(struct cam_sim *sim, union cc > > > if (ch->caps & AHCI_CAP_SPM) > > > cpi->hba_inquiry |=3D PI_SATAPM; > > > cpi->target_sprt =3D 0; > > > +#ifdef __arm__ > > > + /* > > > + * Do not use unmapped buffers on ARM. Doing so will cause > > > + * failure inside bus_dmamap_sync due to lack of VA. > > > + */ > > > + cpi->hba_misc =3D PIM_SEQSCAN; > > > +#else > > > cpi->hba_misc =3D PIM_SEQSCAN | PIM_UNMAPPED; > > > +#endif > > > cpi->hba_eng_cnt =3D 0; > > > if (ch->caps & AHCI_CAP_SPM) > > > cpi->max_target =3D 15; > >=20 > > I think this is wrong. If bus_dmamap_sync(9) is not functional on arm, > > then unmapped io should be disabled on arm unconditionally, using > > unmapped_buf_allowed. Why ahci(4) is special in this regard, leaving > > other controllers broken for arm ? >=20 > I think this entire concept is wrong, and the fix should be in armv6 > busdma or pmap code. An unmapped page is, by definition, not cached. > The only way data becomes cached is because flags in a mapping indicated > the memory is cacheable. If we have data from unmapped pages in the > cache, that's a bug in the armv6 pmap implementation, I think. I agree with the statement that the fix must be in busdma MD code, possibly with some cooperation with pmap code. On the other hand, I do not understand later claims. BIO unmapped attribute only means that bio does not carry a pointer to (some) mapping of the bio_ma pages. In other words, unmapped BIO does not imply globally unmapped page, and CPU cache might contain the lines =66rom the BIO pages. --Gx6yhVhPSPzNJpj4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSxv/GAAoJEJDCuSvBvK1B/5IP/iFASxDOpbhjCFFO21MHpQQb vlYSX7I0bBE1uxIXu4HuHg9ZH9jFSn0qhvF72Nk7gy+AriN82IxWwzFSV+G7G7ia gWwnAeeKTaoQPvpAZRRbF0GaVVN1npoBDi8f8YVn2yhI2dxGTsb5CyVyUH5vFKUq BBZ201MrUjzc+9N9ziR7etQHCkph5W4Fs5itA+It5sSWv/+K052GHjHemzodglN8 LOXVVZqw78o+0Iig2g157EUmfrfnwOMIvwVqeNAIvu4bISF+zCO24GMRqy+w2oFd lIm3mdOhBhgGJiFt+mtq/8GdQaiYIiExsztgFJrViK8VuYEU8q0tkYw+zr7NnEu9 aD3gJmVeL5boz6k4cLJJWBFJCCsHuArf9yk1jwdusP4v8A+TW6qeIgNWU2JcfAYh PA1KBqt9MTPkOaRmwNKyaeVtxSpujdgR+kEAi1rWiubzPVf6zbHGEnmWzI30t+uN r5Ce0wgkpawOl4AA01T6T4iqkO1OEHlmJTveGrcBVwnCse7VPkJoQaD6G8nTyz55 LcOqukYuniHNWDs2gAnbMSwjZ3tEL3RJ1/4XjW//15gzAGqs05xCpElL7ceSKlBM 9gt9EHfiO9Q5oDICkHE3CitJPTS12OUa11vqd4sF/gmdso8p1BpbD+nmjImYEwv8 +pJ7GFTDB3HM4UfY6QWz =2PKw -----END PGP SIGNATURE----- --Gx6yhVhPSPzNJpj4--