From patchwork Fri Apr 1 13:19:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 8724611 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6969EC0553 for ; Fri, 1 Apr 2016 13:24:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9D71C203AE for ; Fri, 1 Apr 2016 13:24:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C734C20303 for ; Fri, 1 Apr 2016 13:24:50 +0000 (UTC) Received: from localhost ([::1]:44366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alz4D-0007ui-SQ for patchwork-qemu-devel@patchwork.kernel.org; Fri, 01 Apr 2016 09:24:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alyzk-00007Q-Ip for qemu-devel@nongnu.org; Fri, 01 Apr 2016 09:20:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alyzg-0001wj-Bl for qemu-devel@nongnu.org; Fri, 01 Apr 2016 09:20:12 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:33488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alyzg-0001wJ-2M for qemu-devel@nongnu.org; Fri, 01 Apr 2016 09:20:08 -0400 Received: by mail-wm0-x242.google.com with SMTP id i204so4581566wmd.0 for ; Fri, 01 Apr 2016 06:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=EibTjCLTcrFqx2wvVkCGAgTfW6hYA/Y9sNpls9OhPYI=; b=wPY6aTEDbfdJbDd0zsY6RqkzImNYE96GyjEBWFTC+9XzU1Bfq6I71hwzIts4OnYUFw OskIA7iIijGe7xupODDcCAnD7NUrINb4LaNpt/iDKllkox7Yn4HMzfBbnNxm+62CIQCo qRijU6ezC2CmEQ8v3629caNV+WMeyQ6r5T7S2oq5lmya2Ff8QfOxJqG+5CwK/438bTjV MpFHU4jmRu3WWDl0I0x0xDhFfybeNCg00Mt2EFE3Xm5+FRCxKeyEWXdPqUMPWeoA8ozT SeJRq1HCKjy8ObBR1HE1UsbCOib6EWw0IrAHqCotefCzOTttbUEAysATYC6mmy774NpU 4O3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=EibTjCLTcrFqx2wvVkCGAgTfW6hYA/Y9sNpls9OhPYI=; b=M2d+JLp71Efy1kDfR5dTXCZUiV6GvQGjtsjRY6LkwWJPXfucuynvb6s3//wmHpH5fz KBeYg3zDeX6LanyZwRMVe2dmJ8jKjCtGkjIeoPL4o5FD55Abd5ICzYYU0JMMFyo23F0j ahn/o7/p1uzAiDz0Dtx2I8E4i4tUYKNj10Su3o4zsRkMuwpSCfunBq3y0LT/X6KsmVph KFShaUqP+wsJ6tokRLISi6dzFLiZBYyNnxIsvcRXvikyHHAoZwMrBMqyHo2lrXePOxvq 6ZMLYD/JMOnal9w/6SmjrQCVx46aIUYuXsLDDcUCieA0xp8LBJsOLZSaFvHhKP+PjkPO UsnA== X-Gm-Message-State: AD7BkJKoPcjebQhGfenDLi+JO/3moZ2dkzcLOz/mrx+YHdKmjBPXDwX2styHgBk32Z9cfw== X-Received: by 10.194.24.39 with SMTP id r7mr4348303wjf.86.1459516807568; Fri, 01 Apr 2016 06:20:07 -0700 (PDT) Received: from 640k.lan (94-39-141-76.adsl-ull.clienti.tiscali.it. [94.39.141.76]) by smtp.gmail.com with ESMTPSA id a1sm14032334wje.43.2016.04.01.06.20.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Apr 2016 06:20:06 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 1 Apr 2016 15:19:54 +0200 Message-Id: <1459516794-23629-10-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1459516794-23629-1-git-send-email-pbonzini@redhat.com> References: <1459516794-23629-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::242 Cc: famz@redhat.com, tubo@linux.vnet.ibm.com, mst@redhat.com, borntraeger@de.ibm.com, stefanha@redhat.com, cornelia.huck@de.ibm.com Subject: [Qemu-devel] [PATCH 9/9] virtio: remove starting/stopping checks X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reentrancy cannot happen while the BQL is being held. Reviewed-by: Cornelia Huck Signed-off-by: Paolo Bonzini --- hw/block/dataplane/virtio-blk.c | 12 ++---------- hw/scsi/virtio-scsi-dataplane.c | 9 +-------- include/hw/virtio/virtio-scsi.h | 2 -- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index 74c6d37..cb00cdc 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -27,9 +27,6 @@ #include "qom/object_interfaces.h" struct VirtIOBlockDataPlane { - bool starting; - bool stopping; - VirtIOBlkConf *conf; VirtIODevice *vdev; @@ -203,11 +200,10 @@ void virtio_blk_data_plane_start(VirtIOBlockDataPlane *s) VirtIOBlock *vblk = VIRTIO_BLK(s->vdev); int r; - if (vblk->dataplane_started || s->starting) { + if (vblk->dataplane_started) { return; } - s->starting = true; s->vq = virtio_get_queue(s->vdev, 0); /* Set up guest notifier (irq) */ @@ -226,7 +222,6 @@ void virtio_blk_data_plane_start(VirtIOBlockDataPlane *s) goto fail_host_notifier; } - s->starting = false; vblk->dataplane_started = true; trace_virtio_blk_data_plane_start(s); @@ -246,7 +241,6 @@ void virtio_blk_data_plane_start(VirtIOBlockDataPlane *s) k->set_guest_notifiers(qbus->parent, 1, false); fail_guest_notifiers: vblk->dataplane_disabled = true; - s->starting = false; vblk->dataplane_started = true; } @@ -257,7 +251,7 @@ void virtio_blk_data_plane_stop(VirtIOBlockDataPlane *s) VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); VirtIOBlock *vblk = VIRTIO_BLK(s->vdev); - if (!vblk->dataplane_started || s->stopping) { + if (!vblk->dataplane_started) { return; } @@ -267,7 +261,6 @@ void virtio_blk_data_plane_stop(VirtIOBlockDataPlane *s) vblk->dataplane_started = false; return; } - s->stopping = true; trace_virtio_blk_data_plane_stop(s); aio_context_acquire(s->ctx); @@ -286,5 +279,4 @@ void virtio_blk_data_plane_stop(VirtIOBlockDataPlane *s) k->set_guest_notifiers(qbus->parent, 1, false); vblk->dataplane_started = false; - s->stopping = false; } diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c index 5494dcc..7511447 100644 --- a/hw/scsi/virtio-scsi-dataplane.c +++ b/hw/scsi/virtio-scsi-dataplane.c @@ -115,14 +115,11 @@ void virtio_scsi_dataplane_start(VirtIOSCSI *s) VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s); if (s->dataplane_started || - s->dataplane_starting || s->dataplane_fenced || s->ctx != iothread_get_aio_context(vs->conf.iothread)) { return; } - s->dataplane_starting = true; - /* Set up guest notifier (irq) */ rc = k->set_guest_notifiers(qbus->parent, vs->conf.num_queues + 2, true); if (rc != 0) { @@ -150,7 +147,6 @@ void virtio_scsi_dataplane_start(VirtIOSCSI *s) } } - s->dataplane_starting = false; s->dataplane_started = true; aio_context_release(s->ctx); return; @@ -164,7 +160,6 @@ fail_vrings: k->set_guest_notifiers(qbus->parent, vs->conf.num_queues + 2, false); fail_guest_notifiers: s->dataplane_fenced = true; - s->dataplane_starting = false; s->dataplane_started = true; } @@ -176,7 +171,7 @@ void virtio_scsi_dataplane_stop(VirtIOSCSI *s) VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s); int i; - if (!s->dataplane_started || s->dataplane_stopping) { + if (!s->dataplane_started) { return; } @@ -186,7 +181,6 @@ void virtio_scsi_dataplane_stop(VirtIOSCSI *s) s->dataplane_started = false; return; } - s->dataplane_stopping = true; assert(s->ctx == iothread_get_aio_context(vs->conf.iothread)); aio_context_acquire(s->ctx); @@ -203,6 +197,5 @@ void virtio_scsi_dataplane_stop(VirtIOSCSI *s) /* Clean up guest notifier (irq) */ k->set_guest_notifiers(qbus->parent, vs->conf.num_queues + 2, false); - s->dataplane_stopping = false; s->dataplane_started = false; } diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h index ba2f5ce..d5352d8 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -89,8 +89,6 @@ typedef struct VirtIOSCSI { QTAILQ_HEAD(, VirtIOSCSIBlkChangeNotifier) remove_notifiers; bool dataplane_started; - bool dataplane_starting; - bool dataplane_stopping; bool dataplane_fenced; Error *blocker; uint32_t host_features;