Skip to contentSkip to conversation

drm/amdgpu: fix the wrong logic checking when secure buffer is created

PATCH Superseded Huang Rui 3 participants 4 messages Feb 18, 2020

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Huang Rui

author
#0 lore raw

PATCH 1/1 drm/amdgpu: fix the wrong logic checking when secure buffer is created

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)
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1 -1
index b51a060..91e4235 100644
@@ -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;
 	}
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 18.02.20 um 07:12 schrieb Huang Rui:

Quoted 6 lines

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)
Quoted 9 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -0
index b51a060..91e4235 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data, · line 239

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1 -1
@@ -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.

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data, · line 241

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -0
  		return -EINVAL;
  	}

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#2 lore raw
Quoted 22 lines · Christian

Am 18.02.20 um 07:12 schrieb Huang Rui:

Quoted 6 lines

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)
Quoted 12 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -0
index b51a060..91e4235 100644
@@ -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;
 
Quoted 7 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data, · line 239

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1 -1
-	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

Quoted 3 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data, · line 241

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -0
  		return -EINVAL;
  	}

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw
Quoted 31 lines · Huang Rui
Quoted 22 lines · Christian

Am 18.02.20 um 07:12 schrieb Huang Rui:

Quoted 6 lines

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)
Quoted 12 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -0
index b51a060..91e4235 100644
@@ -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;
 
Quoted 7 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data, · line 239

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1 -1
-	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.

Quoted 1 line

Fine. This can be removed.

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

What's going on????

Regards,
Luben

Quoted 7 lines

Thanks,
Ray

Quoted 3 lines
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -0
  		return -EINVAL;
  	}

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx