All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Koenig, Christian" <Christian.Koenig@amd.com>
To: Emil Velikov <emil.l.velikov@gmail.com>, Daniel Vetter <daniel@ffwll.ch>
Cc: "Deucher, Alexander" <Alexander.Deucher@amd.com>,
	David Airlie <airlied@linux.ie>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 01/13] drm/amdgpu: introduce and honour DRM_FORCE_AUTH workaround
Date: Fri, 21 Jun 2019 10:31:49 +0000	[thread overview]
Message-ID: <d241fab3-b6f0-d38a-b83f-03b70736b355@amd.com> (raw)
In-Reply-To: <20190621102015.GA21486@arch-x1c3>

Am 21.06.19 um 12:20 schrieb Emil Velikov:
> On 2019/06/21, Daniel Vetter wrote:
>> On Fri, Jun 21, 2019 at 11:25 AM Koenig, Christian
>> <Christian.Koenig@amd.com> wrote:
>>> Am 21.06.19 um 11:09 schrieb Daniel Vetter:
>>>> On Fri, Jun 21, 2019 at 07:12:14AM +0000, Koenig, Christian wrote:
>>>>> Am 20.06.19 um 18:30 schrieb Emil Velikov:
>>>>>> On 2019/06/14, Koenig, Christian wrote:
>>>>>>> Am 14.06.19 um 17:53 schrieb Emil Velikov:
>>>>>>>> On 2019/06/14, Koenig, Christian wrote:
>>>>>>>>> Am 14.06.19 um 14:09 schrieb Emil Velikov:
>>>>>>>>>> On 2019/05/27, Emil Velikov wrote:
>>>>>>>>>> [SNIP]
>>>>>>>>>> Hi Christian,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> In the following, I would like to summarise and emphasize the need for
>>>>>>>>>> DRM_AUTH removal. I would kindly ask you to spend a couple of minutes
>>>>>>>>>> extra reading it.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Today DRM drivers* do not make any distinction between primary and
>>>>>>>>>> render node clients.
>>>>>>>>> That is actually not 100% correct. We have a special case where a DRM
>>>>>>>>> master is allowed to change the priority of render node clients.
>>>>>>>>>
>>>>>>>> Can you provide a link? I cannot find that code.
>>>>>>> See amdgpu_sched_ioctl().
>>>>>>>
>>>>>>>>>> Thus for a render capable driver, any premise of
>>>>>>>>>> separation, security or otherwise imposed via DRM_AUTH is a fallacy.
>>>>>>>>> Yeah, that's what I agree on. I just don't think that removing DRM_AUTH
>>>>>>>>> now is the right direction to take.
>>>>>>>>>
>>>>>>>> Could have been clearer - I'm talking about DRM_AUTH | DRM_RENDER_ALLOW
>>>>>>>> ioctls.
>>>>>>>>
>>>>>>>> That aside, can you propose an alternative solution that addresses this
>>>>>>>> and the second point just below?
>>>>>>> Give me a few days to work on this, it's already Friday 6pm here.
>>>>>>>
>>>>>> Hi Christian,
>>>>>>
>>>>>> Any progress? As mentioned earlier, I'm OK with writing the patches although
>>>>>> I would love to hear your plan.
>>>>> First of all I tried to disable DRM authentication completely with a
>>>>> kernel config option. Surprisingly that actually works out of the box at
>>>>> least on the AMDGPU stack.
>>>>>
>>>>> This effectively allows us to get rid of DRI2 and the related security
>>>>> problems. Only thing left for that is that I'm just not sure how to
>>>>> signal this to userspace so that the DDX wouldn't advertise DRI2 at all
>>>>> any more.
>>>>>
>>>>>
>>>>> As a next step I looked into if we can disable the command submission
>>>>> for DRM master. Turned out that this is relatively easy as well.
>>>>>
>>>>> All we have to do is to fix the bug Michel pointed out about KMS handles
>>>>> for display and let the DDX use a render node instead of the DRM master
>>>>> for Glamor. Still need to sync up with Michel and/or Marek whats the
>>>>> best way of doing this.
>>>>>
>>>>>
>>>>> The last step (and that's what I haven't tried yet) would be to disable
>>>>> DRM authentication for Navi even when it is still compiled into the
>>>>> kernel. But that is more or less just a typing exercise.
>>>> So just to get this straight, we're now full on embracing a subsystem
>>>> split here:
>>>> - amdgpu plans to ditch dri2/rendering on primary nodes
>>>> - bunch of drivers (I think more than i915 by now) merged the DRM_AUTH
>>>>     removal
>>>> - others are just hanging in there somehow
>>>>
>>>> "best of both^W worlds" ftw?
>>> Yes, exactly!
>>>
>>> Think a step further, when this is upstream we can apply the DRM_AUTH
>>> removal to amdgpu as well.
>>>
> So this is effectively what I suggested/planned with a couple of caveats:
>   - making amdgpu behave differently from the rest of drm ;-(
>   - having the KConfig amdgpu only and merged before this DRM_AUTH

No this should apply to all drivers, not just amdgpu.

> While I suggested:
>   - keeping amdgpu consistent with the rest
>   - exposing the KConfig option for the whole of the kernel, and
>   - merging it alongside this work
>
> So I effectively waited for weeks, instead of simply going ahead and
> writing/submitting patches. That's a bit unfortunate...
>
>>> Because we simply made sure that userspace is using the render node for
>>> command submission and not the primary node.
>>>
>>> So nobody can go ahead and remove render node support any more :)
>> How does this work? I thought the entire problem of DRM_AUTH removal
>> for you was that it broke stuff, and you didn't want to deal with
>> that. We still have that exact problem afaics ... old userspace
>> doesn't simply vanish, even if you entirely nuke it going forward.
>>
>> Also, testing on the amdgpu stack isn't really testing a hole lot
>> here, it's all the various silly compositors out there I'd expect to
>> fall over. Will gbm/radeonsi/whatever just internally do all the
>> necessary dma-buf import/export between the primary node and display
>> node to keep this all working?
> If I understood Christian, feel free to correct me, the fact that my
> earlier patch broke RADV was not the argument. The problem was was the
> patch does.

Well partially. That RADV broke is unfortunate, but we have done so many 
customized userspace stuff both based on Mesa/DDX as well as closed 
source components that it is just highly likely that we would break 
something else as well.

> In particular, that user-space will "remove" render nodes.

Yes, that is my main concern here. You basically make render nodes 
superfluously. That gives userspace all legitimization to also remove 
support for them. That is not stupid or evil or whatever, userspace 
would just follow the kernel design.

> I'm really sad that amdgpu insists on standing out, hope one day it will
> converge. Yet since all other maintainers are ok with the series, I'll
> start merging patches in a few hours. I'm really sad that amdgpu wants
> to stand out, hope it will converge sooner rather than later.
>
> Christian, how would you like amdgpu handled - with a separate flag in
> the driver or shall we special case amdgpu within core drm?

No, I ask you to please stick around DRM_AUTH for at least amdgpu and 
radeon. And NOT enable any render node functionality for them on the 
primary node.

Thanks,
Christian.

>
> Thanks
> Emil

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-06-21 10:31 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27  8:17 [PATCH 01/13] drm/amdgpu: introduce and honour DRM_FORCE_AUTH workaround Emil Velikov
2019-05-27  8:17 ` [PATCH 03/13] drm/etnaviv: drop DRM_AUTH usage from the driver Emil Velikov
2019-06-06 10:57   ` Emil Velikov
2019-06-06 11:15     ` Christian Gmeiner
2019-05-27  8:17 ` [PATCH 04/13] drm/exynos: drop DRM_AUTH from DRM_RENDER_ALLOW ioctls Emil Velikov
2019-05-27 10:02   ` Inki Dae
2019-05-27  8:17 ` [PATCH 05/13] drm/i915: " Emil Velikov
2019-05-27  8:39   ` Jani Nikula
2019-05-27 11:57     ` Emil Velikov
2019-05-27  8:17 ` [PATCH 06/13] drm/lima: drop DRM_AUTH usage from the driver Emil Velikov
2019-06-06 10:58   ` Emil Velikov
2019-06-10  0:56     ` Qiang Yu
2019-05-27  8:17 ` [PATCH 09/13] drm/omap: drop DRM_AUTH from DRM_RENDER_ALLOW ioctls Emil Velikov
2019-06-06 10:58   ` Emil Velikov
2019-06-06 14:45     ` Tomi Valkeinen
     [not found] ` <20190527081741.14235-1-emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-05-27  8:17   ` [PATCH 02/13] drm/amdgpu: drop DRM_AUTH usage from the driver Emil Velikov
2019-05-27  8:17   ` [PATCH 07/13] drm/msm: " Emil Velikov
     [not found]     ` <20190527081741.14235-7-emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-06 10:58       ` Emil Velikov
2019-08-06  9:43       ` Emil Velikov
2019-05-27  8:17   ` [PATCH 08/13] drm/nouveau: drop DRM_AUTH from DRM_RENDER_ALLOW ioctls Emil Velikov
2019-06-06 10:58     ` Emil Velikov
     [not found]       ` <CACvgo53skE1TpixEDBxmfAgFouJD66351fkcx40zR3vgF41c1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-07  0:24         ` Ben Skeggs
2019-05-27  8:17   ` [PATCH 10/13] drm/radeon: " Emil Velikov
2019-05-27 10:47   ` [PATCH 01/13] drm/amdgpu: introduce and honour DRM_FORCE_AUTH workaround Koenig, Christian
     [not found]     ` <3c9b5688-5e83-f173-00e3-6e139e05d466-5C7GfCeVMHo@public.gmane.org>
2019-05-27 12:05       ` Emil Velikov
2019-05-27 12:20         ` Koenig, Christian
2019-05-27 12:52           ` Emil Velikov
2019-05-27 13:26             ` Daniel Vetter
2019-05-27 13:34               ` Daniel Vetter
2019-05-27 13:20     ` Daniel Vetter
     [not found]       ` <20190527132041.GP21222-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-05-27 13:26         ` Emil Velikov
2019-05-27 13:42           ` Koenig, Christian
     [not found]             ` <0426fb3e-e7bc-2464-cb42-4d5753956d23-5C7GfCeVMHo@public.gmane.org>
2019-05-27 15:26               ` Daniel Vetter
     [not found]                 ` <CAKMK7uE_pRro8PxTwUq+pC_1GVVT7nUxan1T-kqSYT=BMHTf2g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-05-28  6:58                   ` Koenig, Christian
     [not found]                     ` <d12a7dd4-595b-d0aa-a87d-527392fb0384-5C7GfCeVMHo@public.gmane.org>
2019-05-28  7:38                       ` Daniel Vetter
     [not found]                         ` <CAKMK7uE1ZWjCeg3q7qDrbcj89+DuPQwfjMqC8hTjDAMU5bhh-w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-05-28  8:03                           ` Koenig, Christian
     [not found]                             ` <98c3d891-6966-2043-9709-4e718dbc6bac-5C7GfCeVMHo@public.gmane.org>
2019-05-28  8:18                               ` Daniel Vetter
     [not found]                                 ` <CAKMK7uGsc7WzBBrfxape4Yy7fbKoDFH5J2F87Kx=7rE1+pXcXw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-05-28 16:10                                   ` Emil Velikov
2019-05-28 16:22                                     ` Koenig, Christian
2019-05-28 16:46                                       ` Emil Velikov
2019-05-28 20:05                                         ` Dave Airlie
     [not found]                                           ` <CAPM=9tzuQX4iQU=w4QfbE1ryq6sXc4k5SVh6V1_4AyH_O+D_oA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-05-29 13:03                                             ` Emil Velikov
2019-05-29 13:14                                               ` Koenig, Christian
2019-05-29 16:29                                                 ` Emil Velikov
2019-05-31 12:20                                                   ` Koenig, Christian
2019-06-04 17:59                                                     ` Emil Velikov
2019-06-04 10:50                               ` Michel Dänzer
     [not found]                                 ` <ee1b8980-3d78-aa6d-fe46-2c0d45c2bbdd-otUistvHUpPR7s880joybQ@public.gmane.org>
2019-06-04 11:24                                   ` Koenig, Christian
2019-06-04 13:28                                     ` Daniel Vetter
2019-05-27 15:32               ` Emil Velikov
2019-05-27 13:11   ` Daniel Vetter
     [not found]     ` <20190527131143.GN21222-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-05-27 13:47       ` Emil Velikov
2019-05-27  8:17 ` [PATCH 11/13] drm/vgem: drop DRM_AUTH usage from the driver Emil Velikov
2019-06-06 10:59   ` Emil Velikov
2019-08-06  9:44   ` Emil Velikov
2019-05-27  8:17 ` [PATCH 12/13] drm/virtio: " Emil Velikov
2019-05-27  8:17   ` Emil Velikov
2019-06-06 10:59   ` Emil Velikov
2019-06-06 10:59   ` Emil Velikov
2019-06-13  7:00     ` Gerd Hoffmann
2019-06-13  7:00     ` Gerd Hoffmann
2019-05-27  8:17 ` [PATCH 13/13] drm: allow render capable master with DRM_AUTH ioctls Emil Velikov
2019-05-27 11:56   ` Christian König
2019-05-27 12:10     ` Emil Velikov
2019-05-27 12:25       ` Koenig, Christian
2019-05-27 12:39   ` Thomas Hellstrom
2019-05-27 12:54     ` Emil Velikov
2019-05-27 13:16     ` Daniel Vetter
2019-05-27 14:01       ` Thomas Hellstrom
2019-05-27 15:22         ` Daniel Vetter
2019-06-14 12:09 ` [PATCH 01/13] drm/amdgpu: introduce and honour DRM_FORCE_AUTH workaround Emil Velikov
2019-06-14 12:55   ` Koenig, Christian
     [not found]     ` <9dbdda6c-8916-e5ae-1676-86828b9890e7-5C7GfCeVMHo@public.gmane.org>
2019-06-14 14:16       ` Michel Dänzer
2019-06-14 15:53       ` Emil Velikov
2019-06-14 16:00         ` Koenig, Christian
     [not found]           ` <84b3337c-0cdc-44d4-02c6-c56bd729ed47-5C7GfCeVMHo@public.gmane.org>
2019-06-14 16:25             ` Emil Velikov
2019-06-20 16:30           ` Emil Velikov
2019-06-21  7:12             ` Koenig, Christian
     [not found]               ` <9cad6e74-4751-0b0a-35d1-e8f0ac4d3efc-5C7GfCeVMHo@public.gmane.org>
2019-06-21  7:41                 ` Michel Dänzer
2019-06-21  8:23                   ` Koenig, Christian
2019-06-21  9:09               ` Daniel Vetter
2019-06-21  9:25                 ` Koenig, Christian
     [not found]                   ` <be9f38f5-6bb5-9535-f3d9-bafa83370e0f-5C7GfCeVMHo@public.gmane.org>
2019-06-21  9:35                     ` Daniel Vetter
     [not found]                       ` <CAKMK7uE5qO4q3RYNDp22gkMSSJGgz9ChxhuWPYqXO6D1UUvy6Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-21 10:16                         ` Christian König
2019-06-21 10:20                       ` Emil Velikov
2019-06-21 10:31                         ` Koenig, Christian [this message]
     [not found]                           ` <d241fab3-b6f0-d38a-b83f-03b70736b355-5C7GfCeVMHo@public.gmane.org>
2019-06-21 10:53                             ` Emil Velikov
2019-06-21 11:07                               ` Koenig, Christian
     [not found]                                 ` <338bb519-05f1-cb76-d965-81237f432937-5C7GfCeVMHo@public.gmane.org>
2019-06-21 11:58                                   ` Emil Velikov
2019-06-21 12:13                                     ` Koenig, Christian
     [not found]                                       ` <76158d1f-676d-2afa-244b-934967a9cb75-5C7GfCeVMHo@public.gmane.org>
2019-06-21 12:47                                         ` Emil Velikov
2019-06-21 13:00                                           ` Koenig, Christian
2019-06-21 15:37                                             ` Daniel Vetter
2019-06-21 15:24                                     ` Michel Dänzer
2019-06-21 11:03                           ` Daniel Vetter
     [not found]                             ` <CAKMK7uEVziNZJES9=JFBUu=LpmubS8=-A654cMN+QqhEmc8Fvw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-21 11:37                               ` Christian König
     [not found]                                 ` <c92dc683-6815-dc5a-dc2b-54517cc027de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-21 11:50                                   ` Daniel Vetter
     [not found]                                     ` <CAKMK7uHsv3HOXOQq=GGRkx6f+ssRg7dO7qEoBqRS9V_KiTN3Hg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-21 11:59                                       ` Daniel Vetter
     [not found]                                         ` <CAKMK7uG+EUhmZafFmjzSR=eq7543OELbHVaQnZZQGx0APSozwg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-21 12:01                                           ` Emil Velikov
2019-06-21 15:15                                       ` Michel Dänzer
     [not found]                                         ` <b182c8e3-c060-71f0-2b3b-62600d825c9f-otUistvHUpPR7s880joybQ@public.gmane.org>
2019-06-21 15:44                                           ` Daniel Vetter
2019-06-21 15:52                                             ` Michel Dänzer
     [not found]                                               ` <13024821-4767-eeaf-86eb-9ae1056f8931-otUistvHUpPR7s880joybQ@public.gmane.org>
2019-06-24  9:37                                                 ` Michel Dänzer
     [not found]                                                   ` <b03e8977-c51a-9606-383f-cf4ba674dcdd-otUistvHUpPR7s880joybQ@public.gmane.org>
2019-06-24  9:48                                                     ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d241fab3-b6f0-d38a-b83f-03b70736b355@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=airlied@linux.ie \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.