Bug 1365619

Summary: [PCI] The default MMIO range reserved by firmware for PCI bridges is not enough to hotplug virtio-1 devices
Product: Red Hat Enterprise Linux 7 Reporter: Marcel Apfelbaum <marcel>
Component: ovmfAssignee: Laszlo Ersek <lersek>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 7.3CC: ailan, mst, virt-bugs, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1365613 Environment:
Last Closed: 2016-09-08 09:39:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1365613, 1365623    
Bug Blocks:    

Description Marcel Apfelbaum 2016-08-09 17:26:21 UTC
+++ 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.  

Side-note:
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.

Comment 1 Marcel Apfelbaum 2016-08-09 17:29:50 UTC
If the mechanism will be accepted upstream, OVMF should use the corresponding fw_cfg to set the size of the pci bridge ranges.

Comment 2 Laszlo Ersek 2016-09-08 09:39:15 UTC
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 ***