[PATCH] drm/amdgpu: s/ENCRYPTED/SECURE/ on GEM create flag

Christian König ckoenig.leichtzumerken at gmail.com
Thu Dec 12 08:14:25 UTC 2019


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 at 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 */



More information about the amd-gfx mailing list