Skip to contentSkip to conversation

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

PATCH In review Huang Rui 3 participants 3 messages Feb 18, 2020

Subsystems (2)
lore
Share & tools
lore

Huang Rui

author
#0 lore raw

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

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)

v2: we didn't need this checking anymore.
v3: only print message once time.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +2 -2
index b51a060..5bec66e 100644
@@ -235,8 +235,8 @@ 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)) {
-		DRM_ERROR("Cannot allocate secure buffer since TMZ is disabled\n");
+	if (!amdgpu_is_tmz(adev) && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
+		DRM_NOTE_ONCE("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
Reviewed-by on v3 1/1
#1 lore raw

Am 18.02.20 um 11:39 schrieb Huang Rui:

Quoted 9 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)

v2: we didn't need this checking anymore.
v3: only print message once time.

Quoted 9 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -0
index b51a060..5bec66e 100644

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

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +2 -2
@@ -235,8 +235,8 @@ 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)) {
-		DRM_ERROR("Cannot allocate secure buffer since TMZ is disabled\n");
+	if (!amdgpu_is_tmz(adev) && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
+		DRM_NOTE_ONCE("Cannot allocate secure buffer since TMZ is disabled\n");
  		return -EINVAL;
  	}
 

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

Acked-by Nirmoy Das on v3 1/1
#2 lore raw
In reply to Huang Rui
Quoted 9 lines · 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)

v2: we didn't need this checking anymore.
v3: only print message once time.

Quoted 9 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -0
index b51a060..5bec66e 100644

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

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +2 -2
@@ -235,8 +235,8 @@ 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)) {
-		DRM_ERROR("Cannot allocate secure buffer since TMZ is disabled\n");
+	if (!amdgpu_is_tmz(adev) && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
+		DRM_NOTE_ONCE("Cannot allocate secure buffer since TMZ is disabled\n");
  		return -EINVAL;
  	}
 

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