From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxgjv-0003cN-Qs for qemu-devel@nongnu.org; Fri, 21 Oct 2016 16:48:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxgjp-0008Fu-4T for qemu-devel@nongnu.org; Fri, 21 Oct 2016 16:48:29 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:36815) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bxgjo-0008Dg-TZ for qemu-devel@nongnu.org; Fri, 21 Oct 2016 16:48:25 -0400 Received: by mail-wm0-x243.google.com with SMTP id f193so407550wmg.3 for ; Fri, 21 Oct 2016 13:48:22 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 21 Oct 2016 22:48:04 +0200 Message-Id: <1477082896-26553-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1477082896-26553-1-git-send-email-pbonzini@redhat.com> References: <1477082896-26553-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 01/13] virtio: disable ioeventfd as early as possible List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: cornelia.huck@de.ibm.com, mst@redhat.com, stefanha@redhat.com, famz@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. Reviewed-by: Cornelia Huck Signed-off-by: Paolo Bonzini --- 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. -- 1.8.3.1