lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250402-virtio-gpu-host-page-size-v2-0-0afdc8c16cb9@redhat.com>
Date: Wed, 02 Apr 2025 19:45:59 +0200
From: Sergio Lopez <slp@...hat.com>
To: David Airlie <airlied@...hat.com>, Gerd Hoffmann <kraxel@...hat.com>, 
 Gurchetan Singh <gurchetansingh@...omium.org>, 
 Chia-I Wu <olvaffe@...il.com>, 
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, 
 Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>, 
 Simona Vetter <simona@...ll.ch>, "Michael S. Tsirkin" <mst@...hat.com>, 
 Jason Wang <jasowang@...hat.com>, Xuan Zhuo <xuanzhuo@...ux.alibaba.com>, 
 Eugenio PĂ©rez <eperezma@...hat.com>, 
 Gurchetan Singh <gurchetansingh@...omium.org>, 
 Rob Clark <robdclark@...il.com>, 
 Dmitry Osipenko <dmitry.osipenko@...labora.com>
Cc: dri-devel@...ts.freedesktop.org, virtualization@...ts.linux.dev, 
 linux-kernel@...r.kernel.org, Sergio Lopez <slp@...hat.com>
Subject: [PATCH v2 0/2] drm/virtio: introduce the HOST_PAGE_SIZE feature

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.

There has been a discussion in virtio-comments about whether the
information about alignment restrictions must be shared in a generic or
in a device-specific way, favoring the latter:

https://lore.kernel.org/virtio-comment/CY8PR12MB7195B5E575099CD9CA1F2F39DCAF2@CY8PR12MB7195.namprd12.prod.outlook.com/T/#t

v2:
 - Rebase on top of current upstream.
 - Make a reference in the cover to the discussion about how device
   page alignment restrictions should be shared with the driver.

Signed-off-by: Sergio Lopez <slp@...hat.com>
---
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(-)
---
base-commit: acc4d5ff0b61eb1715c498b6536c38c1feb7f3c1
change-id: 20250402-virtio-gpu-host-page-size-282c99dfe44c

Best regards,
-- 
Sergio Lopez <slp@...hat.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ