Index: sys/dev/virtio/pci/virtio_pci.c =================================================================== --- sys/dev/virtio/pci/virtio_pci.c +++ sys/dev/virtio/pci/virtio_pci.c @@ -288,8 +288,17 @@ sc->vtpci_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (sc->vtpci_res == NULL) { - device_printf(dev, "cannot map I/O space\n"); - return (ENXIO); + /* + * We should try harder as the common configuration structure is + * possible to be in memory space. + */ + rid = PCIR_BAR(0); + sc->vtpci_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->vtpci_res == NULL) { + device_printf(dev, "cannot map I/O nor memory space\n"); + return (ENXIO); + } } if (pci_find_cap(dev, PCIY_MSI, NULL) != 0)