qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] virtio-pci: enable bus master for old guests
@ 2014-09-10 17:30 Michael S. Tsirkin
  2014-09-11 16:00 ` Greg Kurz
  0 siblings, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2014-09-10 17:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Anthony Liguori

commit cc943c36faa192cd4b32af8fe5edb31894017d35
    pci: Use bus master address space for delivering MSI/MSI-X messages
breaks virtio-net for rhel6.[56] x86 guests because they don't
enable bus mastering for virtio PCI devices

Old guests forgot to enable bus mastering, enable it
automatically when driver discovers device.

Cc: qemu-stable@nongnu.org
Reported-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---

OK, this should have better luck.
This also makes it possible to simplify code,
will do that in a follow-up patch.


 hw/virtio/virtio-pci.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index ddb5da1..a29d94f 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -303,6 +303,14 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)
             virtio_pci_stop_ioeventfd(proxy);
         }
 
+        /* Linux before 2.6.34 uses the device without enabling
+           the PCI device bus master bit. As a work-around, enable it
+           automatically when driver detects the device. */
+        if (val == VIRTIO_CONFIG_S_ACKNOWLEDGE) {
+            memory_region_set_enabled(&proxy->pci_dev.bus_master_enable_region,
+                                      true);
+        }
+
         virtio_set_status(vdev, val & 0xFF);
 
         if (val & VIRTIO_CONFIG_S_DRIVER_OK) {
-- 
MST

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-09-11 17:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-10 17:30 [Qemu-devel] [PATCH v2] virtio-pci: enable bus master for old guests Michael S. Tsirkin
2014-09-11 16:00 ` Greg Kurz
2014-09-11 16:49   ` Michael S. Tsirkin
2014-09-11 17:52   ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).