From: Martin Mares Date: Sun, 27 May 2018 11:49:55 +0000 (+0200) Subject: lspci: "virtual" resource regions recognized properly X-Git-Tag: v3.6.0~8 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=4cd087d884827e5e4cc493fcbe46e7fb6e331416;p=pciutils.git lspci: "virtual" resource regions recognized properly We wanted to add a "[virtual]" marker to all resources which are known to the kernel, but not configured in the hardware. That is, those where the BAR is all zero. However, the test was never triggered for I/O regions, since their BAR is never zero: it always has the region type bit set. Now, we test only the address part of the BAR. --- diff --git a/lspci.c b/lspci.c index 748452c..3bf1925 100644 --- a/lspci.c +++ b/lspci.c @@ -395,8 +395,9 @@ show_bases(struct device *d, int cnt) putchar('\t'); if (ioflg & PCI_IORESOURCE_PCI_EA_BEI) printf("[enhanced] "); - else if (pos && !flg) /* Reported by the OS, but not by the device */ + else if (pos && !(flg & ((flg & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK))) { + /* Reported by the OS, but not by the device */ printf("[virtual] "); flg = pos; virtual = 1;