Skip to content
Commit 667ac704 authored by Alexandru Elisei's avatar Alexandru Elisei
Browse files

vfio: pci: Allocate correct size for MSIX table and PBA BARs

kvmtool assumes that the BAR that holds the address for the MSIX table
and PBA structure has a size which is equal to the total size of the
table and the PBA structure and it allocates memory from MMIO space
accordingly.  However, when initializing the BARs, the BAR size is set
according to the region size reported by VFIO. When the physical BAR
size is greater than what kvmtool allocated, we can have a situation
where the BAR overlaps with another BAR, in which case kvmtool will fail
to map the memory. This was found when trying to do PCI passthrough on a
PCIe Realtek r8168 NIC.  Let's fix this by allocating an amount of MMIO
memory equal to table + PBA size or BAR size, whichever is greater.
parent e07a44d2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment