From owner-freebsd-arch@FreeBSD.ORG Tue Jun 18 17:59:10 2013 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D4D20594; Tue, 18 Jun 2013 17:59:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 751611A9D; Tue, 18 Jun 2013 17:59:10 +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 r5IHx0Za094173; Tue, 18 Jun 2013 20:59:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r5IHx0Za094173 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r5IHx0CO094172; Tue, 18 Jun 2013 20:59:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 18 Jun 2013 20:59:00 +0300 From: Konstantin Belousov To: Marius Strobl Subject: Re: Bus space routines Message-ID: <20130618175900.GY91021@kib.kiev.ua> References: <51C0345E.4000309@freebsd.org> <20130618111351.GA43938@alchemy.franken.de> <51C07A2F.3060504@FreeBSD.org> <20130618154511.GY53058@alchemy.franken.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="S2CovAv8lqFB/Tem" Content-Disposition: inline In-Reply-To: <20130618154511.GY53058@alchemy.franken.de> User-Agent: Mutt/1.5.21 (2010-09-15) 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: arch@FreeBSD.org, Andriy Gapon , Niclas Zeising X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 17:59:10 -0000 --S2CovAv8lqFB/Tem Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 18, 2013 at 05:45:11PM +0200, Marius Strobl wrote: > On Tue, Jun 18, 2013 at 06:18:07PM +0300, Andriy Gapon wrote: > > on 18/06/2013 14:13 Marius Strobl said the following: > > > What we really need is a proper interface allowing userland to access > > > PCI I/O and memory registers, f. e. via /dev/pci, and for libpciaccess > > > to build upon that, i. e. essentially the same as things work on/with > > > Linux and /sys/bus/pci/device. As a side-effect this then also permits > > > to properly sanity check PCI accesses from userland within the kernel. > >=20 > > We have this pciconf utility (in base), which can read PCI config regis= ters (and > > more). Apparently it uses some ioctl interface of /dev/pci. > > Is this the interface that you had in mind or does it lack some require= d capabilities? > >=20 >=20 > Currently, that pci(4) userland interface is limited to configuration > space only (and libpciaccess indeed already makes use of it for that > purpose). What Xorg now additionally requires from such an interface is > access to I/O and/or (haven't looked at it in that detail so far) memory > registers of PCI devices. Extending /dev/pci to also provide this, thus, > certainly is one proper way to go. As a side-note, unfortunately, at > least struct pci_conf and pci_match_conf aren't particularly well-thought > when it comes to implementing backwards compatibility to previous versions > of that interface etc. What we still lack f. e. is support for 32-bit > applications using that API on a 64-bit kernel. Do we ? It seems there are compat32 shims in dev/pci/pci_user.c. I just checked 32bit pciconf(8) on 64bit host. --S2CovAv8lqFB/Tem Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJRwJ/jAAoJEJDCuSvBvK1Bgs0P/15DfXbgAlVzxakQwYK4yL9m hbNa2I7MKI5O4uRFxgwv3GKnKM4Pbn3asUsLlSEDXwhfEhMTn8aICwWsrt9m+IWv 8dDAeYLSyLeNGRbywy0caH1IXnRl5nuXeOfzROOCf2J6yQlxpVINrW67/1X1M5cM NkxPv/wwyGX2b2Ln5a3QHQeQ1ZYNdku6DR4BfRGFD498+Dxo7gTjdOpK+/EaWfTo 7xWzmjaDffxIaBv5xx4EPLRZVMrnT0uK7DrSoNNJY168nq0Cdfg+bWnFJ5BXTyXT LtLaEdZAgJqQ3yRlNHkPfgEPrWA++uXrP3H4OrcB4qlR7dBpGN6M1GZcCzJCEEEK Utw9YAv/qL7NE0C3cmfyf1c9r/kmW1uUWenbaIQ4pbW8ZQ0b3re/np7Ozzb/JvmK RG8+mEayNMZL8nICUIpczShSFbLQLkMIJZG+OV6m2VRmWvaKC4azjwq8P1SUJ3PO 9YDUgg8PEQoV7LrMzTEod3F32TuynaE/jLLZ4bN6IKHqxkVKGlgxqR8JgrdVSOT6 BT25QkEC3hilpd3O2W+dVAe6Vzy2PtSPFZi5nBnFf77+frvIvuApgKb4WTnLK2uN Rdv2mPf+g60eD0aT0VVa6A7MaE8cDaF+u9VHYLHekeqTbWtIQNjIR0XoSDSty3h9 Ky5dPYShfLSwtuSiHJgW =MazQ -----END PGP SIGNATURE----- --S2CovAv8lqFB/Tem--