qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: "Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Amit Shah <amit@kernel.org>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] virtio-rng: stop virtqueue while the CPU is stopped
Date: Tue, 11 Apr 2017 18:02:50 +0100	[thread overview]
Message-ID: <20170411170250.GF5940@stefanha-x1.localdomain> (raw)
In-Reply-To: <20170411131733.27542-3-lvivier@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 880 bytes --]

On Tue, Apr 11, 2017 at 03:17:33PM +0200, Laurent Vivier wrote:
> diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c
> index 9639f4e..d270d56 100644
> --- a/hw/virtio/virtio-rng.c
> +++ b/hw/virtio/virtio-rng.c
> @@ -53,6 +53,15 @@ static void chr_read(void *opaque, const void *buf, size_t size)
>          return;
>      }
>  
> +    /* we can't modify the virtqueue until
> +     * our state is fully synced
> +     */
> +
> +    if (!runstate_check(RUN_STATE_RUNNING)) {
> +        trace_virtio_rng_cpu_is_stopped(vrng);
> +        return;
> +    }
> +

I'm concerned about what happens when the guest is stopped and resumed
(e.g. 'stop' and 'cont' monitor commands).  Since we throw away the
chr_read() callback the device will hang unless the guest kicks it
again?

It's not clear to me that the rate limit timer will help us...

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2017-04-11 17:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11 13:17 [Qemu-devel] [PATCH 0/2] migration: fix virtio-rng Laurent Vivier
2017-04-11 13:17 ` [Qemu-devel] [PATCH 1/2] migration: don't close a file descriptor while it can be in use Laurent Vivier
2017-04-11 13:17 ` [Qemu-devel] [PATCH 2/2] virtio-rng: stop virtqueue while the CPU is stopped Laurent Vivier
2017-04-11 17:02   ` Stefan Hajnoczi [this message]
2017-04-11 17:42     ` Laurent Vivier
2017-04-12  9:57       ` Stefan Hajnoczi

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=20170411170250.GF5940@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=amit@kernel.org \
    --cc=dgilbert@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).