[Top][All Lists]

[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: Jason Wang
Subject: Re: [Qemu-devel] [PATCH] virtio: unbreak 1.0 device load with region cache
Date: Fri, 3 Mar 2017 17:39:27 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

On 2017年03月03日 17:15, Cornelia Huck wrote:
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 

      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]) - 
"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.


reply via email to

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