qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: stefanha@redhat.com, borntraeger@de.ibm.com,
	cornelia.huck@de.ibm.com, famz@redhat.com, mst@redhat.com
Subject: [Qemu-devel] [PATCH 01/13] virtio: disable ioeventfd as early as possible
Date: Mon, 10 Oct 2016 13:53:29 +0200	[thread overview]
Message-ID: <1476100421-28772-2-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1476100421-28772-1-git-send-email-pbonzini@redhat.com>

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.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 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 2d60a00..b93e2df 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,
                          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.
-- 
2.7.4

  reply	other threads:[~2016-10-10 11:54 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10 11:53 [Qemu-devel] [PATCH 00/12] virtio: cleanup ioeventfd start/stop Paolo Bonzini
2016-10-10 11:53 ` Paolo Bonzini [this message]
2016-10-18 17:17   ` [Qemu-devel] [PATCH 01/13] virtio: disable ioeventfd as early as possible Cornelia Huck
2016-10-21 15:18   ` Stefan Hajnoczi
2016-10-10 11:53 ` [Qemu-devel] [PATCH 02/13] virtio: move ioeventfd_disabled flag to VirtioBusState Paolo Bonzini
2016-10-18 17:18   ` Cornelia Huck
2016-10-10 11:53 ` [Qemu-devel] [PATCH 03/13] virtio: move ioeventfd_started " Paolo Bonzini
2016-10-18 17:22   ` Cornelia Huck
2016-10-10 11:53 ` [Qemu-devel] [PATCH 04/13] virtio: add start_ioeventfd and stop_ioeventfd to VirtioDeviceClass Paolo Bonzini
2016-10-19  9:17   ` Cornelia Huck
2016-10-10 11:53 ` [Qemu-devel] [PATCH 05/13] virtio: introduce virtio_device_ioeventfd_enabled Paolo Bonzini
2016-10-19  9:19   ` Cornelia Huck
2016-10-10 11:53 ` [Qemu-devel] [PATCH 06/13] virtio-blk: always use dataplane path if ioeventfd is active Paolo Bonzini
2016-10-19 10:48   ` Cornelia Huck
2016-10-19 11:34     ` Cornelia Huck
2016-10-10 11:53 ` [Qemu-devel] [PATCH 07/13] virtio-scsi: " Paolo Bonzini
2016-10-19 10:51   ` Cornelia Huck
2016-10-19 11:34     ` Cornelia Huck
2016-10-10 11:53 ` [Qemu-devel] [PATCH 08/13] Revert "virtio: Introduce virtio_add_queue_aio" Paolo Bonzini
2016-10-19 10:52   ` Cornelia Huck
2016-10-10 11:53 ` [Qemu-devel] [PATCH 09/13] virtio: remove set_handler argument from set_host_notifier_internal Paolo Bonzini
2016-10-19 11:05   ` Cornelia Huck
2016-10-10 11:53 ` [Qemu-devel] [PATCH 10/13] virtio: remove ioeventfd_disabled altogether Paolo Bonzini
2016-10-19 11:10   ` Cornelia Huck
2016-10-10 11:53 ` [Qemu-devel] [PATCH 11/13] virtio: use virtio_bus_set_host_notifier to start/stop ioeventfd Paolo Bonzini
2016-10-19 11:12   ` Cornelia Huck
2016-10-10 11:53 ` [Qemu-devel] [PATCH 12/13] virtio: inline virtio_queue_set_host_notifier_fd_handler Paolo Bonzini
2016-10-19 11:22   ` Cornelia Huck
2016-10-10 11:53 ` [Qemu-devel] [PATCH 13/13] virtio: inline set_host_notifier_internal Paolo Bonzini
2016-10-19 11:26   ` Cornelia Huck
2016-10-18 17:24 ` [Qemu-devel] [PATCH 00/12] virtio: cleanup ioeventfd start/stop Cornelia Huck
2016-10-18 21:47   ` Paolo Bonzini
2016-10-19 12:17 ` Cornelia Huck
2016-10-19 15:38   ` Cornelia Huck
2016-10-19 20:44     ` Paolo Bonzini
2016-10-20  9:03       ` Cornelia Huck
2016-10-20 16:53         ` Paolo Bonzini
2016-10-21  8:45           ` Cornelia Huck
  -- strict thread matches above, loose matches on Subject: below --
2016-10-21 20:48 [Qemu-devel] [PATCH v3 00/13] " Paolo Bonzini
2016-10-21 20:48 ` [Qemu-devel] [PATCH 01/13] virtio: disable ioeventfd as early as possible Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1476100421-28772-2-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=famz@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).