mirror of
https://github.com/ipxe/ipxe
synced 2026-06-29 00:07:28 +03:00
[virtio] Ignore capabilities that describe inaccessible PCI BARs
In some configurations, newer versions of QEMU will end up placing the modern interface's BAR4 above 4GB, rendering it inaccessible in a 32-bit build of iPXE. We will currently detect the existence of the modern interface and attempt to use it, but fail at the point of attempting to map the PCI BARs. Fix by ignoring any virtio capabilities that describe an inaccessible PCI BAR, and thereby allowing iPXE to fall back to using the legacy interface if the modern interface's BAR cannot be used. Reported-by: Jan ONDREJ (SAL) <ondrejj@salstar.sk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -409,6 +409,13 @@ static int virtio_pci_cap ( struct virtio_device *virtio,
|
|||||||
if ( reg > PCI_BASE_ADDRESS_5 )
|
if ( reg > PCI_BASE_ADDRESS_5 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* Check BAR accessibility */
|
||||||
|
if ( ! pci_bar_start ( pci, reg ) ) {
|
||||||
|
DBGC ( virtio, "VIRTIO %s capability type %d BAR%d is "
|
||||||
|
"not usable\n", virtio->name, type, cap->bar );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* Success */
|
/* Success */
|
||||||
cap->pos = pos;
|
cap->pos = pos;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user