[PATCH v7 0/5] ui/console: Private QemuDmaBuf struct

dongwon.kim@intel.com posted 5 patches 2 weeks, 1 day ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240418220541.931134-1-dongwon.kim@intel.com
Maintainers: "Marc-André Lureau" <marcandre.lureau@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Alex Williamson <alex.williamson@redhat.com>, "Cédric Le Goater" <clg@redhat.com>
There is a newer version of this series
include/hw/vfio/vfio-common.h   |   2 +-
include/hw/virtio/virtio-gpu.h  |   4 +-
include/ui/console.h            |  21 +--
include/ui/dmabuf.h             |  38 ++++++
hw/display/vhost-user-gpu.c     |  32 +++--
hw/display/virtio-gpu-udmabuf.c |  27 ++--
hw/vfio/display.c               |  35 ++---
ui/console.c                    |   5 +-
ui/dbus-console.c               |   9 +-
ui/dbus-listener.c              |  71 +++++-----
ui/dmabuf.c                     | 223 ++++++++++++++++++++++++++++++++
ui/egl-headless.c               |  23 +++-
ui/egl-helpers.c                |  59 +++++----
ui/gtk-egl.c                    |  52 +++++---
ui/gtk-gl-area.c                |  41 ++++--
ui/gtk.c                        |  12 +-
ui/spice-display.c              |  50 ++++---
ui/meson.build                  |   1 +
18 files changed, 512 insertions(+), 193 deletions(-)
create mode 100644 include/ui/dmabuf.h
create mode 100644 ui/dmabuf.c
[PATCH v7 0/5] ui/console: Private QemuDmaBuf struct
Posted by dongwon.kim@intel.com 2 weeks, 1 day ago
From: Dongwon Kim <dongwon.kim@intel.com>

This series introduces privacy enhancements to the QemuDmaBuf struct
and its contained data to bolster security. it accomplishes this by
introducing of helper functions for allocating, deallocating, and
accessing individual fields within the struct and replacing all direct
references to individual fields in the struct with methods using helpers
throughout the codebase.

This change was made based on a suggestion from Marc-André Lureau
<marcandre.lureau@redhat.com>

(Resumitting same patch series with this new cover-leter)

v6: fixed some typos in patch -
    ui/console: Introduce dpy_gl_qemu_dmabuf_get_..() helpers)

v7: included minor fix (ui/gtk: Check if fence_fd is equal to or greater than 0)
    (Marc-André Lureau <marcandre.lureau@redhat.com>)
    
    migrated all helpers and QemuDmaBuf struct into dmabuf.c and their prototypes
    to dmabuf.h for better encapsulation (ui/dmabuf: New dmabuf.c and dmabuf.h..)
    (Daniel P. Berrangé <berrange@redhat.com> and
     Marc-André Lureau <marcandre.lureau@redhat.com>)

    removed 'dpy_gl' from all helpers' names
    Defined autoptr clean up function for QemuDmaBuf*
    (Daniel P. Berrangé <berrange@redhat.com>)

    Minor corrections
    
Dongwon Kim (5):
  ui/gtk: Check if fence_fd is equal to or greater than 0
  ui/console: Introduce qemu_dmabuf_get_..() helpers
  ui/console: Introduce qemu_dmabuf_set_..() helpers
  ui/console: Introduce qemu_dmabuf_new() and free() helpers
  ui/dmabuf: New dmabuf.c and dmabuf.h for QemuDmaBuf struct and helpers

 include/hw/vfio/vfio-common.h   |   2 +-
 include/hw/virtio/virtio-gpu.h  |   4 +-
 include/ui/console.h            |  21 +--
 include/ui/dmabuf.h             |  38 ++++++
 hw/display/vhost-user-gpu.c     |  32 +++--
 hw/display/virtio-gpu-udmabuf.c |  27 ++--
 hw/vfio/display.c               |  35 ++---
 ui/console.c                    |   5 +-
 ui/dbus-console.c               |   9 +-
 ui/dbus-listener.c              |  71 +++++-----
 ui/dmabuf.c                     | 223 ++++++++++++++++++++++++++++++++
 ui/egl-headless.c               |  23 +++-
 ui/egl-helpers.c                |  59 +++++----
 ui/gtk-egl.c                    |  52 +++++---
 ui/gtk-gl-area.c                |  41 ++++--
 ui/gtk.c                        |  12 +-
 ui/spice-display.c              |  50 ++++---
 ui/meson.build                  |   1 +
 18 files changed, 512 insertions(+), 193 deletions(-)
 create mode 100644 include/ui/dmabuf.h
 create mode 100644 ui/dmabuf.c

-- 
2.34.1


Re: [PATCH v7 0/5] ui/console: Private QemuDmaBuf struct
Posted by Philippe Mathieu-Daudé 2 weeks ago
On 19/4/24 00:05, dongwon.kim@intel.com wrote:
> From: Dongwon Kim <dongwon.kim@intel.com>
> 
> This series introduces privacy enhancements to the QemuDmaBuf struct
> and its contained data to bolster security. it accomplishes this by
> introducing of helper functions for allocating, deallocating, and
> accessing individual fields within the struct and replacing all direct
> references to individual fields in the struct with methods using helpers
> throughout the codebase.
> 
> This change was made based on a suggestion from Marc-André Lureau
> <marcandre.lureau@redhat.com>


> Dongwon Kim (5):
>    ui/gtk: Check if fence_fd is equal to or greater than 0
>    ui/console: Introduce qemu_dmabuf_get_..() helpers
>    ui/console: Introduce qemu_dmabuf_set_..() helpers
>    ui/console: Introduce qemu_dmabuf_new() and free() helpers
>    ui/dmabuf: New dmabuf.c and dmabuf.h for QemuDmaBuf struct and helpers

Instead of introducing then moving code, you could re-order
patches as 1, 5, 2, 3, 4 (in patch 2, introduce helper in
new dmabuf.c file and new header).