summary refs log tree commit diff stats
path: root/hw/net/virtio-net.c
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2016-11-04 09:39:15 +0100
committerMichael S. Tsirkin <mst@redhat.com>2016-11-15 17:20:38 +0200
commitf1f9e6c5961ffb36fd4a81cd7edcded7bfad2ab2 (patch)
tree5342f6199008f1a422769739bc9237629d6d6439 /hw/net/virtio-net.c
parentcb88ebd7542458c22f3051646f268dcea6109abc (diff)
downloadfocaccia-qemu-f1f9e6c5961ffb36fd4a81cd7edcded7bfad2ab2.tar.gz
focaccia-qemu-f1f9e6c5961ffb36fd4a81cd7edcded7bfad2ab2.zip
vhost: adapt vhost_verify_ring_mappings() to virtio 1 ring layout
With virtio 1, the vring layout is split in 3 separate regions of
contiguous memory for the descriptor table, the available ring and the
used ring, as opposed with legacy virtio which uses a single region.

In case of memory re-mapping, the code ensures it doesn't affect the
vring mapping. This is done in vhost_verify_ring_mappings() which assumes
the device is legacy.

This patch changes vhost_verify_ring_mappings() to check the mappings of
each part of the vring separately.

This works for legacy mappings as well.

Cc: qemu-stable@nongnu.org
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/net/virtio-net.c')
0 files changed, 0 insertions, 0 deletions