All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philip Yang <philip.yang-5C7GfCeVMHo@public.gmane.org>
To: Alex Sierra <alex.sierra-5C7GfCeVMHo@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] amd/amdgpu: force to trigger a no-retry-fault after a retry-fault
Date: Fri, 15 Nov 2019 13:03:30 -0500	[thread overview]
Message-ID: <bd9f76ca-9dc7-6c29-9c41-fc3e0d3c0bf1@amd.com> (raw)
In-Reply-To: <20191115174314.73446-1-alex.sierra-5C7GfCeVMHo@public.gmane.org>

One suggestion below, move the flags setting for else path into else 
path looks better.

Philip

On 2019-11-15 12:43 p.m., Alex Sierra wrote:
> After a retry-fault happens, the fault handler will modify the UTCL2 to
> set PTE bits to force a no-retry-fault. This will cause the wave to
> enter the trap handler.
> 
> Change-Id: I177102891f715068f15605957ff23b0cab862603
> Signed-off-by: Alex Sierra <alex.sierra@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 13 +++++--------
>   1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 3c0bd6472a46..e4d1a8fc97d5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -3167,7 +3167,8 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, unsigned int pasid,
>   			    uint64_t addr)
>   {
>   	struct amdgpu_bo *root;
> -	uint64_t value, flags;
> +	uint64_t value = 0;
> +	uint64_t flags;
>   	struct amdgpu_vm *vm;
>   	long r;
>   
> @@ -3200,13 +3201,9 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, unsigned int pasid,
>   		AMDGPU_PTE_SYSTEM;
>   
 >-	flags = AMDGPU_PTE_VALID | AMDGPU_PTE_SNOOPED |
 >-		AMDGPU_PTE_SYSTEM;
 >
>   	if (amdgpu_vm_fault_stop == AMDGPU_VM_FAULT_STOP_NEVER) {
> -		/* Redirect the access to the dummy page */
> -		value = adev->dummy_page_addr;
> -		flags |= AMDGPU_PTE_EXECUTABLE | AMDGPU_PTE_READABLE |
> -			AMDGPU_PTE_WRITEABLE;
 > +		/* Setting PTE flags to trigger a no-retry-fault  */
 > +		flags = AMDGPU_PTE_EXECUTABLE | AMDGPU_PDE_PTE |
 > +			AMDGPU_PTE_TF;
	} else {
> -		value = 0;
 >+		flags = AMDGPU_PTE_VALID | AMDGPU_PTE_SNOOPED |
 >+			AMDGPU_PTE_SYSTEM;
 >   	}

>   
>   	r = amdgpu_vm_bo_update_mapping(adev, vm, true, NULL, addr, addr + 1,
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Philip Yang <philip.yang@amd.com>
To: Alex Sierra <alex.sierra@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] amd/amdgpu: force to trigger a no-retry-fault after a retry-fault
Date: Fri, 15 Nov 2019 13:03:30 -0500	[thread overview]
Message-ID: <bd9f76ca-9dc7-6c29-9c41-fc3e0d3c0bf1@amd.com> (raw)
Message-ID: <20191115180330.SO-Fj02zNM3Lk11BRjSkC0M3-ZzBTskTG6VdH0HCaj4@z> (raw)
In-Reply-To: <20191115174314.73446-1-alex.sierra@amd.com>

One suggestion below, move the flags setting for else path into else 
path looks better.

Philip

On 2019-11-15 12:43 p.m., Alex Sierra wrote:
> After a retry-fault happens, the fault handler will modify the UTCL2 to
> set PTE bits to force a no-retry-fault. This will cause the wave to
> enter the trap handler.
> 
> Change-Id: I177102891f715068f15605957ff23b0cab862603
> Signed-off-by: Alex Sierra <alex.sierra@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 13 +++++--------
>   1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 3c0bd6472a46..e4d1a8fc97d5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -3167,7 +3167,8 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, unsigned int pasid,
>   			    uint64_t addr)
>   {
>   	struct amdgpu_bo *root;
> -	uint64_t value, flags;
> +	uint64_t value = 0;
> +	uint64_t flags;
>   	struct amdgpu_vm *vm;
>   	long r;
>   
> @@ -3200,13 +3201,9 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, unsigned int pasid,
>   		AMDGPU_PTE_SYSTEM;
>   
 >-	flags = AMDGPU_PTE_VALID | AMDGPU_PTE_SNOOPED |
 >-		AMDGPU_PTE_SYSTEM;
 >
>   	if (amdgpu_vm_fault_stop == AMDGPU_VM_FAULT_STOP_NEVER) {
> -		/* Redirect the access to the dummy page */
> -		value = adev->dummy_page_addr;
> -		flags |= AMDGPU_PTE_EXECUTABLE | AMDGPU_PTE_READABLE |
> -			AMDGPU_PTE_WRITEABLE;
 > +		/* Setting PTE flags to trigger a no-retry-fault  */
 > +		flags = AMDGPU_PTE_EXECUTABLE | AMDGPU_PDE_PTE |
 > +			AMDGPU_PTE_TF;
	} else {
> -		value = 0;
 >+		flags = AMDGPU_PTE_VALID | AMDGPU_PTE_SNOOPED |
 >+			AMDGPU_PTE_SYSTEM;
 >   	}

>   
>   	r = amdgpu_vm_bo_update_mapping(adev, vm, true, NULL, addr, addr + 1,
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2019-11-15 18:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-15 17:43 [PATCH] amd/amdgpu: force to trigger a no-retry-fault after a retry-fault Alex Sierra
2019-11-15 17:43 ` Alex Sierra
     [not found] ` <20191115174314.73446-1-alex.sierra-5C7GfCeVMHo@public.gmane.org>
2019-11-15 18:03   ` Philip Yang [this message]
2019-11-15 18:03     ` Philip Yang
     [not found]     ` <bd9f76ca-9dc7-6c29-9c41-fc3e0d3c0bf1-5C7GfCeVMHo@public.gmane.org>
2019-11-18  3:42       ` Zeng, Oak
2019-11-18  3:42         ` Zeng, Oak
     [not found]         ` <BL0PR12MB258076EDAE60740E94C92972804D0-b4cIHhjg/p/XzH18dTCKOgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-11-18 13:46           ` Christian König
2019-11-18 13:46             ` Christian König
     [not found]             ` <b391a2bb-a078-d397-50f9-9f4cd2824cb3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-11-18 14:12               ` Zeng, Oak
2019-11-18 14:12                 ` Zeng, Oak
2019-11-15 22:38 Alex Sierra
2019-11-15 22:38 ` Alex Sierra
     [not found] ` <20191115223830.29769-1-alex.sierra-5C7GfCeVMHo@public.gmane.org>
2019-11-16  9:32   ` Christian König
2019-11-16  9:32     ` Christian König

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=bd9f76ca-9dc7-6c29-9c41-fc3e0d3c0bf1@amd.com \
    --to=philip.yang-5c7gfcevmho@public.gmane.org \
    --cc=alex.sierra-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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 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.