On Fri, 16 Sep 2016 13:01:46 +0200 Gerd Hoffmann kraxel@redhat.com wrote:
virtio-pci calls pci_enable_{io,mem}bar with the bar number, but the functions expect the bar base register offset.
Reported-by: Igor Mammedov imammedo@redhat.com Signed-off-by: Gerd Hoffmann kraxel@redhat.com
Fixes issue for me
Tested-by: Igor Mammedov imammedo@redhat.com
src/hw/virtio-pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hw/virtio-pci.c b/src/hw/virtio-pci.c index 8efc826..e5c2c33 100644 --- a/src/hw/virtio-pci.c +++ b/src/hw/virtio-pci.c @@ -449,7 +449,7 @@ void vp_init_simple(struct vp_device *vp, struct pci_device *pci) switch (vp_cap->mode) { case VP_ACCESS_IO: {
u32 addr = pci_enable_iobar(pci, vp_cap->bar);
u32 addr = pci_enable_iobar(pci, base); if (!addr) return; vp_cap->ioaddr = addr + offset;
@@ -458,7 +458,7 @@ void vp_init_simple(struct vp_device *vp, struct pci_device *pci) } case VP_ACCESS_MMIO: {
void *addr = pci_enable_membar(pci, vp_cap->bar);
void *addr = pci_enable_membar(pci, base); if (!addr) return; vp_cap->memaddr = addr + offset;