nanovms / nanos

A kernel designed to run one and only one application in a virtualized environment
https://nanos.org
Apache License 2.0
2.58k stars 133 forks source link

pci_discover(): fix missing probe of bus 0 #2039

Closed francescolavra closed 1 month ago

francescolavra commented 1 month ago

There are platforms (such as the platform used by ARM-based t2a instances in Google Cloud) where the PCI device at 00:00:0 is not a host-to-pci bridge but PCI bus 0 is still present and should be enumerated. This change ensures that PCI bus 0 is always enumerated. Enumeration of a PCI bus is being optimized by avoiding probing device functions 1 to 7 in a given device slot when device function 0 does not exist in that slot.