diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2021-05-06 11:10:01 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2021-05-10 13:51:11 +0200 |
commit | 9049f8bc445d50c0b5fe5500c0ec51fcc821c2ef (patch) | |
tree | 008e9ac67312a78029a9b3c65d8250b57ef1ede9 /include | |
parent | 35f171a2eb25fcdf1b719c58a61a7da15b4fe078 (diff) | |
download | qemu-9049f8bc445d50c0b5fe5500c0ec51fcc821c2ef.zip qemu-9049f8bc445d50c0b5fe5500c0ec51fcc821c2ef.tar.gz qemu-9049f8bc445d50c0b5fe5500c0ec51fcc821c2ef.tar.bz2 |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/virtio/virtio-gpu.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index fae1492..0d15af4 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -209,7 +209,8 @@ void virtio_gpu_get_edid(VirtIOGPU *g, int virtio_gpu_create_mapping_iov(VirtIOGPU *g, struct virtio_gpu_resource_attach_backing *ab, struct virtio_gpu_ctrl_command *cmd, - uint64_t **addr, struct iovec **iov); + uint64_t **addr, struct iovec **iov, + uint32_t *niov); void virtio_gpu_cleanup_mapping_iov(VirtIOGPU *g, struct iovec *iov, uint32_t count); void virtio_gpu_process_cmdq(VirtIOGPU *g); |