]> git.proxmox.com Git - mirror_qemu.git/commit - hw/virtio/vhost.c
vhost: Simplify ring verification checks
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Fri, 19 Jan 2018 10:39:19 +0000 (10:39 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 8 Feb 2018 19:06:40 +0000 (21:06 +0200)
commit0ca1fd2d6878a360c9e3b5be6b0bbe5d3143280e
tree0900e792b42328f8d8501d13b8210d05a663bbef
parentc44317efecb240b9b0951ad46ba56eb547114f1d
vhost: Simplify ring verification checks

vhost_verify_ring_mappings() were used to verify that
rings are still accessible and related memory hasn't
been moved after flatview is updated.

It was doing checks by mapping ring's GPA+len and
checking that HVA hadn't changed with new memory map.
To avoid maybe expensive mapping call, we were
identifying address range that changed and were doing
mapping only if ring was in changed range.

However it's not neccessary to perform ring's GPA
mapping as we already have its current HVA and all
we need is to verify that ring's GPA translates to
the same HVA in updated flatview.

This will allow the following patches to simplify the range
comparison that was previously needed to avoid expensive
verify_ring_mapping calls.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
with modifications by:
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/vhost.c