From 3cdf847329a9911780372e6d8239839446d09d9f Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Wed, 22 Feb 2017 16:37:33 +0000 Subject: [PATCH] virtio: invalidate memory in vring_set_avail_event() Remember to invalidate the avail event field so the memory pages are marked dirty. Cc: Paolo Bonzini Signed-off-by: Stefan Hajnoczi Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Tested-by: Eric Auger --- hw/virtio/virtio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index bf8a644677..294c909cce 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -282,6 +282,7 @@ static inline void vring_set_avail_event(VirtQueue *vq, uint16_t val) caches = atomic_rcu_read(&vq->vring.caches); pa = offsetof(VRingUsed, ring[vq->vring.num]); virtio_stw_phys_cached(vq->vdev, &caches->used, pa, val); + address_space_cache_invalidate(&caches->used, pa, sizeof(val)); } void virtio_queue_set_notification(VirtQueue *vq, int enable)