From: Eric Northup Date: Wed, 12 Mar 2014 20:42:36 +0000 (-0700) Subject: vp_init_simple: enable PCI bus-mastering before relying on DMA. X-Git-Tag: rel-1.7.5-rc1~31 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=8abc6a895a67b711997fb96beb6b8e7ae47fe059;p=seabios.git vp_init_simple: enable PCI bus-mastering before relying on DMA. An analogous change was made in the LSI scsi driver, commit 7d052575258ad2fc487ca3f9a6b62eff1b767900. Qemu works around guests that don't correctly enable PCI bus mastering before using virtio queues' DMA (search for VIRTIO_PCI_BUG_BUS_MASTER / VIRTIO_PCI_FLAG_BUS_MASTER_BUG ), but it'd be better to be correct. Signed-off-by: Eric Northup --- diff --git a/src/hw/virtio-pci.c b/src/hw/virtio-pci.c index a382504..b9b3ab1 100644 --- a/src/hw/virtio-pci.c +++ b/src/hw/virtio-pci.c @@ -90,6 +90,7 @@ u16 vp_init_simple(u16 bdf) PCI_BASE_ADDRESS_IO_MASK; vp_reset(ioaddr); + pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER); vp_set_status(ioaddr, VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER ); return ioaddr;