All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: s/ENCRYPTED/SECURE/ on GEM create flag
@ 2019-12-11 16:21 Alex Deucher
  2019-12-12  8:14 ` Christian König
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Deucher @ 2019-12-11 16:21 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

Rename to SECURE to align with the CS flag naming.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---

Several other teams thought it would be cleaner to call it SECURE
since it aligns better with the CS interface.  I don't have a
strong opinion either way.

 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c    | 6 +++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 2 +-
 include/uapi/drm/amdgpu_drm.h              | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index f39012e4a0fa..0691692f096e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -227,7 +227,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
 		      AMDGPU_GEM_CREATE_VRAM_CLEARED |
 		      AMDGPU_GEM_CREATE_VM_ALWAYS_VALID |
 		      AMDGPU_GEM_CREATE_EXPLICIT_SYNC |
-		      AMDGPU_GEM_CREATE_ENCRYPTED))
+		      AMDGPU_GEM_CREATE_SECURE))
 
 		return -EINVAL;
 
@@ -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 (!adev->tmz.enabled && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
+	if (!adev->tmz.enabled && (flags & AMDGPU_GEM_CREATE_SECURE)) {
 		DRM_ERROR("Cannot allocate secure buffer while tmz is disabled\n");
 		return -EINVAL;
 	}
@@ -261,7 +261,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
 		resv = vm->root.base.bo->tbo.base.resv;
 	}
 
-	if (flags & AMDGPU_GEM_CREATE_ENCRYPTED) {
+	if (flags & AMDGPU_GEM_CREATE_SECURE) {
 		/* XXX: pad out alignment to meet TMZ requirements */
 	}
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
index 2eeafc77c9c1..5728e5a27fb8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
@@ -232,7 +232,7 @@ static inline bool amdgpu_bo_explicit_sync(struct amdgpu_bo *bo)
  */
 static inline bool amdgpu_bo_encrypted(struct amdgpu_bo *bo)
 {
-	return bo->flags & AMDGPU_GEM_CREATE_ENCRYPTED;
+	return bo->flags & AMDGPU_GEM_CREATE_SECURE;
 }
 
 bool amdgpu_bo_is_amdgpu_bo(struct ttm_buffer_object *bo);
diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
index 918ac3548cd3..2ae80d31aecf 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -135,11 +135,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
+/* Flag that BO will be secure 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)
+#define AMDGPU_GEM_CREATE_SECURE		(1 << 10)
 
 struct drm_amdgpu_gem_create_in  {
 	/** the requested memory size */
-- 
2.23.0

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

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

* Re: [PATCH] drm/amdgpu: s/ENCRYPTED/SECURE/ on GEM create flag
  2019-12-11 16:21 [PATCH] drm/amdgpu: s/ENCRYPTED/SECURE/ on GEM create flag Alex Deucher
@ 2019-12-12  8:14 ` Christian König
  0 siblings, 0 replies; 2+ messages in thread
From: Christian König @ 2019-12-12  8:14 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx; +Cc: Alex Deucher

Am 11.12.19 um 17:21 schrieb Alex Deucher:
> Rename to SECURE to align with the CS flag naming.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

I was rather close to given an acked-by, but then thought if that 
actually makes sense.

The flags describe what should happen to the buffer and CS, and 
considering that to distinct that actually makes sense.

In other words the buffer is encrypted and because of this can only be 
accessed by a secure submission.

Regards,
Christian.

> ---
>
> Several other teams thought it would be cleaner to call it SECURE
> since it aligns better with the CS interface.  I don't have a
> strong opinion either way.
>
>   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c    | 6 +++---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 2 +-
>   include/uapi/drm/amdgpu_drm.h              | 4 ++--
>   3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> index f39012e4a0fa..0691692f096e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> @@ -227,7 +227,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
>   		      AMDGPU_GEM_CREATE_VRAM_CLEARED |
>   		      AMDGPU_GEM_CREATE_VM_ALWAYS_VALID |
>   		      AMDGPU_GEM_CREATE_EXPLICIT_SYNC |
> -		      AMDGPU_GEM_CREATE_ENCRYPTED))
> +		      AMDGPU_GEM_CREATE_SECURE))
>   
>   		return -EINVAL;
>   
> @@ -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 (!adev->tmz.enabled && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
> +	if (!adev->tmz.enabled && (flags & AMDGPU_GEM_CREATE_SECURE)) {
>   		DRM_ERROR("Cannot allocate secure buffer while tmz is disabled\n");
>   		return -EINVAL;
>   	}
> @@ -261,7 +261,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
>   		resv = vm->root.base.bo->tbo.base.resv;
>   	}
>   
> -	if (flags & AMDGPU_GEM_CREATE_ENCRYPTED) {
> +	if (flags & AMDGPU_GEM_CREATE_SECURE) {
>   		/* XXX: pad out alignment to meet TMZ requirements */
>   	}
>   
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> index 2eeafc77c9c1..5728e5a27fb8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> @@ -232,7 +232,7 @@ static inline bool amdgpu_bo_explicit_sync(struct amdgpu_bo *bo)
>    */
>   static inline bool amdgpu_bo_encrypted(struct amdgpu_bo *bo)
>   {
> -	return bo->flags & AMDGPU_GEM_CREATE_ENCRYPTED;
> +	return bo->flags & AMDGPU_GEM_CREATE_SECURE;
>   }
>   
>   bool amdgpu_bo_is_amdgpu_bo(struct ttm_buffer_object *bo);
> diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
> index 918ac3548cd3..2ae80d31aecf 100644
> --- a/include/uapi/drm/amdgpu_drm.h
> +++ b/include/uapi/drm/amdgpu_drm.h
> @@ -135,11 +135,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
> +/* Flag that BO will be secure 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)
> +#define AMDGPU_GEM_CREATE_SECURE		(1 << 10)
>   
>   struct drm_amdgpu_gem_create_in  {
>   	/** the requested memory size */

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

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

end of thread, other threads:[~2019-12-12  8:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11 16:21 [PATCH] drm/amdgpu: s/ENCRYPTED/SECURE/ on GEM create flag Alex Deucher
2019-12-12  8:14 ` 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.