Skip to content

Commit

Permalink
virtio: invalidate memory in vring_set_avail_event()
Browse files Browse the repository at this point in the history
Remember to invalidate the avail event field so the memory pages are
marked dirty.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
  • Loading branch information
stefanhaRH authored and mstsirkin committed Mar 2, 2017
1 parent 34c6bf2 commit 3cdf847
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hw/virtio/virtio.c
Expand Up @@ -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)
Expand Down

0 comments on commit 3cdf847

Please sign in to comment.