From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Jason Wang <jasowang@redhat.com>
Cc: mst@redhat.com, qemu-devel@nongnu.org,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] virtio: unbreak 1.0 device load with region cache
Date: Fri, 3 Mar 2017 10:15:17 +0100 [thread overview]
Message-ID: <20170303101517.20dd05f9.cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1488531088-12483-1-git-send-email-jasowang@redhat.com>
On Fri, 3 Mar 2017 16:51:28 +0800
Jason Wang <jasowang@redhat.com> wrote:
> Current code depends on virtio_queue_update_rings() to setup address
> space cache. But this does not work for 1.0 device since we can't infer
> avail and used. Fixing this by calling virtio_init_region_cache()
> after subsections load which can guarantee avail and used are correct.
>
> Fixes: 97cd965c0701 ("virtio: use VRingMemoryRegionCaches for avail
> and used rings")
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> hw/virtio/virtio.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 23483c7..faa45cb 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -2059,6 +2059,7 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id)
>
> rcu_read_lock();
> for (i = 0; i < num; i++) {
> + virtio_init_region_cache(vdev, i);
> if (vdev->vq[i].vring.desc) {
> uint16_t nheads;
> nheads = vring_avail_idx(&vdev->vq[i]) - vdev->vq[i].last_avail_idx;
"virtio: add missing region cache init in virtio_load()" should take
care of that (but has not been pulled yet, it seems).
next prev parent reply other threads:[~2017-03-03 9:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 8:51 [Qemu-devel] [PATCH] virtio: unbreak 1.0 device load with region cache Jason Wang
2017-03-03 9:02 ` no-reply
2017-03-03 9:18 ` Fam Zheng
2017-03-03 9:45 ` Jason Wang
2017-03-03 9:15 ` Cornelia Huck [this message]
2017-03-03 9:39 ` Jason Wang
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=20170303101517.20dd05f9.cornelia.huck@de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@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).