From: Jason Wang <jasowang@redhat.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH] virtio: unbreak 1.0 device load with region cache
Date: Fri, 3 Mar 2017 17:39:27 +0800 [thread overview]
Message-ID: <b84a57c6-e03c-1309-adef-797f506536b3@redhat.com> (raw)
In-Reply-To: <20170303101517.20dd05f9.cornelia.huck@de.ibm.com>
On 2017年03月03日 17:15, Cornelia Huck wrote:
> 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).
>
>
Somehow miss this patch. Yes, it should.
Thanks
prev parent reply other threads:[~2017-03-03 9:39 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
2017-03-03 9:39 ` Jason Wang [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=b84a57c6-e03c-1309-adef-797f506536b3@redhat.com \
--to=jasowang@redhat.com \
--cc=cornelia.huck@de.ibm.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).