+++ This bug was initially created as a clone of Bug #1365613 +++
The virtio 1.0 devices need 8MB MMIO space while SeaBIOS(OVMF?) reserves only 2MB.
The reason the firmware reserves 'only' 2MB MMIO is because it is the minimum allowed by the PCI Spec. It will be unreasonable to default in firmware to a larger MMIO window because it is related only 2 virtio. What about assigned devices that may need more?
I propose the following solution. Add a mmio-window-size parameter to pci bridges and pass all the information to firmware using a para-virt channel like fwconfig.
The firmware can use this info to increase the mmio range for our devices.
We can default the mmio-window-size to 8MB for PCIe ports (which are seen by the firmware as PCI bridges). This will allow hot-plugging virtio-1 devices into PCIe ports with no problem.
Regarding the legacy pci-bridges, the default size is not so clear. I propose to
leave it as is with the following reasoning: On pc 'legacy' machines it is likely we don't need to hotplug virtio-1 'modern' devices, just hotplug virtio 0.9 devices instead.
Some guests, Linux for example, will try to re-balance the PCI root bus MMIO space and assign to pci-bridges/pcie-ports more memory space. Sometimes the guest OS will succeed and sometimes not.
If the mechanism will be accepted upstream, OVMF should use the corresponding fw_cfg to set the size of the pci bridge ranges.
The issue has been solved in upstream QEMU, with a QEMU-only patch. The QEMU item is tracked by clone-origin bug 1365613, so I'm closing this one as a duplicate thereof.
*** This bug has been marked as a duplicate of bug 1365613 ***