Commit c10de1ca authored by Alexandru Elisei's avatar Alexandru Elisei
Browse files

vfio: pci: Don't assume that only even numbered BARs are 64bit

Not all devices have the bottom 32 bits of a 64 bit BAR in an even
numbered BAR. For example, on an NVIDIA Quadro P400, BARs 1 and 3 are
64bit. Remove this assumption.
parent 667ac704
......@@ -927,8 +927,10 @@ static int vfio_pci_configure_dev_regions(struct kvm *kvm,
for (i = VFIO_PCI_BAR0_REGION_INDEX; i <= VFIO_PCI_BAR5_REGION_INDEX; ++i) {
/* Ignore top half of 64-bit BAR */
if (i % 2 && is_64bit)
if (is_64bit) {
is_64bit = false;
continue;
}
ret = vfio_pci_configure_bar(kvm, vdev, i);
if (ret)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment