On 2017年03月03日 17:15, Cornelia Huck wrote:
On Fri, 3 Mar 2017 16:51:28 +0800 Jason Wang <[email protected]> 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 <[email protected]> Signed-off-by: Jason Wang <[email protected]> --- 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
