[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 10/88] virtio-pci: enable bus master for old guests
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 10/88] virtio-pci: enable bus master for old guests |
Date: |
Thu, 8 Jan 2015 11:33:14 -0600 |
From: "Michael S. Tsirkin" <address@hidden>
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. For the same reason,
rhel6.[56] ppc64 guests cannot boot on a virtio-blk disk anymore.
Old guests forgot to enable bus mastering, enable it automatically on
DRIVER (guests use some devices before DRIVER_OK).
Reported-by: Greg Kurz <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Tested-by: Greg Kurz <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
(cherry picked from commit e43c0b2ea5574efb0bedebf6a7d05916eefeba52)
Signed-off-by: Michael Roth <address@hidden>
---
hw/virtio/virtio-pci.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 3007319..58ebbcf 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -314,6 +314,16 @@ static void virtio_ioport_write(void *opaque, uint32_t
addr, uint32_t val)
msix_unuse_all_vectors(&proxy->pci_dev);
}
+ /* Linux before 2.6.34 drives the device without enabling
+ the PCI device bus master bit. Enable it automatically
+ for the guest. This is a PCI spec violation but so is
+ initiating DMA with bus master bit clear. */
+ if (val == (VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER)) {
+ pci_default_write_config(&proxy->pci_dev, PCI_COMMAND,
+ proxy->pci_dev.config[PCI_COMMAND] |
+ PCI_COMMAND_MASTER, 1);
+ }
+
/* Linux before 2.6.34 sets the device as OK without enabling
the PCI device bus master bit. In this case we need to disable
some safety checks. */
--
1.9.1
- [Qemu-stable] [PATCH 03/88] exec: file_ram_alloc(): print error when prealloc fails, (continued)
- [Qemu-stable] [PATCH 03/88] exec: file_ram_alloc(): print error when prealloc fails, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 08/88] kvmclock: Add comment explaining why we need cpu_clean_all_dirty(), Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 09/88] pci: Use bus master address space for delivering MSI/MSI-X messages, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 07/88] kvmclock: Ensure time in migration never goes backward, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 11/88] spapr_pci: map the MSI window in each PHB, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 01/88] qdev: Use NULL instead of local_err for qbus_child unrealize, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 05/88] Introduce cpu_clean_all_dirty, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 06/88] kvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 04/88] xhci PCIe endpoint migration compatibility fix, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 02/88] qdev: Add cleanup logic in device_set_realized() to avoid resource leak, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 10/88] virtio-pci: enable bus master for old guests,
Michael Roth <=
- [Qemu-stable] [PATCH 13/88] gdbstub: init mon_chr through qemu_chr_alloc, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 15/88] qapi: dealloc visitor, implement visit_start_union, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 12/88] hw/arm/virt: fix pl011 and pl031 irq flags, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 16/88] tests: add QMP input visitor test for unions with no discriminator, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 14/88] qapi: add visit_start_union and visit_end_union, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 17/88] qemu-iotests: Test missing "driver" key for blockdev-add, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 20/88] vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 18/88] monitor: Reset HMP mon->rs in CHR_EVENT_OPEN, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 22/88] ivshmem: validate incoming_posn value from server, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 25/88] pc-dimm: Don't check dimm->node when there is non-NUMA config, Michael Roth, 2015/01/08