AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Philip Yang <Philip.Yang@amd.com>, amd-gfx@lists.freedesktop.org
Cc: felix.kuehling@amd.com
Subject: Re: [PATCH 1/1] drm/amdgpu: Don't clear memory when PTB BO is released
Date: Thu, 7 Jul 2022 21:03:28 +0200	[thread overview]
Message-ID: <fb61c0c1-b017-61c0-657f-39ff891db495@gmail.com> (raw)
In-Reply-To: <20220707164549.4032-1-Philip.Yang@amd.com>

Am 07.07.22 um 18:45 schrieb Philip Yang:
> MMU notifier callback unmap the svm range update page table may free the
> PTB BO, then amdgpu_fill_buffer zero BO memory could cause deadlock as
> kmalloc may trigger MMU notifier.

Uff that means the whole free BO code path can't allocate anything.

I don't think we can do that.

>
> amdgpu_vm_pt_clear setup PTB BO memory with initial value, and no
> sensitive data in page table that must be wiped out before releasing the
> memory. So don't clear the memory when PTB BO is released.
>
> Signed-off-by: Philip Yang <Philip.Yang@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com> for this change 
here, but in general we need to talk about that once more.

Regards,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 8a7b0f6162da..65b4ff6979ee 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -576,7 +576,7 @@ int amdgpu_bo_create(struct amdgpu_device *adev,
>   	if (!amdgpu_bo_support_uswc(bo->flags))
>   		bo->flags &= ~AMDGPU_GEM_CREATE_CPU_GTT_USWC;
>   
> -	if (adev->ras_enabled)
> +	if (adev->ras_enabled && bp->type != ttm_bo_type_kernel)
>   		bo->flags |= AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE;
>   
>   	bo->tbo.bdev = &adev->mman.bdev;


      parent reply	other threads:[~2022-07-07 19:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07 16:45 [PATCH 1/1] drm/amdgpu: Don't clear memory when PTB BO is released Philip Yang
2022-07-07 18:11 ` Felix Kuehling
2022-07-07 19:03 ` Christian König [this message]

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=fb61c0c1-b017-61c0-657f-39ff891db495@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=Philip.Yang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=felix.kuehling@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