On 12/14/2011 12:03 PM, Brice Goglin wrote:
Le 14/12/2011 20:45, Paul H. Hargrove a écrit :
I can run "lspci -vv" to get plenty of correct information and no such
messages.
What about lspci -vvxxx ? These options makes the pci lib read 256
instead of 64 bytes of config space ?

Yup, that reproduces the problem:
$ lspci -vvxxx
pcilib: proc_read: tried to read 256 bytes at 0, but got only 64
lspci: Unable to read 256 bytes of configuration space.

However, my lspci manpage says only root can use -xxx:
-xxx Show hexadecimal dump of whole PCI configuration space. Avail- able only for root as several PCI devices crash when you try to read undefined portions of the config space (this behaviour probably doesn't violate the PCI standard, but it's at least
              very stupid).

So, I tried "sudo lspci -vvxxx" and get lots of output and no error.

Following up on that, I find "sudo hwloc-calc" runs w/o the errors.

Here is a portion of proc_bus_pci_read() from my /usr/src/linux-2.4.21-60.EL/drivers/pci/proc.c:
        /*
         * Normal users can read only the standardized portion of the
         * configuration space as several chips lock up when trying to read
         * undefined locations (think of Intel PIIX4 as a typical example).
         */
        if (capable(CAP_SYS_ADMIN))
                size = PCI_CFG_SPACE_SIZE;
        else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
                size = 128;
        else
                size = 64;

I find that this exact code is still present in linux-2.6.39. So, the kernel behavior has not changed in this respect and I suspect therefore that more recent libpci is simply masking the short read.

I would suggest logic in topology-libpci that tries first to read 256 bytes and they tries again to read 128 and then 64. With a smart pciaccess->error handler one would NOT produce this error message until 256, 128 and 64-byte reads all fail.

-Paul

--
Paul H. Hargrove                          [email protected]
Future Technologies Group
HPC Research Department                   Tel: +1-510-495-2352
Lawrence Berkeley National Laboratory     Fax: +1-510-486-6900

Reply via email to