All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix the wrong logic checking when secure buffer is created
@ 2020-02-18  6:12 Huang Rui
  2020-02-18  8:04 ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: Huang Rui @ 2020-02-18  6:12 UTC (permalink / raw)
  To: amd-gfx
  Cc: Alex Deucher, Luben Tuikov, Huang Rui, Christian König, Aaron Liu

While the current amdgpu doesn't support TMZ, it will return the error if user
mode would like to allocate secure buffer.

Fixes: 17d907c drm/amdgpu: implement TMZ accessor (v3)

Signed-off-by: Huang Rui <ray.huang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index b51a060..91e4235 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -235,7 +235,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
 	if (args->in.domains & ~AMDGPU_GEM_DOMAIN_MASK)
 		return -EINVAL;
 
-	if (amdgpu_is_tmz(adev) && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
+	if (!amdgpu_is_tmz(adev) && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
 		DRM_ERROR("Cannot allocate secure buffer since TMZ is disabled\n");
 		return -EINVAL;
 	}
-- 
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] 4+ messages in thread

* Re: [PATCH] drm/amdgpu: fix the wrong logic checking when secure buffer is created
  2020-02-18  6:12 [PATCH] drm/amdgpu: fix the wrong logic checking when secure buffer is created Huang Rui
@ 2020-02-18  8:04 ` Christian König
  2020-02-18  8:27   ` Huang Rui
  0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2020-02-18  8:04 UTC (permalink / raw)
  To: Huang Rui, amd-gfx; +Cc: Alex Deucher, Luben Tuikov, Aaron Liu

Am 18.02.20 um 07:12 schrieb Huang Rui:
> While the current amdgpu doesn't support TMZ, it will return the error if user
> mode would like to allocate secure buffer.
>
> Fixes: 17d907c drm/amdgpu: implement TMZ accessor (v3)
>
> Signed-off-by: Huang Rui <ray.huang@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> index b51a060..91e4235 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> @@ -235,7 +235,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
>   	if (args->in.domains & ~AMDGPU_GEM_DOMAIN_MASK)
>   		return -EINVAL;
>   
> -	if (amdgpu_is_tmz(adev) && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
> +	if (!amdgpu_is_tmz(adev) && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
>   		DRM_ERROR("Cannot allocate secure buffer since TMZ is disabled\n");

BTW: This message should be removed because it allows userspace to spam 
the logs.

>   		return -EINVAL;
>   	}

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

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

* Re: [PATCH] drm/amdgpu: fix the wrong logic checking when secure buffer is created
  2020-02-18  8:04 ` Christian König
@ 2020-02-18  8:27   ` Huang Rui
  2020-02-18 20:55     ` Luben Tuikov
  0 siblings, 1 reply; 4+ messages in thread
From: Huang Rui @ 2020-02-18  8:27 UTC (permalink / raw)
  To: Koenig, Christian; +Cc: Deucher, Alexander, Tuikov, Luben, Liu, Aaron, amd-gfx

On Tue, Feb 18, 2020 at 04:04:15PM +0800, Koenig, Christian wrote:
> Am 18.02.20 um 07:12 schrieb Huang Rui:
> > While the current amdgpu doesn't support TMZ, it will return the error if user
> > mode would like to allocate secure buffer.
> >
> > Fixes: 17d907c drm/amdgpu: implement TMZ accessor (v3)
> >
> > Signed-off-by: Huang Rui <ray.huang@amd.com>
> 
> Reviewed-by: Christian König <christian.koenig@amd.com>
> 
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> > index b51a060..91e4235 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> > @@ -235,7 +235,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
> >   	if (args->in.domains & ~AMDGPU_GEM_DOMAIN_MASK)
> >   		return -EINVAL;
> >   
> > -	if (amdgpu_is_tmz(adev) && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
> > +	if (!amdgpu_is_tmz(adev) && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
> >   		DRM_ERROR("Cannot allocate secure buffer since TMZ is disabled\n");
> 
> BTW: This message should be removed because it allows userspace to spam 
> the logs.
> 

Fine. This can be removed.

Thanks,
Ray

> >   		return -EINVAL;
> >   	}
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amdgpu: fix the wrong logic checking when secure buffer is created
  2020-02-18  8:27   ` Huang Rui
@ 2020-02-18 20:55     ` Luben Tuikov
  0 siblings, 0 replies; 4+ messages in thread
From: Luben Tuikov @ 2020-02-18 20:55 UTC (permalink / raw)
  To: Huang Rui, Koenig, Christian; +Cc: Deucher, Alexander, Liu, Aaron, amd-gfx

On 2020-02-18 3:27 a.m., Huang Rui wrote:
> On Tue, Feb 18, 2020 at 04:04:15PM +0800, Koenig, Christian wrote:
>> Am 18.02.20 um 07:12 schrieb Huang Rui:
>>> While the current amdgpu doesn't support TMZ, it will return the error if user
>>> mode would like to allocate secure buffer.
>>>
>>> Fixes: 17d907c drm/amdgpu: implement TMZ accessor (v3)
>>>
>>> Signed-off-by: Huang Rui <ray.huang@amd.com>
>>
>> Reviewed-by: Christian König <christian.koenig@amd.com>
>>
>>> ---
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>>> index b51a060..91e4235 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>>> @@ -235,7 +235,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
>>>   	if (args->in.domains & ~AMDGPU_GEM_DOMAIN_MASK)
>>>   		return -EINVAL;
>>>   
>>> -	if (amdgpu_is_tmz(adev) && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
>>> +	if (!amdgpu_is_tmz(adev) && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
>>>   		DRM_ERROR("Cannot allocate secure buffer since TMZ is disabled\n");
>>
>> BTW: This message should be removed because it allows userspace to spam 
>> the logs.
>>
> 
> Fine. This can be removed.

I already submitted this for review, along with the flags bugfix.
???

What's going on????

Regards,
Luben


> 
> Thanks,
> Ray
> 
>>>   		return -EINVAL;
>>>   	}
>>

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

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

end of thread, other threads:[~2020-02-18 20:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18  6:12 [PATCH] drm/amdgpu: fix the wrong logic checking when secure buffer is created Huang Rui
2020-02-18  8:04 ` Christian König
2020-02-18  8:27   ` Huang Rui
2020-02-18 20:55     ` Luben Tuikov

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.