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: <ffdc843c-86ae-4838-9201-9028f2624933@collabora.com>
Date:   Thu, 23 Mar 2023 00:45:10 +0300
From:   Dmitry Osipenko <dmitry.osipenko@...labora.com>
To:     Rob Clark <robdclark@...il.com>
Cc:     David Airlie <airlied@...hat.com>,
        Gerd Hoffmann <kraxel@...hat.com>,
        Gurchetan Singh <gurchetansingh@...omium.org>,
        Chia-I Wu <olvaffe@...il.com>, Daniel Vetter <daniel@...ll.ch>,
        Marek Olšák <maraeo@...il.com>,
        Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@....com>,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        kernel@...labora.com, virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH v2 1/2] drm/virtio: Refactor job submission code path

On 3/23/23 00:25, Rob Clark wrote:
...
>> +static int virtio_gpu_dma_fence_wait(struct virtio_gpu_submit *submit,
>> +                                    struct dma_fence *fence)
>> +{
>> +       struct dma_fence *itr;
>> +       int idx, err;
>> +
>> +       dma_fence_array_for_each(itr, idx, fence) {
> 
> I guess unwrapping is for the later step of host waits?
> 
> At any rate, I think you should use dma_fence_unwrap_for_each() to
> handle the fence-chain case as well?

Yes, seems so. I actually missed the dma_fence_unwrap, thanks!

...
>> +static int virtio_gpu_init_submit(struct virtio_gpu_submit *submit,
>> +                                 struct drm_virtgpu_execbuffer *exbuf,
>> +                                 struct drm_device *dev,
>> +                                 struct drm_file *file,
>> +                                 uint64_t fence_ctx, uint32_t ring_idx)
>> +{
>> +       struct virtio_gpu_fpriv *vfpriv = file->driver_priv;
>> +       struct virtio_gpu_device *vgdev = dev->dev_private;
>> +       struct virtio_gpu_fence *out_fence;
>> +       int err;
>> +
>> +       memset(submit, 0, sizeof(*submit));
>> +
>> +       out_fence = virtio_gpu_fence_alloc(vgdev, fence_ctx, ring_idx);
>> +       if (!out_fence)
>> +               return -ENOMEM;
>> +
>> +       err = virtio_gpu_fence_event_create(dev, file, out_fence, ring_idx);
>> +       if (err) {
>> +               dma_fence_put(&out_fence->f);
>> +               return err;
>> +       }
> 
> If we fail at any point after here, where is the out_fence referenced dropped?

Good catch, don't see either where it's dropped. Perhaps the drop got
lost after moving the code around, will fix.

...
>> +/*
>> + * Usage of execbuffer:
>> + * Relocations need to take into account the full VIRTIO_GPUDrawable size.
>> + * However, the command as passed from user space must *not* contain the initial
>> + * VIRTIO_GPUReleaseInfo struct (first XXX bytes)
>> + */
> 
> I know this is just getting moved from the old location, but I'm not
> even sure what this comment means ;-)
> 
> At least it doesn't make any sense for non-virgl contexts.. I haven't
> looked too closely at virgl protocol itself

Had exactly the same thought :) Well, if nobody will clarify, then I'm
happy with removing it in v3.

-- 
Best regards,
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ