From: Sergio Lopez <slp@redhat.com>
To: "David Airlie" <airlied@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
"Gurchetan Singh" <gurchetansingh@chromium.org>,
"Chia-I Wu" <olvaffe@gmail.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Simona Vetter" <simona@ffwll.ch>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"Eugenio Pérez" <eperezma@redhat.com>,
dri-devel@lists.freedesktop.org, virtualization@lists.linux.dev,
linux-kernel@vger.kernel.org
Cc: Sergio Lopez <slp@redhat.com>
Subject: [PATCH 0/3] drm/virtio: introduce F_BLOB_ALIGNMENT support
Date: Mon, 10 Nov 2025 13:52:10 +0100 [thread overview]
Message-ID: <20251110125213.12633-1-slp@redhat.com> (raw)
There's an incresing number of machines supporting multiple page sizes
and on these machines the host and a guest can be running, each one,
with a different page size.
For what pertains to virtio-gpu, this is not a problem if the page size
of the guest happens to be bigger or equal than the host, but will
potentially lead to failures in memory allocations and/or mappings
otherwise.
To deal with this, the virtio-spec was extended to introduce with the
VIRTIO_GPU_F_BLOB_ALIGNMENT feature [1]. If this feature is negotiated,
we must use the "blob_alignment" field in the config to ensure every
CREATE_BLOB and MAP_BLOB is properly aligned before sending it to the
device.
We also introduce the VIRTGPU_PARAM_BLOB_ALIGNMENT parameter to allow
userspace to query the alignment restrictions for blobs.
This supersedes "drm/virtio: introduce the HOST_PAGE_SIZE feature" [2].
[1] https://github.com/oasis-tcs/virtio-spec/commit/f9abfd55cb663837dda1153b826216dcf4d25b84
[2] https://lkml.org/lkml/2024/7/23/438
Sergio Lopez (3):
drm/virtio: support VIRTIO_GPU_F_BLOB_ALIGNMENT
drm/virtio: honor blob_alignment requirements
drm/virtio: add VIRTGPU_PARAM_BLOB_ALIGNMENT to params
drivers/gpu/drm/virtio/virtgpu_drv.c | 1 +
drivers/gpu/drm/virtio/virtgpu_drv.h | 4 +++-
drivers/gpu/drm/virtio/virtgpu_ioctl.c | 5 +++++
drivers/gpu/drm/virtio/virtgpu_kms.c | 14 +++++++++++---
drivers/gpu/drm/virtio/virtgpu_object.c | 6 ++++--
drivers/gpu/drm/virtio/virtgpu_prime.c | 7 +++++--
drivers/gpu/drm/virtio/virtgpu_vq.c | 12 +++++++++++-
drivers/gpu/drm/virtio/virtgpu_vram.c | 10 ++++++++--
include/uapi/drm/virtgpu_drm.h | 1 +
include/uapi/linux/virtio_gpu.h | 9 +++++++++
10 files changed, 58 insertions(+), 11 deletions(-)
--
2.51.0
next reply other threads:[~2025-11-10 12:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-10 12:52 Sergio Lopez [this message]
2025-11-10 12:52 ` [PATCH 1/3] drm/virtio: support VIRTIO_GPU_F_BLOB_ALIGNMENT Sergio Lopez
2025-11-12 12:14 ` Dmitry Osipenko
2025-11-12 16:49 ` Sergio Lopez Pascual
2025-11-13 2:20 ` Dmitry Osipenko
2025-11-10 12:52 ` [PATCH 2/3] drm/virtio: honor blob_alignment requirements Sergio Lopez
2025-11-13 2:20 ` Dmitry Osipenko
2025-11-13 2:20 ` Dmitry Osipenko
2025-11-13 2:28 ` Dmitry Osipenko
2025-11-13 2:34 ` Dmitry Osipenko
2025-11-13 2:40 ` Dmitry Osipenko
2025-11-10 12:52 ` [PATCH 3/3] drm/virtio: add VIRTGPU_PARAM_BLOB_ALIGNMENT to params Sergio Lopez
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=20251110125213.12633-1-slp@redhat.com \
--to=slp@redhat.com \
--cc=airlied@redhat.com \
--cc=dmitry.osipenko@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=eperezma@redhat.com \
--cc=gurchetansingh@chromium.org \
--cc=jasowang@redhat.com \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=mst@redhat.com \
--cc=olvaffe@gmail.com \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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