Signed-off-by: Gerd Hoffmann kraxel@redhat.com --- src/hw/virtio-pci.c | 5 ++++- src/hw/virtio-pci.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/hw/virtio-pci.c b/src/hw/virtio-pci.c index 58f3d39..3c8fb7b 100644 --- a/src/hw/virtio-pci.c +++ b/src/hw/virtio-pci.c @@ -143,8 +143,11 @@ void vp_init_simple(struct vp_device *vp, struct pci_device *pci) pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf)); }
- vp->ioaddr = pci_config_readl(pci->bdf, PCI_BASE_ADDRESS_0) & + vp->legacy.bar = 0; + vp->legacy.addr = pci_config_readl(pci->bdf, PCI_BASE_ADDRESS_0) & PCI_BASE_ADDRESS_IO_MASK; + vp->legacy.is_io = 1; + vp->ioaddr = vp->legacy.addr; /* temporary */
vp_reset(vp); pci_config_maskw(pci->bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER); diff --git a/src/hw/virtio-pci.h b/src/hw/virtio-pci.h index 467c02f..147e529 100644 --- a/src/hw/virtio-pci.h +++ b/src/hw/virtio-pci.h @@ -124,7 +124,7 @@ struct vp_cap {
struct vp_device { unsigned int ioaddr; - struct vp_cap common, notify, isr, device; + struct vp_cap common, notify, isr, device, legacy; };
static inline u32 vp_get_features(struct vp_device *vp)