jaypipes / ghw

Go HardWare discovery/inspection library
Apache License 2.0
1.64k stars 180 forks source link

error parsing pci address #372

Closed ianb-mp closed 1 month ago

ianb-mp commented 1 month ago

Seeing error error parsing the pci address "10001:80:05.0"

As far as I can see, it looks like Intel VMD (virtual RAID) devices - lspci output:

10001:80:05.0 PCI bridge: Intel Corporation Device 352c (rev 04)
10001:80:07.0 PCI bridge: Intel Corporation Device 352d (rev 04)
10001:8a:00.0 Non-Volatile memory controller: Micron Technology Inc 7450 PRO NVMe SSD (rev 01)
10001:8b:00.0 Non-Volatile memory controller: Micron Technology Inc 7450 PRO NVMe SSD (rev 01)
10002:80:01.0 PCI bridge: Intel Corporation Device 352a (rev 04)
10002:80:03.0 PCI bridge: Intel Corporation Device 352b (rev 04)
10002:80:05.0 PCI bridge: Intel Corporation Device 352c (rev 04)
10002:80:07.0 PCI bridge: Intel Corporation Device 352d (rev 04)
10002:8a:00.0 Non-Volatile memory controller: Micron Technology Inc 7450 PRO NVMe SSD (rev 01)
10002:8b:00.0 Non-Volatile memory controller: Micron Technology Inc 7450 PRO NVMe SSD (rev 01)
10002:8c:00.0 Non-Volatile memory controller: Micron Technology Inc 7450 PRO NVMe SSD (rev 01)
10002:8d:00.0 Non-Volatile memory controller: Micron Technology Inc 7450 PRO NVMe SSD (rev 01)
10003:00:05.0 PCI bridge: Intel Corporation Device 352c (rev 04)
10003:00:07.0 PCI bridge: Intel Corporation Device 352d (rev 04)
10004:00:01.0 PCI bridge: Intel Corporation Device 352a (rev 04)
10004:00:03.0 PCI bridge: Intel Corporation Device 352b (rev 04)
10004:00:05.0 PCI bridge: Intel Corporation Device 352c (rev 04)
10004:00:07.0 PCI bridge: Intel Corporation Device 352d (rev 04)
jaypipes commented 1 month ago

Hi @ianb-mp! Thanks for the bug report and PR fix :) I'll review shortly.

jaypipes commented 1 month ago

OK, so this blurb from Wikipedia seems to sum up what's going on here:

PCI-X 2.0 and PCI Express introduced an extended configuration space, up to 4096 bytes. The only standardized part of extended configuration space is the first four bytes at 0x100 which are the start of an extended capability list. Extended capabilities are very much like normal capabilities except that they can refer to any byte in the extended configuration space (by using 12 bits instead of eight), have a four-bit version number and a 16-bit capability ID. Extended capability IDs overlap with normal capability IDs, but there is no chance of confusion as they are in separate lists.

It seems these Intel devices are using the extended configuration space...

jaypipes commented 1 month ago

Also see here for a similar bug report to Intel about the 10000 PCI domain:

https://community.intel.com/t5/Processors/why-PCI-devices-have-0x1000x-domain-address/m-p/1561136