From: Huang Rui <ray.huang@amd.com>
To: "Koenig, Christian" <Christian.Koenig@amd.com>
Cc: "Deucher, Alexander" <Alexander.Deucher@amd.com>,
"Pelloux-prayer,
Pierre-eric" <Pierre-eric.Pelloux-prayer@amd.com>,
"Wentland, Harry" <Harry.Wentland@amd.com>,
"Liu, Aaron" <Aaron.Liu@amd.com>,
"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amdgpu: fill the alignment for secure buffer
Date: Wed, 15 Jan 2020 15:48:57 +0800 [thread overview]
Message-ID: <20200115074856.GA20818@jenkins-Celadon-RN> (raw)
In-Reply-To: <0045cca4-5197-285c-3808-6c5c5b6eb3e4@amd.com>
On Wed, Jan 15, 2020 at 03:45:50PM +0800, Koenig, Christian wrote:
> 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.
>
If use huge page, will buffer still be aligned?
Thanks,
Ray
> 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
next prev parent reply other threads:[~2020-01-15 7:49 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
2020-01-15 7:48 ` Huang Rui [this message]
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=20200115074856.GA20818@jenkins-Celadon-RN \
--to=ray.huang@amd.com \
--cc=Aaron.Liu@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Christian.Koenig@amd.com \
--cc=Harry.Wentland@amd.com \
--cc=Pierre-eric.Pelloux-prayer@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
/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).