All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ
@ 2019-11-15  9:39 ` Huang, Ray
  0 siblings, 0 replies; 10+ 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] 10+ 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; 10+ messages in thread
From: Huang, Ray @ 2019-11-15  9:39 UTC (permalink / raw)
  To: Liu, Aaron
  Cc: Olsak, Marek, amd-gfx, 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] 10+ messages in thread

* Re: [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ
@ 2019-11-18 11:31                   ` Christian König
  0 siblings, 0 replies; 10+ messages in thread
From: Christian König @ 2019-11-18 11:31 UTC (permalink / raw)
  To: Liu, Aaron, Huang, Ray
  Cc: Deucher, Alexander, Olsak, Marek, Tuikov, Luben, Liu, Leo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 18.11.19 um 10:19 schrieb Liu, Aaron:
>
> BR,
> Aaron Liu
>
>> -----Original Message-----
>> From: Koenig, Christian <Christian.Koenig@amd.com>
>> Sent: Friday, November 15, 2019 8:50 PM
>> To: Huang, Ray <Ray.Huang@amd.com>; Liu, Aaron <Aaron.Liu@amd.com>
>> Cc: amd-gfx@lists.freedesktop.org; Deucher, Alexander
>> <Alexander.Deucher@amd.com>; Olsak, Marek <Marek.Olsak@amd.com>;
>> Liu, Leo <Leo.Liu@amd.com>; Tuikov, Luben <Luben.Tuikov@amd.com>
>> Subject: Re: [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ
>>
>> Am 15.11.19 um 10:32 schrieb Huang Rui:
>>> 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.
>> Actually I don't think we need that stuff altogether, please sync up with
>> Marek on this.
>>
>> As far asI know the whole amdgpu_cs_submit interface was deprecated in
>> favor of the new amdgpu_cs_submit_raw() interface.
> Christian, Marek,
> In addition to syncobj_command_submission_helper uses amdgpu_cs_submit_raw,
> the other test suites still use older interface(amdgpu_cs_submit). We'd better to
> reorganize the relevant codes. This does not make much sense to only modify one call.

Well in this case you need to change all other test cases to use 
amdgpu_cs_submit_raw as well.

I will certainly reject any changes to the deprecated command submission 
interface.

That has just way to much potential to break older versions of the 
userspace stack in unforeseen ways.

Regards,
Christian.

>
>
>> Regards,
>> Christian.
>>
>>> 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] 10+ messages in thread

* Re: [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ
@ 2019-11-18 11:31                   ` Christian König
  0 siblings, 0 replies; 10+ messages in thread
From: Christian König @ 2019-11-18 11:31 UTC (permalink / raw)
  To: Liu, Aaron, Huang, Ray
  Cc: Deucher, Alexander, Olsak, Marek, Tuikov, Luben, Liu, Leo, amd-gfx

Am 18.11.19 um 10:19 schrieb Liu, Aaron:
>
> BR,
> Aaron Liu
>
>> -----Original Message-----
>> From: Koenig, Christian <Christian.Koenig@amd.com>
>> Sent: Friday, November 15, 2019 8:50 PM
>> To: Huang, Ray <Ray.Huang@amd.com>; Liu, Aaron <Aaron.Liu@amd.com>
>> Cc: amd-gfx@lists.freedesktop.org; Deucher, Alexander
>> <Alexander.Deucher@amd.com>; Olsak, Marek <Marek.Olsak@amd.com>;
>> Liu, Leo <Leo.Liu@amd.com>; Tuikov, Luben <Luben.Tuikov@amd.com>
>> Subject: Re: [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ
>>
>> Am 15.11.19 um 10:32 schrieb Huang Rui:
>>> 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.
>> Actually I don't think we need that stuff altogether, please sync up with
>> Marek on this.
>>
>> As far asI know the whole amdgpu_cs_submit interface was deprecated in
>> favor of the new amdgpu_cs_submit_raw() interface.
> Christian, Marek,
> In addition to syncobj_command_submission_helper uses amdgpu_cs_submit_raw,
> the other test suites still use older interface(amdgpu_cs_submit). We'd better to
> reorganize the relevant codes. This does not make much sense to only modify one call.

Well in this case you need to change all other test cases to use 
amdgpu_cs_submit_raw as well.

I will certainly reject any changes to the deprecated command submission 
interface.

That has just way to much potential to break older versions of the 
userspace stack in unforeseen ways.

Regards,
Christian.

>
>
>> Regards,
>> Christian.
>>
>>> 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] 10+ messages in thread

* RE: [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ
@ 2019-11-18  9:19               ` Liu, Aaron
  0 siblings, 0 replies; 10+ messages in thread
From: Liu, Aaron @ 2019-11-18  9:19 UTC (permalink / raw)
  To: Koenig, Christian, Huang, Ray
  Cc: Deucher, Alexander, Olsak, Marek, Tuikov, Luben, Liu, Leo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW



BR,
Aaron Liu

> -----Original Message-----
> From: Koenig, Christian <Christian.Koenig@amd.com>
> Sent: Friday, November 15, 2019 8:50 PM
> To: Huang, Ray <Ray.Huang@amd.com>; Liu, Aaron <Aaron.Liu@amd.com>
> Cc: amd-gfx@lists.freedesktop.org; Deucher, Alexander
> <Alexander.Deucher@amd.com>; Olsak, Marek <Marek.Olsak@amd.com>;
> Liu, Leo <Leo.Liu@amd.com>; Tuikov, Luben <Luben.Tuikov@amd.com>
> Subject: Re: [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ
> 
> Am 15.11.19 um 10:32 schrieb Huang Rui:
> > 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.
> 
> Actually I don't think we need that stuff altogether, please sync up with
> Marek on this.
> 
> As far asI know the whole amdgpu_cs_submit interface was deprecated in
> favor of the new amdgpu_cs_submit_raw() interface.

Christian, Marek,
In addition to syncobj_command_submission_helper uses amdgpu_cs_submit_raw, 
the other test suites still use older interface(amdgpu_cs_submit). We'd better to 
reorganize the relevant codes. This does not make much sense to only modify one call.


> Regards,
> Christian.
> 
> >
> > 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] 10+ messages in thread

* RE: [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ
@ 2019-11-18  9:19               ` Liu, Aaron
  0 siblings, 0 replies; 10+ messages in thread
From: Liu, Aaron @ 2019-11-18  9:19 UTC (permalink / raw)
  To: Koenig, Christian, Huang, Ray
  Cc: Deucher, Alexander, Olsak, Marek, Tuikov, Luben, Liu, Leo, amd-gfx



BR,
Aaron Liu

> -----Original Message-----
> From: Koenig, Christian <Christian.Koenig@amd.com>
> Sent: Friday, November 15, 2019 8:50 PM
> To: Huang, Ray <Ray.Huang@amd.com>; Liu, Aaron <Aaron.Liu@amd.com>
> Cc: amd-gfx@lists.freedesktop.org; Deucher, Alexander
> <Alexander.Deucher@amd.com>; Olsak, Marek <Marek.Olsak@amd.com>;
> Liu, Leo <Leo.Liu@amd.com>; Tuikov, Luben <Luben.Tuikov@amd.com>
> Subject: Re: [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ
> 
> Am 15.11.19 um 10:32 schrieb Huang Rui:
> > 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.
> 
> Actually I don't think we need that stuff altogether, please sync up with
> Marek on this.
> 
> As far asI know the whole amdgpu_cs_submit interface was deprecated in
> favor of the new amdgpu_cs_submit_raw() interface.

Christian, Marek,
In addition to syncobj_command_submission_helper uses amdgpu_cs_submit_raw, 
the other test suites still use older interface(amdgpu_cs_submit). We'd better to 
reorganize the relevant codes. This does not make much sense to only modify one call.


> Regards,
> Christian.
> 
> >
> > 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] 10+ messages in thread

* Re: [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ
@ 2019-11-15 12:50           ` Christian König
  0 siblings, 0 replies; 10+ messages in thread
From: Christian König @ 2019-11-15 12:50 UTC (permalink / raw)
  To: Huang Rui, Liu, Aaron
  Cc: Deucher, Alexander, Olsak, Marek, Tuikov, Luben, Liu, Leo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 15.11.19 um 10:32 schrieb Huang Rui:
> 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.

Actually I don't think we need that stuff altogether, please sync up 
with Marek on this.

As far asI know the whole amdgpu_cs_submit interface was deprecated in 
favor of the new amdgpu_cs_submit_raw() interface.

Regards,
Christian.

>
> 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] 10+ messages in thread

* Re: [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ
@ 2019-11-15 12:50           ` Christian König
  0 siblings, 0 replies; 10+ messages in thread
From: Christian König @ 2019-11-15 12:50 UTC (permalink / raw)
  To: Huang Rui, Liu, Aaron
  Cc: Deucher, Alexander, Olsak, Marek, Tuikov, Luben, Liu, Leo, amd-gfx

Am 15.11.19 um 10:32 schrieb Huang Rui:
> 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.

Actually I don't think we need that stuff altogether, please sync up 
with Marek on this.

As far asI know the whole amdgpu_cs_submit interface was deprecated in 
favor of the new amdgpu_cs_submit_raw() interface.

Regards,
Christian.

>
> 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] 10+ messages in thread

* [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ
@ 2019-11-15  3:34     ` Aaron Liu
  0 siblings, 0 replies; 10+ messages in thread
From: Aaron Liu @ 2019-11-15  3:34 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Marek.Olsak-5C7GfCeVMHo, Ray.Huang-5C7GfCeVMHo, Aaron Liu,
	Luben.Tuikov-5C7GfCeVMHo, Alexander.Deucher-5C7GfCeVMHo,
	Leo.Liu-5C7GfCeVMHo, Christian.Koenig-5C7GfCeVMHo

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;
 	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 related	[flat|nested] 10+ messages in thread

* [PATCH 07/12] amdgpu: using IB flags for TMZ or non-TMZ
@ 2019-11-15  3:34     ` Aaron Liu
  0 siblings, 0 replies; 10+ messages in thread
From: Aaron Liu @ 2019-11-15  3:34 UTC (permalink / raw)
  To: amd-gfx
  Cc: Marek.Olsak, Ray.Huang, Aaron Liu, Luben.Tuikov,
	Alexander.Deucher, Leo.Liu, Christian.Koenig

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;
 	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 related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-11-18 11:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2019-11-15  3:34 [PATCH 01/12] amdgpu: add UAPI for creating encrypted buffers Aaron Liu
     [not found] ` <1573788895-3936-1-git-send-email-aaron.liu-5C7GfCeVMHo@public.gmane.org>
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

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.