qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] virtio: unbreak 1.0 device load with region cac


From: Cornelia Huck
Subject: Re: [Qemu-devel] [PATCH] virtio: unbreak 1.0 device load with region cache
Date: Fri, 3 Mar 2017 10:15:17 +0100

On Fri,  3 Mar 2017 16:51:28 +0800
Jason Wang <address@hidden> 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 <address@hidden>
> Signed-off-by: Jason Wang <address@hidden>
> ---
>  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).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]