amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Huang Rui <ray.huang@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>,
	Harry Wentland <harry.wentland@amd.com>,
	Aaron Liu <aaron.liu@amd.com>
Subject: Re: [PATCH] drm/amdgpu: fill the alignment for secure buffer
Date: Wed, 15 Jan 2020 08:45:50 +0100	[thread overview]
Message-ID: <0045cca4-5197-285c-3808-6c5c5b6eb3e4@amd.com> (raw)
In-Reply-To: <1579072065-10883-1-git-send-email-ray.huang@amd.com>

Am 15.01.20 um 08:07 schrieb Huang Rui:
> The alignment should match the page size for secure buffer.

That is superfluous, buffer are aligned to a page size anyway.

Christian.

>
> Signed-off-by: Huang Rui <ray.huang@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> index f39012e..a03eead 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> @@ -261,9 +261,10 @@ 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) {
> -		/* XXX: pad out alignment to meet TMZ requirements */
> -	}
> +	/* TMZ requires the secure buffer to align with page size at least */
> +	if (flags & AMDGPU_GEM_CREATE_ENCRYPTED)
> +		args->in.alignment = roundup(args->in.alignment,
> +					     AMDGPU_GPU_PAGE_SIZE);
>   
>   	r = amdgpu_gem_object_create(adev, size, args->in.alignment,
>   				     (u32)(0xffffffff & args->in.domains),

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

  reply	other threads:[~2020-01-15  7:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15  7:07 [PATCH] drm/amdgpu: fill the alignment for secure buffer Huang Rui
2020-01-15  7:45 ` Christian König [this message]
2020-01-15  7:48   ` Huang Rui
2020-01-15 10:33     ` Christian König
2020-01-15 16:33       ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0045cca4-5197-285c-3808-6c5c5b6eb3e4@amd.com \
    --to=christian.koenig@amd.com \
    --cc=aaron.liu@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=pierre-eric.pelloux-prayer@amd.com \
    --cc=ray.huang@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).