[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2] virtio-pci: enable bus master for old guests
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PATCH v2] virtio-pci: enable bus master for old guests |
Date: |
Wed, 10 Sep 2014 20:30:47 +0300 |
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: address@hidden
Reported-by: Greg Kurz <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
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
- [Qemu-devel] [PATCH v2] virtio-pci: enable bus master for old guests,
Michael S. Tsirkin <=