[PATCH 01/12] amdgpu: add UAPI for creating encrypted buffers

Liu, Aaron Aaron.Liu at amd.com
Mon Nov 18 09:28:57 UTC 2019


Thanks for reviews.

As Christian's suggestion, I added drm_version checking, for the older driver, security test suites are disabled.
I create a remote branch for libdrm: remotes/origin/aaliu/for-tmz-support

BR,
Aaron Liu

From: Olsak, Marek <Marek.Olsak at amd.com>
Sent: Saturday, November 16, 2019 3:53 AM
To: Koenig, Christian <Christian.Koenig at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>
Cc: Christian König <ckoenig.leichtzumerken at gmail.com>; Liu, Aaron <Aaron.Liu at amd.com>; amd-gfx at lists.freedesktop.org; Huang, Ray <Ray.Huang at amd.com>; Tuikov, Luben <Luben.Tuikov at amd.com>; Liu, Leo <Leo.Liu at amd.com>
Subject: Re: [PATCH 01/12] amdgpu: add UAPI for creating encrypted buffers

The way this is upstreamed is that you submit the kernel and userspace patches for review at the same time. When they see the userspace patches, the kernel patches will be accepted. When the kernel patches land in the Dave's or Linus's tree, the userspace patches can be pushed.

Marek
________________________________
From: Olsak, Marek <Marek.Olsak at amd.com<mailto:Marek.Olsak at amd.com>>
Sent: November 15, 2019 14:34
To: Koenig, Christian <Christian.Koenig at amd.com<mailto:Christian.Koenig at amd.com>>; Deucher, Alexander <Alexander.Deucher at amd.com<mailto:Alexander.Deucher at amd.com>>
Cc: Christian König <ckoenig.leichtzumerken at gmail.com<mailto:ckoenig.leichtzumerken at gmail.com>>; Liu, Aaron <Aaron.Liu at amd.com<mailto:Aaron.Liu at amd.com>>; amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org> <amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org>>; Huang, Ray <Ray.Huang at amd.com<mailto:Ray.Huang at amd.com>>; Tuikov, Luben <Luben.Tuikov at amd.com<mailto:Luben.Tuikov at amd.com>>; Liu, Leo <Leo.Liu at amd.com<mailto:Leo.Liu at amd.com>>
Subject: Re: [PATCH 01/12] amdgpu: add UAPI for creating encrypted buffers

In the kernel tree, you need to do "make headers_install". Then copy amdgpu_drm.h from ./usr/ to the libdrm tree and discard parts that we can't upstream (freesync).

Marek
________________________________
From: Koenig, Christian <Christian.Koenig at amd.com<mailto:Christian.Koenig at amd.com>>
Sent: November 15, 2019 10:08
To: Deucher, Alexander <Alexander.Deucher at amd.com<mailto:Alexander.Deucher at amd.com>>
Cc: Christian König <ckoenig.leichtzumerken at gmail.com<mailto:ckoenig.leichtzumerken at gmail.com>>; Liu, Aaron <Aaron.Liu at amd.com<mailto:Aaron.Liu at amd.com>>; amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org> <amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org>>; Olsak, Marek <Marek.Olsak at amd.com<mailto:Marek.Olsak at amd.com>>; Huang, Ray <Ray.Huang at amd.com<mailto:Ray.Huang at amd.com>>; Tuikov, Luben <Luben.Tuikov at amd.com<mailto:Luben.Tuikov at amd.com>>; Liu, Leo <Leo.Liu at amd.com<mailto:Leo.Liu at amd.com>>
Subject: Re: [PATCH 01/12] amdgpu: add UAPI for creating encrypted buffers

I know, that's the usual chicken and egg problem with updating libdrm.

But we should update the file with the kernel version and not pick all changes line by line.

Christian.

Am 15.11.2019 15:49 schrieb "Deucher, Alexander" <Alexander.Deucher at amd.com<mailto:Alexander.Deucher at amd.com>>:
We can't land the kernel side until we have real userspace (e.g., Mesa) that uses the TMZ interfaces.  The unit tests are not enough.

Alex


________________________________
From: Christian König <ckoenig.leichtzumerken at gmail.com<mailto:ckoenig.leichtzumerken at gmail.com>>
Sent: Friday, November 15, 2019 7:56 AM
To: Liu, Aaron <Aaron.Liu at amd.com<mailto:Aaron.Liu at amd.com>>; amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org> <amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org>>
Cc: Olsak, Marek <Marek.Olsak at amd.com<mailto:Marek.Olsak at amd.com>>; Huang, Ray <Ray.Huang at amd.com<mailto:Ray.Huang at amd.com>>; Tuikov, Luben <Luben.Tuikov at amd.com<mailto:Luben.Tuikov at amd.com>>; Deucher, Alexander <Alexander.Deucher at amd.com<mailto:Alexander.Deucher at amd.com>>; Liu, Leo <Leo.Liu at amd.com<mailto:Leo.Liu at amd.com>>; Koenig, Christian <Christian.Koenig at amd.com<mailto:Christian.Koenig at amd.com>>
Subject: Re: [PATCH 01/12] amdgpu: add UAPI for creating encrypted buffers

Am 15.11.19 um 04:34 schrieb Aaron Liu:
> From: Huang Rui <ray.huang at amd.com<mailto:ray.huang at amd.com>>
>
> To align the kernel uapi change from Alex:
>
> "Add a flag to the GEM_CREATE ioctl to create encrypted buffers. Buffers with
> this flag set will be created with the TMZ bit set in the PTEs or engines
> accessing them. This is required in order to properly access the data from the
> engines."
>
> We will use GEM_CREATE_ENCRYPTED flag for secure buffer allocation.
>
> Signed-off-by: Huang Rui <ray.huang at amd.com<mailto:ray.huang at amd.com>>
> Reviewed-by: Alex Deucher <alexander.deucher at amd.com<mailto:alexander.deucher at amd.com>>

Please read up on how amdpu_drm.h is updated. The change must first land
upstream and then the file is synced up somehow semi-automatic.

Christian.

> ---
>   include/drm/amdgpu_drm.h | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h
> index 5c28aa7..1a95e37 100644
> --- a/include/drm/amdgpu_drm.h
> +++ b/include/drm/amdgpu_drm.h
> @@ -141,6 +141,11 @@ extern "C" {
>    * releasing the memory
>    */
>   #define AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE      (1 << 9)
> +/* Flag that BO will be encrypted and that the TMZ bit should be
> + * set in the PTEs when mapping this buffer via GPUVM or
> + * accessing it with various hw blocks
> + */
> +#define AMDGPU_GEM_CREATE_ENCRYPTED          (1 << 10)
>
>   /* Hybrid specific */
>   /* Flag that the memory allocation should be from top of domain */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20191118/b0f4b0d6/attachment-0001.html>


More information about the amd-gfx mailing list