Re: PCI Functions problems

Gabriel Paubert (paubert@iram.es)
Mon, 26 May 1997 17:03:33 +0200 (METDST)


On 25 May 1997, Hein Roehrig wrote:

> Alfredo Babusci <babusci@roma1.infn.it> writes:
>
> > Perhaps I cannot use this functions without make a module and adding it
> > to the kernel ?
Exactly.

>
> Indeed. I wrote a little device driver that allows PCI BIOS access from
> user mode. It can be found at
>
> http://www.ikf.physik.uni-frankfurt.de/~roehrig/prog.html
>

Indeed it may be nice to have a driver to access PCI configuration
space, this should however be done carefully because you can easily crash
a machine by destroying all your mappings and setup. For security reasons,
only superuser accesses should be allowed. Also X servers contain code
that directly access PCI configuration space which is quite dangerous if
an interrupt happens between the access to the address and data ports:
they would better use system services that provide controlled access to PCI
configuration space.

Admittedly accesses to PCI configuration space are not very frequent once
the drivers have been initialized except perhaps for error recovery.
I don't know a lot about SMP, but I wonder whether it is possible that
two processors attempt simultaneous access to PCI configuration space, in
this case something like a spinlock for serialization is required
(except for Alpha where the whole PCI configuration space is directly mapped
somewhere in the huge physical addressing space if I remember well). This
is however very chipset-dependant.

Gabriel