Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Feb 2009 18:21:21 -0500
From:      Robert Noland <rnoland@FreeBSD.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r188018 - in head: sys/dev/pci usr.sbin/pciconf
Message-ID:  <1233616882.1492.68.camel@ferret.2hip.net>
In-Reply-To: <200902021659.54847.jhb@freebsd.org>
References:  <200902021954.n12JsGT2005768@svn.freebsd.org> <200902021554.55644.jhb@freebsd.org> <1233608975.1492.45.camel@ferret.2hip.net> <200902021659.54847.jhb@freebsd.org>

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

--=-fbw5UWXx9fxxJncqNowf
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Mon, 2009-02-02 at 16:59 -0500, John Baldwin wrote:
> On Monday 02 February 2009 4:09:35 pm Robert Noland wrote:
> > On Mon, 2009-02-02 at 15:54 -0500, John Baldwin wrote:
> > > On Monday 02 February 2009 2:54:16 pm John Baldwin wrote:
> > > > Author: jhb
> > > > Date: Mon Feb  2 19:54:16 2009
> > > > New Revision: 188018
> > > > URL: http://svn.freebsd.org/changeset/base/188018
> > > >=20
> > > > Log:
> > > >   - Add a new ioctl to /dev/pci to fetch details on an individual B=
AR of=20
> a
> > > >     device.  The details include the current value of the BAR (incl=
uding=20
> all
> > > >     the flag bits and the current base address), its length, and wh=
ether=20
> or not
> > > >     it is enabled.  Since this operation is not invasive, non-root =
users=20
> are
> > > >     allowed to use it (unlike manual config register access which=20
> requires
> > > >     root).  The intention is that userland apps (such as Xorg) will=
 use=20
> this
> > > >     interface rather than dangerously frobbing the BARs from userla=
nd to
> > > >     obtain this information.
> > > >   - Add a new sub-mode to the 'list' mode of pciconf.  The -b flag =
when=20
> used
> > > >     with -l will now list all the active BARs for each device.
> > > >  =20
> > > >   MFC after:	1 month
> > >=20
> > > As with the capability messages, I attempted to make the bar messages=
=20
> match
> > > the output of a verbose dmesg.  An example:
> > >=20
> > > igb0@pci0:8:0:0:        class=3D0x020000 card=3D0x10a715d9 chip=3D0x1=
0a78086=20
> rev=3D0x02 hdr=3D0x00
> > >     vendor     =3D 'Intel Corporation'
> > >     class      =3D network
> > >     subclass   =3D ethernet
> > >     bar   [10] =3D type Memory, range 32, base 0xda020000, size 13107=
2,=20
> enabled
> > >     bar   [14] =3D type Memory, range 32, base 0xda000000, size 13107=
2,=20
> enabled
> > >     bar   [18] =3D type I/O Port, range 32, base 0x3000, size 32, ena=
bled
> > >     bar   [1c] =3D type Memory, range 32, base 0xda080000, size 16384=
,=20
> enabled
> > >     cap 01[40] =3D powerspec 2  supports D0 D3  current D0
> > >     cap 05[50] =3D MSI supports 1 message, 64 bit
> > >     cap 11[60] =3D MSI-X supports 10 messages in map 0x1c enabled
> > >     cap 10[a0] =3D PCI-Express 2 endpoint
> >=20
> > I haven't looked this over thoroughly yet, but will it support BIOS
> > mappings as well?  Or should I take a crack at adding that?
>=20
> It does not handle the BIOS BAR.  If we need to we can either extend this=
 or=20
> add a new ioctl for that.  However, if X is just reading the current sett=
ing=20
> then what it is doing now may be fine.  I will try to look at the current=
=20
> code for that in a bit.

Right now, X wants to know if a pci bios BAR exists, what size it is and
what the base address is.  In libpciaccess it then mmaps that region and
copies the bios into a buffer which is handed to X.  If a pci bios does
not exist, it mmaps 0xc0000 x 0x10000 (the standard VGA bios setting).
We may not be able to do this as efficiently as I would like unless we
implement a way to actually extract the bios contents, as userland would
still possibly need a way to set/restore the rom rom enabled bit for
copying.

robert.

--=20
Robert Noland <rnoland@FreeBSD.org>
FreeBSD

--=-fbw5UWXx9fxxJncqNowf
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (FreeBSD)

iEYEABECAAYFAkmHf/EACgkQM4TrQ4qfRONjNgCbB1nFueQDF5swNvmJZFfWWg78
dN8An0nP2tHlE+k39foZmw2S2TPpF8JY
=tXZD
-----END PGP SIGNATURE-----

--=-fbw5UWXx9fxxJncqNowf--




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