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-prev] [day] [month] [year] [list]
Message-ID: <5b0a15d1-6912-4a0b-acdc-ace4f7aa33e6@collabora.com>
Date: Thu, 11 Dec 2025 06:51:46 +0300
From: Dmitry Osipenko <dmitry.osipenko@...labora.com>
To: Val Packett <val@...isiblethingslab.com>,
 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>, Vivek Kasireddy <vivek.kasireddy@...el.com>
Cc: Dongwon Kim <dongwon.kim@...el.com>,
 Christian Koenig <christian.koenig@....com>,
 dri-devel@...ts.freedesktop.org, virtualization@...ts.linux.dev,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/virtio: Allow importing prime buffers when 3D is
 enabled

On 12/11/25 01:11, Val Packett wrote:
> 
> On 12/10/25 1:51 PM, Dmitry Osipenko wrote:
>> Hi,
>>
>> On 12/10/25 18:39, Val Packett wrote:
>>> This functionality was added for using a KMS-only virtgpu with a
>>> physical
>>> (or SR-IOV) headless GPU in passthrough, but it should not be restricted
>>> to KMS-only mode. It can be used with cross-domain to pass guest memfds
>>> to the host compositor with zero copies (using udmabuf on both sides).
>>>
>>> Drop the check for the absence of virgl_3d to allow for more use cases.
>>>
>>> Fixes: ca77f27a2665 ("drm/virtio: Import prime buffers from other
>>> devices as guest blobs")
>>> Signed-off-by: Val Packett <val@...isiblethingslab.com>
>>> ---
>>>
>>> Hi. I couldn't find any comments on that line in the reviews (on
>>> patchwork), so I assume
>>> there was never a specific technical reason for that check, just an
>>> abundance of caution?
>>>
>>> BTW, while here.. The drm_gem_prime_import "fallback" seems pretty
>>> much equivalent to
>>> `return (-ENODEV)`, as drm_gem_prime_import(_dev) just translates the
>>> call to
>>> gem_prime_import_sg_table which we don't use. Should it be replaced
>>> with `return (-ENODEV)`?
>> Returning -ENODEV should break dmabuf self-importing where virtio-gpu
>> driver export dmabuf and then imports to itself.
> 
> Hm, I don't think so because the self-import case (for when `buf->ops ==
> &virtgpu_dmabuf_ops`) is handled right here, right above this check.
> 
> drm_gem_prime_import would handle the self-import for `buf->ops ==
> &drm_gem_prime_dmabuf_ops` which shouldn't be the case since we have
> `virtgpu_dmabuf_ops`..

Indeed, then it should be redundant. Practically, there should be no
difference with removal of drm_gem_prime_import() and
virtgpu_gem_prime_import_sg_table() from the code. Not sure if changing
it will be worthwhile.

-- 
Best regards,
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ