aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2016-09-16 13:01:46 +0200
committerKevin O'Connor <kevin@koconnor.net>2016-09-16 08:30:55 -0400
commitdc2433e35bde0120e1765d8643cdf9e66e496661 (patch)
tree52f61a4270e6b8aab283ce042263b9b996629182
parent8d8d483d524c5a16641b16ad6beab5850cc5a15c (diff)
downloadseabios-dc2433e35bde0120e1765d8643cdf9e66e496661.zip
seabios-dc2433e35bde0120e1765d8643cdf9e66e496661.tar.gz
seabios-dc2433e35bde0120e1765d8643cdf9e66e496661.tar.bz2
virtio: fix virtio-pci
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> Tested-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--src/hw/virtio-pci.c4
1 files 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;