[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/47] virtio: disable ioeventfd as early as possible
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 03/47] virtio: disable ioeventfd as early as possible |
Date: |
Sun, 30 Oct 2016 23:23:26 +0200 |
From: Paolo Bonzini <address@hidden>
Avoid "tricking" virtio-blk-dataplane into thinking that ioeventfd will be
available when it is not. This bug has always been there, but it will break
TCG+ioeventfd=on once the dataplane code will be always used when ioeventfd=on.
Reviewed-by: Cornelia Huck <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/s390x/virtio-ccw.c | 8 ++++----
hw/virtio/virtio-pci.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index ee136ab..31304fe 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -709,6 +709,10 @@ static void virtio_ccw_device_realize(VirtioCcwDevice
*dev, Error **errp)
sch->cssid, sch->ssid, sch->schid, sch->devno,
ccw_dev->bus_id.valid ? "user-configured" : "auto-configured");
+ if (!kvm_eventfds_enabled()) {
+ dev->flags &= ~VIRTIO_CCW_FLAG_USE_IOEVENTFD;
+ }
+
if (k->realize) {
k->realize(dev, &err);
}
@@ -1311,10 +1315,6 @@ static void virtio_ccw_device_plugged(DeviceState *d,
Error **errp)
return;
}
- if (!kvm_eventfds_enabled()) {
- dev->flags &= ~VIRTIO_CCW_FLAG_USE_IOEVENTFD;
- }
-
sch->id.cu_model = virtio_bus_get_vdev_id(&dev->bus);
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 06831de..29896d8 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1719,10 +1719,6 @@ static void virtio_pci_device_plugged(DeviceState *d,
Error **errp)
pci_register_bar(&proxy->pci_dev, proxy->legacy_io_bar_idx,
PCI_BASE_ADDRESS_SPACE_IO, &proxy->bar);
}
-
- if (!kvm_has_many_ioeventfds()) {
- proxy->flags &= ~VIRTIO_PCI_FLAG_USE_IOEVENTFD;
- }
}
static void virtio_pci_device_unplugged(DeviceState *d)
@@ -1751,6 +1747,10 @@ static void virtio_pci_realize(PCIDevice *pci_dev, Error
**errp)
bool pcie_port = pci_bus_is_express(pci_dev->bus) &&
!pci_bus_is_root(pci_dev->bus);
+ if (!kvm_has_many_ioeventfds()) {
+ proxy->flags &= ~VIRTIO_PCI_FLAG_USE_IOEVENTFD;
+ }
+
/*
* virtio pci bar layout used by default.
* subclasses can re-arrange things if needed.
--
MST
- [Qemu-devel] [PULL 00/47] virtio, pc: fixes and features, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 01/47] virtio/migration: Add VMStateDescription to VirtioDeviceClass, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 02/47] virtio/migration: Migrate balloon to VMState, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 03/47] virtio: disable ioeventfd as early as possible,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 04/47] virtio: move ioeventfd_disabled flag to VirtioBusState, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 05/47] virtio: move ioeventfd_started flag to VirtioBusState, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 06/47] virtio: add start_ioeventfd and stop_ioeventfd to VirtioDeviceClass, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 07/47] virtio: introduce virtio_device_ioeventfd_enabled, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 09/47] virtio-scsi: always use dataplane path if ioeventfd is active, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 08/47] virtio-blk: always use dataplane path if ioeventfd is active, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 10/47] Revert "virtio: Introduce virtio_add_queue_aio", Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 11/47] virtio: remove set_handler argument from set_host_notifier_internal, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 12/47] virtio: remove ioeventfd_disabled altogether, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 13/47] virtio: use virtio_bus_set_host_notifier to start/stop ioeventfd, Michael S. Tsirkin, 2016/10/30