qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [v2 0/3] virtio-gpu: Add user pointer and HSAKMT support enhancements
@ 2025-11-21  2:47 Honglei Huang
  2025-11-21  2:47 ` [v2 1/3] virtio-gpu: Add support for VIRTIO_GPU_BLOB_FLAG_USE_USERPTR flag Honglei Huang
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Honglei Huang @ 2025-11-21  2:47 UTC (permalink / raw)
  To: alex.bennee, dmitry.osipenko, odaki
  Cc: mst, cohuck, pbonzini, qemu-devel, Ray.Huang, Honglei Huang

This patch series introduces three key enhancements to virtio-gpu to improve
memory management and GPU virtualization capabilities for ROCm workloads:

1. VIRTIO_GPU_BLOB_FLAG_USE_USERPTR support: Enables user pointer mapping
   for blob resources, allowing guest applications to use user-allocated 
   memory for GPU resources more efficiently. This version includes a 
   critical fix for value check logic in blob resource creation.

2. Configurable HSAKMT capset support: Provides better control over HSAKMT
   functionality with a new device property "hsakmt=on" to avoid exposing
   unsupported capabilities to guests. Enhanced to include proper renderer
   initialization flags when HSAKMT is enabled.

3. VIRTIO_GPU_F_RESOURCE_USERPTR feature support: Introduces a new virtio-gpu
   feature flag with configurable "userptr=on" device property to enable
   user pointer resources for enhanced memory management.

Changes in v2:
- Fixed error handling bug in virtio-gpu-virgl.c where the return
  value check was inverted (changed from "if (!ret)" to "if (ret != 0)")
- Added VIRGL_RENDER_USE_HSAKMT flag initialization in virtio_gpu_virgl_init()
  when HSAKMT support is enabled
- Simplified blob resource creation logic by removing complex conditional
  branching for userptr vs regular blob handling
- Updated commit messages to reflect bug fixes and improvements
- Added references to related patches in Linux kernel, virglrenderer, and
  ROCm Runtime components for complete feature implementation tracking

These patches work together to provide more flexible and efficient memory
management between guest and host in GPU virtualization scenarios. The
changes are backward compatible and controlled by new device properties.

Usage examples:
  -device virtio-gpu-gl,hsakmt=on,userptr=on

The series has been tested with ROCm GPU workloads requiring advanced memory
management capabilities and addresses the error handling issues found in v1.

Related patches in other components:
- Linux kernel virtio-gpu support:
  https://lore.kernel.org/lkml/20251112072910.3716944-1-honglei1.huang@amd.com/
- Virglrenderer support:
  https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1568
- ROCm Runtime support (merged):
  https://github.com/ROCm/ROCR-Runtime/commit/48d3719dba6ca91f597a8179d8b341387ce155e8

Honglei Huang (3):
  virtio-gpu: Add support for VIRTIO_GPU_BLOB_FLAG_USE_USERPTR flag
  virtio-gpu: add configurable HSAKMT capset support
  virtio-gpu: Add VIRTIO_GPU_F_RESOURCE_USERPTR feature support

 hw/display/virtio-gpu-base.c                |  3 +++
 hw/display/virtio-gpu-gl.c                  |  2 ++
 hw/display/virtio-gpu-virgl.c               | 14 +++++++++++++-
 hw/display/virtio-gpu.c                     |  9 ++-------
 include/hw/virtio/virtio-gpu.h              |  6 ++++++
 include/standard-headers/linux/virtio_gpu.h |  4 ++++
 6 files changed, 30 insertions(+), 8 deletions(-)

-- 
2.34.1



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

end of thread, other threads:[~2025-11-21  7:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-21  2:47 [v2 0/3] virtio-gpu: Add user pointer and HSAKMT support enhancements Honglei Huang
2025-11-21  2:47 ` [v2 1/3] virtio-gpu: Add support for VIRTIO_GPU_BLOB_FLAG_USE_USERPTR flag Honglei Huang
2025-11-21  2:56   ` Akihiko Odaki
2025-11-21  3:14     ` Honglei Huang
2025-11-21  3:39       ` Akihiko Odaki
2025-11-21  5:21         ` Honglei Huang
2025-11-21  5:28           ` Akihiko Odaki
2025-11-21  5:43             ` Honglei Huang
2025-11-21  6:12               ` Akihiko Odaki
2025-11-21  6:50                 ` Honglei Huang
2025-11-21  7:36                   ` Akihiko Odaki
2025-11-21  7:46                     ` Honglei Huang
2025-11-21  2:47 ` [v2 2/3] virtio-gpu: add configurable HSAKMT capset support Honglei Huang
2025-11-21  2:47 ` [v2 3/3] virtio-gpu: Add VIRTIO_GPU_F_RESOURCE_USERPTR feature support Honglei Huang

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).