<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 11, 2023 at 2:37 PM Dmitry Osipenko <<a href="mailto:dmitry.osipenko@collabora.com">dmitry.osipenko@collabora.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 10/18/23 21:17, Gurchetan Singh wrote:<br>
> +             case VIRTGPU_CONTEXT_PARAM_DEBUG_NAME:<br>
> +                     if (vfpriv->explicit_debug_name) {<br>
> +                             ret = -EINVAL;<br>
> +                             goto out_unlock;<br>
> +                     }<br>
> +<br>
> +                     ret = strncpy_from_user(vfpriv->debug_name,<br>
> +                                             u64_to_user_ptr(value),<br>
> +                                             DEBUG_NAME_MAX_LEN - 1);<br>
> +<br>
> +                     if (ret < 0) {<br>
> +                             ret = -EFAULT;<br>
> +                             goto out_unlock;<br>
> +                     }<br>
> +<br>
> +                     vfpriv->explicit_debug_name = true;<br>
> +                     break;<br>
<br>
Spotted a problem here. The ret needs to be set to zero on success. I'll<br>
send the fix shortly. Gurchetan you should've been getting the<br>
DRM_IOCTL_VIRTGPU_CONTEXT_INIT failure from gfxstream when you tested<br>
this patch, haven't you?<br></blockquote><div><br></div><div>To accommodate older kernels/QEMU, gfxstream doesn't fail if CONTEXT_INIT fails.  So the guest thought it failed and didn't react, but the value was propagated to the host.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Also noticed that the patch title says "drm/uapi" instead of<br>
"drm/virtio". My bad for not noticing it earlier. Please be more careful<br>
next time too :)<br>
<br>
-- <br>
Best regards,<br>
Dmitry<br>
<br>
</blockquote></div></div>