From: Huang Rui <ray.huang@amd.com>
To: "Gerd Hoffmann" <kraxel@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
"Akihiko Odaki" <akihiko.odaki@daynix.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Anthony PERARD" <anthony.perard@citrix.com>,
"Antonio Caggiano" <quic_acaggian@quicinc.com>,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
"Robert Beckett" <bob.beckett@collabora.com>,
"Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
qemu-devel@nongnu.org
Cc: xen-devel@lists.xenproject.org,
"Gurchetan Singh" <gurchetansingh@chromium.org>,
"Albert Esteve" <aesteve@redhat.com>,
ernunes@redhat.com, "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Alyssa Ross" <hi@alyssa.is>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Xenia Ragiadakou" <xenia.ragiadakou@amd.com>,
"Pierre-Eric Pelloux-Prayer" <pierre-eric.pelloux-prayer@amd.com>,
"Honglei Huang" <honglei1.huang@amd.com>,
"Julia Zhang" <julia.zhang@amd.com>,
"Chen Jiqian" <Jiqian.Chen@amd.com>,
"Huang Rui" <ray.huang@amd.com>
Subject: [QEMU PATCH v5 00/13] Support blob memory and venus on qemu
Date: Fri, 15 Sep 2023 19:11:17 +0800 [thread overview]
Message-ID: <20230915111130.24064-1-ray.huang@amd.com> (raw)
Hi all,
Antonio Caggiano made the venus with QEMU on KVM platform last
September[1]. This series are inherited from his original work to support
the features of context init, hostmem, resource uuid, and blob resources
for venus.
At March of this year, we sent out the V1 version[2] for the review. But
those series are included both xen and virtio gpu. Right now, we would like
to divide into two parts, one is to continue the Antonio's work to upstream
virtio-gpu support for blob memory and venus, and another is to upstream
xen specific patches. This series is focusing on virtio-gpu, so we are
marking as V4 version here to continue Antonio's patches[1]. And we will
send xen specific patches separately, because they are hypervisor specific.
Besides of QEMU, these supports also included virglrenderer[3][4] and
mesa[5][6] as well. Right now, virglrenderer and mesa parts are all
accepted by upstream. In this qemu version, we try to address the concerns
around not proper cleanup during blob resource unmap and unref. Appreciate
it if you have any commments.
[1] https://lore.kernel.org/qemu-devel/20220926142422.22325-1-antonio.caggiano@collabora.com/
[2] V1: https://lore.kernel.org/qemu-devel/20230312092244.451465-1-ray.huang@amd.com
[3] https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1068
[4] https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1180
[5] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22108
[6] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23680
Please note the first 4 patches 1 -> 4 are inlcuded in these series because
the series depends on them and not because we want them to be reviewed
since they are already in the process of review through the "rutabaga_gfx +
gfxstream" series.
- https://lore.kernel.org/qemu-devel/20230829003629.410-1-gurchetansingh@chromium.org/
V4: https://lore.kernel.org/qemu-devel/20230831093252.2461282-1-ray.huang@amd.com
Changes from V4 (virtio gpu V4) to V5
- Inverted patch 5 and 6 because we should configure
HAVE_VIRGL_CONTEXT_INIT firstly.
- Validate owner of memory region to avoid slowing down DMA.
- Use memory_region_init_ram_ptr() instead of
memory_region_init_ram_device_ptr().
- Adjust sequence to allocate gpu resource before virglrender resource
creation
- Add virtio migration handling for uuid.
- Send kernel patch to define VIRTIO_GPU_CAPSET_VENUS.
https://lore.kernel.org/lkml/20230915105918.3763061-1-ray.huang@amd.com/
- Add meson check to make sure unstable APIs defined from 0.9.0.
Changes from V1 to V2 (virtio gpu V4)
- Remove unused #include "hw/virtio/virtio-iommu.h"
- Add a local function, called virgl_resource_destroy(), that is used
to release a vgpu resource on error paths and in resource_unref.
- Remove virtio_gpu_virgl_resource_unmap from
virtio_gpu_cleanup_mapping(),
since this function won't be called on blob resources and also because
blob resources are unmapped via virgl_cmd_resource_unmap_blob().
- In virgl_cmd_resource_create_blob(), do proper cleanup in error paths
and move QTAILQ_INSERT_HEAD(&g->reslist, res, next) after the resource
has been fully initialized.
- Memory region has a different life-cycle from virtio gpu resources
i.e. cannot be released synchronously along with the vgpu resource.
So, here the field "region" was changed to a pointer and is allocated
dynamically when the blob is mapped.
Also, since the pointer can be used to indicate whether the blob
is mapped, the explicite field "mapped" was removed.
- In virgl_cmd_resource_map_blob(), add check on the value of
res->region, to prevent beeing called twice on the same resource.
- Add a patch to enable automatic deallocation of memory regions to resolve
use-after-free memory corruption with a reference.
References
Demo with Venus:
- https://static.sched.com/hosted_files/xen2023/3f/xen_summit_2023_virtgpu_demo.mp4
QEMU repository:
- https://gitlab.freedesktop.org/rui/qemu-xen/-/commits/upstream-for-virtio-gpu
Thanks,
Ray
Antonio Caggiano (6):
virtio-gpu: CONTEXT_INIT feature
virtio-gpu: blob prep
virtio-gpu: Handle resource blob commands
virtio-gpu: Resource UUID
virtio-gpu: Support Venus capset
virtio-gpu: Initialize Venus
Dmitry Osipenko (1):
virtio-gpu: Don't require udmabuf when blobs and virgl are enabled
Dr. David Alan Gilbert (1):
virtio: Add shared memory capability
Gerd Hoffmann (1):
virtio-gpu: hostmem
Huang Rui (3):
virtio-gpu: Configure context init for virglrenderer
virtio-gpu: Support context init feature with virglrenderer
virtio-gpu: Enable virglrenderer render server flag for venus
Xenia Ragiadakou (1):
softmmu/memory: enable automatic deallocation of memory regions
hw/display/trace-events | 1 +
hw/display/virtio-gpu-base.c | 5 +
hw/display/virtio-gpu-pci.c | 14 ++
hw/display/virtio-gpu-virgl.c | 272 ++++++++++++++++++++++++++-
hw/display/virtio-gpu.c | 78 +++++++-
hw/display/virtio-vga.c | 33 +++-
hw/virtio/virtio-pci.c | 18 ++
include/hw/virtio/virtio-gpu-bswap.h | 15 ++
include/hw/virtio/virtio-gpu.h | 24 +++
include/hw/virtio/virtio-pci.h | 4 +
meson.build | 13 ++
softmmu/memory.c | 5 +
12 files changed, 458 insertions(+), 24 deletions(-)
--
2.34.1
next reply other threads:[~2023-09-15 11:18 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-15 11:11 Huang Rui [this message]
2023-09-15 11:11 ` [QEMU PATCH v5 01/13] virtio: Add shared memory capability Huang Rui
2023-09-15 11:11 ` [QEMU PATCH v5 02/13] virtio-gpu: CONTEXT_INIT feature Huang Rui
2023-09-15 11:11 ` [QEMU PATCH v5 03/13] virtio-gpu: hostmem Huang Rui
2023-09-15 11:11 ` [QEMU PATCH v5 04/13] virtio-gpu: blob prep Huang Rui
2023-09-15 11:11 ` [QEMU PATCH v5 05/13] virtio-gpu: Configure context init for virglrenderer Huang Rui
2023-09-19 8:17 ` Marc-André Lureau
2023-09-20 8:04 ` Huang Rui
2023-10-10 11:41 ` Dmitry Osipenko
2023-10-10 11:51 ` Daniel P. Berrangé
2023-10-17 17:46 ` Dmitry Osipenko
2023-09-15 11:11 ` [QEMU PATCH v5 06/13] virtio-gpu: Support context init feature with virglrenderer Huang Rui
2023-09-15 15:20 ` Akihiko Odaki
2023-09-16 10:32 ` Huang Rui
2023-09-16 10:42 ` Akihiko Odaki
2023-09-17 5:45 ` Huang Rui
2023-09-17 5:49 ` Akihiko Odaki
2023-09-18 5:43 ` Huang Rui
2023-09-18 6:07 ` Akihiko Odaki
2023-09-18 6:20 ` Huang Rui
2023-09-18 6:22 ` Akihiko Odaki
2023-09-15 16:58 ` Akihiko Odaki
2023-09-16 10:36 ` Huang Rui
2023-09-15 11:11 ` [QEMU PATCH v5 07/13] softmmu/memory: enable automatic deallocation of memory regions Huang Rui
2023-09-15 15:11 ` Akihiko Odaki
2023-09-19 10:28 ` Xenia Ragiadakou
2023-09-19 10:44 ` Akihiko Odaki
2023-09-19 14:21 ` Xenia Ragiadakou
2023-09-19 22:18 ` Akihiko Odaki
2023-09-20 8:57 ` Xenia Ragiadakou
2023-09-20 10:18 ` Akihiko Odaki
2023-09-15 11:11 ` [QEMU PATCH v5 08/13] virtio-gpu: Don't require udmabuf when blobs and virgl are enabled Huang Rui
2023-09-15 11:11 ` [QEMU PATCH v5 09/13] virtio-gpu: Handle resource blob commands Huang Rui
2023-09-15 16:04 ` Akihiko Odaki
2023-09-15 16:37 ` Akihiko Odaki
2023-09-20 5:50 ` Huang Rui via
2023-09-20 5:54 ` Akihiko Odaki
2023-09-20 6:11 ` Huang Rui via
2023-09-18 8:36 ` Huang Rui
2023-09-18 8:39 ` Akihiko Odaki
2023-09-19 8:44 ` Marc-André Lureau
2023-09-20 8:41 ` Huang Rui
2023-09-15 11:11 ` [QEMU PATCH v5 10/13] virtio-gpu: Resource UUID Huang Rui
2023-09-15 16:48 ` Akihiko Odaki
2023-09-20 7:55 ` Huang Rui
2023-09-19 9:00 ` Marc-André Lureau
2023-09-20 10:00 ` Huang Rui
2023-09-15 11:11 ` [QEMU PATCH v5 11/13] virtio-gpu: Support Venus capset Huang Rui
2023-09-19 9:02 ` Marc-André Lureau
2023-09-20 10:06 ` Huang Rui
2023-09-15 11:11 ` [QEMU PATCH v5 12/13] virtio-gpu: Initialize Venus Huang Rui
2023-10-10 12:10 ` Dmitry Osipenko
2023-09-15 11:11 ` [QEMU PATCH v5 13/13] virtio-gpu: Enable virglrenderer render server flag for venus Huang Rui
2023-10-10 11:48 ` Dmitry Osipenko
2023-10-10 11:57 ` [QEMU PATCH v5 00/13] Support blob memory and venus on qemu Dmitry Osipenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230915111130.24064-1-ray.huang@amd.com \
--to=ray.huang@amd.com \
--cc=Jiqian.Chen@amd.com \
--cc=aesteve@redhat.com \
--cc=akihiko.odaki@daynix.com \
--cc=alex.bennee@linaro.org \
--cc=alexander.deucher@amd.com \
--cc=anthony.perard@citrix.com \
--cc=bob.beckett@collabora.com \
--cc=christian.koenig@amd.com \
--cc=dgilbert@redhat.com \
--cc=dmitry.osipenko@collabora.com \
--cc=ernunes@redhat.com \
--cc=gurchetansingh@chromium.org \
--cc=hi@alyssa.is \
--cc=honglei1.huang@amd.com \
--cc=julia.zhang@amd.com \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=philmd@linaro.org \
--cc=pierre-eric.pelloux-prayer@amd.com \
--cc=qemu-devel@nongnu.org \
--cc=quic_acaggian@quicinc.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
--cc=xenia.ragiadakou@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).