]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-gpu: handle partial maps properly
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 6 May 2021 09:10:01 +0000 (11:10 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 10 May 2021 11:51:11 +0000 (13:51 +0200)
commit9049f8bc445d50c0b5fe5500c0ec51fcc821c2ef
tree008e9ac67312a78029a9b3c65d8250b57ef1ede9
parent35f171a2eb25fcdf1b719c58a61a7da15b4fe078
virtio-gpu: handle partial maps properly

dma_memory_map() may map only a part of the request.  Happens if the
request can't be mapped in one go, for example due to a iommu creating
a linear dma mapping for scattered physical pages.  Should that be the
case virtio-gpu must call dma_memory_map() again with the remaining
range instead of simply throwing an error.

Note that this change implies the number of iov entries may differ from
the number of mapping entries sent by the guest.  Therefore the iov_len
bookkeeping needs some updates too, we have to explicitly pass around
the iov length now.

Reported-by: Auger Eric <eric.auger@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20210506091001.1301250-1-kraxel@redhat.com
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Message-Id: <20210506091001.1301250-1-kraxel@redhat.com>
hw/display/virtio-gpu-3d.c
hw/display/virtio-gpu.c
include/hw/virtio/virtio-gpu.h