[PATCH 0/3] virtio-gpu: Handle empty and failed udmabuf mappings

Akihiko Odaki posted 3 patches 1 month, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260807-dmabuf-v1-0-d24b1331dc8a@rsg.ci.i.u-tokyo.ac.jp
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Dmitry Osipenko <dmitry.osipenko@collabora.com>
include/hw/virtio/virtio-gpu.h        |   2 +-
hw/display/virtio-gpu-udmabuf-stubs.c |   3 +-
hw/display/virtio-gpu-udmabuf.c       |  10 ++--
hw/display/virtio-gpu.c               | 108 +++++++++++++++++++---------------
4 files changed, 70 insertions(+), 53 deletions(-)
[PATCH 0/3] virtio-gpu: Handle empty and failed udmabuf mappings
Posted by Akihiko Odaki 1 month, 3 weeks ago
Virtio blob resources may be created without backing and may also have a
zero size. These valid cases currently reach UDMABUF_CREATE_LIST or
mmap() with empty inputs, producing EINVAL warnings even though no host
mapping is required.

Skip udmabuf setup for deferred backing and avoid mmap() for an empty
blob. Also make udmabuf initialization report construction or mapping
failures. Blob creation and attach-backing commands then reject the
operation and unwind their mappings, while incoming migration fails
before publishing an incomplete resource.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
---
Akihiko Odaki (3):
      hw/display/virtio-gpu: Avoid creating empty udmabuf
      hw/display/virtio-gpu: Avoid mmap() for empty blob
      hw/display/virtio-gpu: Propagate udmabuf errors

 include/hw/virtio/virtio-gpu.h        |   2 +-
 hw/display/virtio-gpu-udmabuf-stubs.c |   3 +-
 hw/display/virtio-gpu-udmabuf.c       |  10 ++--
 hw/display/virtio-gpu.c               | 108 +++++++++++++++++++---------------
 4 files changed, 70 insertions(+), 53 deletions(-)
---
base-commit: 3e3ccab106f879b1512f8e0d51a827dd4de30e22
change-id: 20260806-dmabuf-8945c9b42004

Best regards,
--  
Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Re: [PATCH 0/3] virtio-gpu: Handle empty and failed udmabuf mappings
Posted by marcandre.lureau@redhat.com 1 month, 3 weeks ago
On Fri, 07 Aug 2026 14:20:03 +0900, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> wrote:
> virtio-gpu: Handle empty and failed udmabuf mappings
> 
> Virtio blob resources may be created without backing and may also have a
> zero size. These valid cases currently reach UDMABUF_CREATE_LIST or
> mmap() with empty inputs, producing EINVAL warnings even though no host
> mapping is required.
> 
> [...]

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

-- 
Marc-André Lureau <marcandre.lureau@redhat.com>