From: Stefan Hajnoczi <stefanha@gmail.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] dataplane: avoid reentrancy during virtio_blk_data_plane_stop()
Date: Fri, 18 Jan 2013 16:59:05 +0100 [thread overview]
Message-ID: <20130118155905.GA21114@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1358266778-14621-1-git-send-email-stefanha@redhat.com>
On Tue, Jan 15, 2013 at 05:19:38PM +0100, Stefan Hajnoczi wrote:
> When dataplane is stopping, the s->vdev->binding->set_host_notifier(...,
> false) call can invoke the virtqueue handler if an ioeventfd
> notification is pending. This causes hw/virtio-blk.c to invoke
> virtio_blk_data_plane_start() before virtio_blk_data_plane_stop()
> returns!
>
> The result is that we try to restart dataplane while trying to stop it
> and the following assertion is raised:
>
> msix_set_mask_notifier: Assertion `!dev->msix_mask_notifier' failed.
>
> Although the code was intended to prevent this scenario, the s->started
> boolean isn't enough. Add s->stopping so that we can postpone clearing
> s->started until we've completely stopped dataplane.
>
> This way, virtqueue handler calls during virtio_blk_data_plane_stop()
> are ignored. When dataplane is legitimately started again later we
> already self-kick ourselves to resume processing.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> hw/dataplane/virtio-blk.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
Applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
prev parent reply other threads:[~2013-01-18 15:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-15 16:19 [Qemu-devel] [PATCH] dataplane: avoid reentrancy during virtio_blk_data_plane_stop() Stefan Hajnoczi
2013-01-18 15:59 ` Stefan Hajnoczi [this message]
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=20130118155905.GA21114@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=kwolf@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).