mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/virtio: introduce the HOST_PAGE_SIZE feature
@ 2024-07-23 11:49 Sergio Lopez
  2024-07-23 11:49 ` [PATCH 1/2] " Sergio Lopez
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Sergio Lopez @ 2024-07-23 11:49 UTC (permalink / raw)
  To: gurchetansingh, tzimmermann, mripard, olvaffe, kraxel, daniel,
	maarten.lankhorst, airlied
  Cc: linux-kernel, virtualization, dri-devel, Sergio Lopez

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 improve this situation, we introduce here the HOST_PAGE_SIZE feature.
This feature indicates that the host has an extended virtio_gpu_config
structure that include it's own page size a new field.

On the second commit, we also add a new param that can be read with
VIRTGPU_GETPARAM by userspace applications running in the guest to
obtain the host's page size and find out the right alignment to be used
in shared memory allocations.

Sergio Lopez (2):
  drm/virtio: introduce the HOST_PAGE_SIZE feature
  drm/virtio: add VIRTGPU_PARAM_HOST_PAGE_SIZE to params

 drivers/gpu/drm/virtio/virtgpu_drv.c   |  1 +
 drivers/gpu/drm/virtio/virtgpu_drv.h   |  2 ++
 drivers/gpu/drm/virtio/virtgpu_ioctl.c |  5 +++++
 drivers/gpu/drm/virtio/virtgpu_kms.c   | 13 ++++++++++---
 include/uapi/drm/virtgpu_drm.h         |  1 +
 include/uapi/linux/virtio_gpu.h        |  5 +++++
 6 files changed, 24 insertions(+), 3 deletions(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-04-02 16:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-23 11:49 [PATCH 0/2] drm/virtio: introduce the HOST_PAGE_SIZE feature Sergio Lopez
2024-07-23 11:49 ` [PATCH 1/2] " Sergio Lopez
2024-07-23 11:49 ` [PATCH 2/2] drm/virtio: add VIRTGPU_PARAM_HOST_PAGE_SIZE to params Sergio Lopez
2024-07-24 19:00 ` [PATCH 0/2] drm/virtio: introduce the HOST_PAGE_SIZE feature Dmitry Osipenko
2024-08-05  9:14   ` Sergio Lopez Pascual
     [not found]     ` <CAAfnVBkWKn3+YEhNz0CTmw-T_jjL72axkWqYgkzkSa72t_Gf0A@mail.gmail.com>
2024-08-06 20:15       ` Rob Clark
     [not found]         ` <CAAfnVBki816fSPuQ_FcvuwYzbSwiS_WaYsGSA1AyitmAA5OsXg@mail.gmail.com>
2024-08-08 10:38           ` Sergio Lopez Pascual
     [not found]             ` <CAAfnVBkkste=HR2SKRBNWXKcunbA2iEP+rr9yhDy89+WZsYeQw@mail.gmail.com>
2024-08-22 15:29               ` Sergio Lopez Pascual
2025-04-02 16:38           ` Sergio Lopez Pascual
2024-08-05 16:24   ` Rob Clark
2024-08-08 11:15     ` Dmitry Osipenko
2024-08-12 18:22       ` Rob Clark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®