All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/12] amdgpu: add UAPI for creating encrypted buffers
@ 2019-11-15  3:34 ` Aaron Liu
  0 siblings, 0 replies; 84+ messages in thread
From: Aaron Liu @ 2019-11-15  3:34 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Marek.Olsak-5C7GfCeVMHo, Huang Rui, Luben.Tuikov-5C7GfCeVMHo,
	Alexander.Deucher-5C7GfCeVMHo, Leo.Liu-5C7GfCeVMHo,
	Christian.Koenig-5C7GfCeVMHo

From: Huang Rui <ray.huang@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@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
---
 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 */
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 84+ messages in thread
* Re: [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ
@ 2019-11-15  9:39 ` Huang, Ray
  0 siblings, 0 replies; 84+ messages in thread
From: Huang, Ray @ 2019-11-15  9:39 UTC (permalink / raw)
  To: Liu, Aaron
  Cc: Olsak, Marek, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Tuikov,
	Luben, Deucher, Alexander, Liu, Leo, Koenig, Christian

On Fri, Nov 15, 2019 at 11:34:50AM +0800, Liu, Aaron wrote:
> In kernel, cs->in.flags is used for TMZ. Hence libdrm should transfer 
> the flag to kernel.
> 
> Signed-off-by: Aaron Liu <aaron.liu@amd.com>
> ---
>  amdgpu/amdgpu.h    | 4 +++-
>  amdgpu/amdgpu_cs.c | 4 ++++
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index f45f9f7..aee3f3d 
> 100644
> --- a/amdgpu/amdgpu.h
> +++ b/amdgpu/amdgpu.h
> @@ -342,7 +342,9 @@ struct amdgpu_cs_fence_info {
>   * \sa amdgpu_cs_submit()
>  */
>  struct amdgpu_cs_request {
> -	/** Specify flags with additional information */
> +	/** Specify flags with additional information
> +	 * 0-normal, 1-tmz
> +	 */
>  	uint64_t flags;
>  
>  	/** Specify HW IP block type to which to send the IB. */ diff --git 
> a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index 437c4a4..6f70771 
> 100644
> --- a/amdgpu/amdgpu_cs.c
> +++ b/amdgpu/amdgpu_cs.c
> @@ -254,6 +254,10 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
>  	memset(&cs, 0, sizeof(cs));
>  	cs.in.chunks = (uint64_t)(uintptr_t)chunk_array;
>  	cs.in.ctx_id = context->id;
> +	/* in kernel, _pad is used as flags
> +	 * #define AMDGPU_CS_FLAGS_SECURE          (1 << 0)
> +	 */
> +	cs.in._pad = (uint32_t)ibs_request->flags;

_pad is not good here. Because it's used to pass the flags to input param.

It's better to rename "_pad" in drm_amdgpu_cs_in as "flags" here.

Thanks,
Ray

>  	if (ibs_request->resources)
>  		cs.in.bo_list_handle = ibs_request->resources->handle;
>  	cs.in.num_chunks = ibs_request->number_of_ibs;
> --
> 2.7.4
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 84+ messages in thread

end of thread, other threads:[~2019-11-26 10:08 UTC | newest]

Thread overview: 84+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-15  3:34 [PATCH 01/12] amdgpu: add UAPI for creating encrypted buffers Aaron Liu
2019-11-15  3:34 ` Aaron Liu
     [not found] ` <1573788895-3936-1-git-send-email-aaron.liu-5C7GfCeVMHo@public.gmane.org>
2019-11-15  3:34   ` [PATCH 02/12] tests/amdgpu: add security test suite (v2) Aaron Liu
2019-11-15  3:34     ` Aaron Liu
2019-11-15  3:34   ` [PATCH 03/12] tests/amdgpu: add secure buffer allocation test for system memory Aaron Liu
2019-11-15  3:34     ` Aaron Liu
2019-11-15  3:34   ` [PATCH 04/12] tests/amdgpu: add secure buffer allocation test for invisible VRAM Aaron Liu
2019-11-15  3:34     ` Aaron Liu
2019-11-15  3:34   ` [PATCH 05/12] tests/amdgpu: expand write linear helper for security (v3) Aaron Liu
2019-11-15  3:34     ` Aaron Liu
     [not found]     ` <1573788895-3936-5-git-send-email-aaron.liu-5C7GfCeVMHo@public.gmane.org>
2019-11-20  1:57       ` Luben Tuikov
2019-11-20  1:57         ` Luben Tuikov
2019-11-15  3:34   ` [PATCH 06/12] tests/amdgpu: add device handle as input param for exec_cs_helper and write_linear_helper (v4) Aaron Liu
2019-11-15  3:34     ` Aaron Liu
     [not found]     ` <1573788895-3936-6-git-send-email-aaron.liu-5C7GfCeVMHo@public.gmane.org>
2019-11-20  2:00       ` Luben Tuikov
2019-11-20  2:00         ` Luben Tuikov
2019-11-15  3:34   ` [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ Aaron Liu
2019-11-15  3:34     ` Aaron Liu
     [not found]     ` <20191115093220.GA20622@ray.huang@amd.com>
     [not found]       ` <20191115093220.GA20622-i1F8m7ETrFbYtjvyW6yDsg@public.gmane.org@amd.com>
2019-11-15 12:50         ` Christian König
2019-11-15 12:50           ` Christian König
     [not found]           ` <ea9f95d8-a444-270c-85e6-ab062954320f-5C7GfCeVMHo@public.gmane.org>
2019-11-18  9:19             ` Liu, Aaron
2019-11-18  9:19               ` Liu, Aaron
     [not found]               ` <MN2PR12MB3838B600C9A44A584ECFF53EF04D0-rweVpJHSKTrcE+Ck/nypMAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-11-18 11:31                 ` Christian König
2019-11-18 11:31                   ` Christian König
2019-11-15  3:34   ` [PATCH 08/12] tests/amdgpu: expand secure param for exec_cs_helper Aaron Liu
2019-11-15  3:34     ` Aaron Liu
     [not found]     ` <1573788895-3936-8-git-send-email-aaron.liu-5C7GfCeVMHo@public.gmane.org>
2019-11-15  9:55       ` Huang, Ray
2019-11-15  9:55         ` Huang, Ray
2019-11-15  9:56       ` Huang, Ray
2019-11-15  9:56         ` Huang, Ray
2019-11-15  3:34   ` [PATCH 09/12] tests/amdgpu: add atomic_mem cp_packet to verify the secure buffer Aaron Liu
2019-11-15  3:34     ` Aaron Liu
     [not found]     ` <1573788895-3936-9-git-send-email-aaron.liu-5C7GfCeVMHo@public.gmane.org>
2019-11-15  9:44       ` Huang, Ray
2019-11-15  9:44         ` Huang, Ray
2019-11-15 10:04       ` Huang, Ray
2019-11-15 10:04         ` Huang, Ray
2019-11-15  3:34   ` [PATCH 10/12] tests/amdgpu: add test to submit a gfx command with secure context Aaron Liu
2019-11-15  3:34     ` Aaron Liu
     [not found]     ` <1573788895-3936-10-git-send-email-aaron.liu-5C7GfCeVMHo@public.gmane.org>
2019-11-15 10:06       ` Huang, Ray
2019-11-15 10:06         ` Huang, Ray
2019-11-15  3:34   ` [PATCH 11/12] tests/amdgpu: add atomic dma command to verify the secure buffer Aaron Liu
2019-11-15  3:34     ` Aaron Liu
     [not found]     ` <1573788895-3936-11-git-send-email-aaron.liu-5C7GfCeVMHo@public.gmane.org>
2019-11-15 10:03       ` Huang, Ray
2019-11-15 10:03         ` Huang, Ray
2019-11-15  3:34   ` [PATCH 12/12] tests/amdgpu: add test to submit a sdma command with secure context Aaron Liu
2019-11-15  3:34     ` Aaron Liu
     [not found]     ` <1573788895-3936-12-git-send-email-aaron.liu-5C7GfCeVMHo@public.gmane.org>
2019-11-15 10:07       ` Huang, Ray
2019-11-15 10:07         ` Huang, Ray
2019-11-15 12:56   ` [PATCH 01/12] amdgpu: add UAPI for creating encrypted buffers Christian König
2019-11-15 12:56     ` Christian König
     [not found]     ` <06a979a0-0795-88cb-f1d9-80255165f0e4-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-11-15 14:49       ` Deucher, Alexander
2019-11-15 14:49         ` Deucher, Alexander
     [not found]         ` <DM5PR12MB182063DB1ACAD38C768ECAC3F7700-2J9CzHegvk8qWyLXlBb1HgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-11-15 15:08           ` Koenig, Christian
2019-11-15 15:08             ` Koenig, Christian
     [not found]             ` <1f6819bc-cf46-4f34-a569-9ba39a9c6559-2ueSQiBKiTY7tOexoI0I+QC/G2K4zDHf@public.gmane.org>
2019-11-15 19:34               ` Olsak, Marek
2019-11-15 19:34                 ` Olsak, Marek
     [not found]                 ` <DM6PR12MB32097BA0BE4D40FF431A6E11F9700-lmeGfMZKVrEA9tGwT7oCEgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-11-15 19:52                   ` Olsak, Marek
2019-11-15 19:52                     ` Olsak, Marek
     [not found]                     ` <DM6PR12MB3209676F6F84150C08400C93F9700-lmeGfMZKVrEA9tGwT7oCEgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-11-18  9:28                       ` Liu, Aaron
2019-11-18  9:28                         ` Liu, Aaron
2019-11-20  1:52   ` Luben Tuikov
2019-11-20  1:52     ` Luben Tuikov
     [not found]     ` <6cba1e53-1c0d-d408-4d16-cae93ec9e62e-5C7GfCeVMHo@public.gmane.org>
2019-11-20  2:41       ` Marek Olšák
2019-11-20  2:41         ` Marek Olšák
     [not found]         ` <CAAxE2A6ZdjfV1vWh1KQmTR+gVFq0n098Gg8bWjprwdqvUQGQoQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-11-20 16:49           ` Luben Tuikov
2019-11-20 16:49             ` Luben Tuikov
     [not found]             ` <60f3793f-c568-798c-a516-870d2d20d8d8-5C7GfCeVMHo@public.gmane.org>
2019-11-20 17:05               ` Harry Wentland
2019-11-20 17:05                 ` Harry Wentland
     [not found]                 ` <3e6f8c10-6cfe-73c7-c656-1b2ad69f5eb2-5C7GfCeVMHo@public.gmane.org>
2019-11-20 17:39                   ` Harry Wentland
2019-11-20 17:39                     ` Harry Wentland
2019-11-20 17:16               ` Christian König
2019-11-20 17:16                 ` Christian König
     [not found]                 ` <cac7e351-dba8-125b-dc5d-b2fdec77731b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-11-20 17:24                   ` Christian König
2019-11-20 17:24                     ` Christian König
     [not found]                     ` <0622cbcb-9b04-eed3-ad1e-7a40cc03c73a-5C7GfCeVMHo@public.gmane.org>
2019-11-20 17:50                       ` Luben Tuikov
2019-11-20 17:50                         ` Luben Tuikov
     [not found]                         ` <31a1cde2-18ab-96f5-47a4-6f113cbc9e4a-5C7GfCeVMHo@public.gmane.org>
2019-11-20 18:40                           ` Christian König
2019-11-20 18:40                             ` Christian König
     [not found]                             ` <069abbd5-564d-aca7-ddfb-2336d56982eb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-11-20 19:08                               ` Luben Tuikov
2019-11-20 19:08                                 ` Luben Tuikov
     [not found]                                 ` <6ddda4a0-ed0e-eb29-e2f2-ba1e5cdbde1b-5C7GfCeVMHo@public.gmane.org>
2019-11-26 10:08                                   ` Christian König
2019-11-26 10:08                                     ` Christian König
2019-11-15  9:39 [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ Huang, Ray
2019-11-15  9:39 ` Huang, Ray

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.