All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: improve GMC v9 page fault message
@ 2019-01-02 13:35 Christian König
       [not found] ` <20190102133506.110324-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Christian König @ 2019-01-02 13:35 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Note if this is a retry fault or not and cleanup the message a bit.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
index 521ac8954652..9c082f9aea1a 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
@@ -305,6 +305,7 @@ static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev,
 				struct amdgpu_iv_entry *entry)
 {
 	struct amdgpu_vmhub *hub = &adev->vmhub[entry->vmid_src];
+	bool retry_fault = !!(entry->src_data[1] & 0x80);
 	uint32_t status = 0;
 	u64 addr;
 
@@ -326,8 +327,10 @@ static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev,
 		amdgpu_vm_get_task_info(adev, entry->pasid, &task_info);
 
 		dev_err(adev->dev,
-			"[%s] VMC page fault (src_id:%u ring:%u vmid:%u pasid:%u, for process %s pid %d thread %s pid %d)\n",
+			"[%s] %s page fault (src_id:%u ring:%u vmid:%u "
+			"pasid:%u, for process %s pid %d thread %s pid %d)\n",
 			entry->vmid_src ? "mmhub" : "gfxhub",
+			retry_fault ? "retry" : "no-retry",
 			entry->src_id, entry->ring_id, entry->vmid,
 			entry->pasid, task_info.process_name, task_info.tgid,
 			task_info.task_name, task_info.pid);
-- 
2.17.1

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] drm/amdgpu: set the executable flag on unused Vega10 PTEs
       [not found] ` <20190102133506.110324-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
@ 2019-01-02 13:35   ` Christian König
       [not found]     ` <20190102133506.110324-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Christian König @ 2019-01-02 13:35 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Otherwise we run into a non-retry fault on access.

It seems to be a hardware bug that the executable bit has
higher priority than the valid bit.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index e73d152659a2..01a68f4e17d4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -799,9 +799,15 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev,
 		addr += ats_entries * 8;
 	}
 
-	if (entries)
+	if (entries) {
+		uint64_t value = 0;
+
+		if (level == AMDGPU_VM_PTB && adev->asic_type >= CHIP_VEGA10)
+			value = AMDGPU_PTE_EXECUTABLE;
+
 		amdgpu_vm_set_pte_pde(adev, &job->ibs[0], addr, 0,
-				      entries, 0, 0);
+				      entries, 0, value);
+	}
 
 	amdgpu_ring_pad_ib(ring, &job->ibs[0]);
 
-- 
2.17.1

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: set the executable flag on unused Vega10 PTEs
       [not found]     ` <20190102133506.110324-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>
@ 2019-01-02 15:45       ` Deucher, Alexander
  2019-01-02 20:26       ` Kuehling, Felix
  1 sibling, 0 replies; 5+ messages in thread
From: Deucher, Alexander @ 2019-01-02 15:45 UTC (permalink / raw)
  To: Christian König, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 1872 bytes --]

Series is:

Acked-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sent: Wednesday, January 2, 2019 8:35:06 AM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH 2/2] drm/amdgpu: set the executable flag on unused Vega10 PTEs

Otherwise we run into a non-retry fault on access.

It seems to be a hardware bug that the executable bit has
higher priority than the valid bit.

Signed-off-by: Christian König <christian.koenig-5C7GfCeVMHo@public.gmane.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index e73d152659a2..01a68f4e17d4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -799,9 +799,15 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev,
                 addr += ats_entries * 8;
         }

-       if (entries)
+       if (entries) {
+               uint64_t value = 0;
+
+               if (level == AMDGPU_VM_PTB && adev->asic_type >= CHIP_VEGA10)
+                       value = AMDGPU_PTE_EXECUTABLE;
+
                 amdgpu_vm_set_pte_pde(adev, &job->ibs[0], addr, 0,
-                                     entries, 0, 0);
+                                     entries, 0, value);
+       }

         amdgpu_ring_pad_ib(ring, &job->ibs[0]);

--
2.17.1

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

[-- Attachment #1.2: Type: text/html, Size: 3987 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: set the executable flag on unused Vega10 PTEs
       [not found]     ` <20190102133506.110324-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  2019-01-02 15:45       ` Deucher, Alexander
@ 2019-01-02 20:26       ` Kuehling, Felix
       [not found]         ` <28ccb2db-f54f-110a-dd7e-89c38a8bed81-5C7GfCeVMHo@public.gmane.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Kuehling, Felix @ 2019-01-02 20:26 UTC (permalink / raw)
  To: Christian König, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Don't you need to update amdgpu_vm_clear_freed as well?

Regards,
  Felix

On 2019-01-02 8:35 a.m., Christian König wrote:
> Otherwise we run into a non-retry fault on access.
>
> It seems to be a hardware bug that the executable bit has
> higher priority than the valid bit.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index e73d152659a2..01a68f4e17d4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -799,9 +799,15 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev,
>  		addr += ats_entries * 8;
>  	}
>  
> -	if (entries)
> +	if (entries) {
> +		uint64_t value = 0;
> +
> +		if (level == AMDGPU_VM_PTB && adev->asic_type >= CHIP_VEGA10)
> +			value = AMDGPU_PTE_EXECUTABLE;
> +
>  		amdgpu_vm_set_pte_pde(adev, &job->ibs[0], addr, 0,
> -				      entries, 0, 0);
> +				      entries, 0, value);
> +	}
>  
>  	amdgpu_ring_pad_ib(ring, &job->ibs[0]);
>  
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: set the executable flag on unused Vega10 PTEs
       [not found]         ` <28ccb2db-f54f-110a-dd7e-89c38a8bed81-5C7GfCeVMHo@public.gmane.org>
@ 2019-01-03  8:19           ` Christian König
  0 siblings, 0 replies; 5+ messages in thread
From: Christian König @ 2019-01-03  8:19 UTC (permalink / raw)
  To: Kuehling, Felix, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Oh, good point. Completely forgot about those.

Going to fix the patch,
Christian.

Am 02.01.19 um 21:26 schrieb Kuehling, Felix:
> Don't you need to update amdgpu_vm_clear_freed as well?
>
> Regards,
>    Felix
>
> On 2019-01-02 8:35 a.m., Christian König wrote:
>> Otherwise we run into a non-retry fault on access.
>>
>> It seems to be a hardware bug that the executable bit has
>> higher priority than the valid bit.
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 ++++++++--
>>   1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> index e73d152659a2..01a68f4e17d4 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> @@ -799,9 +799,15 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev,
>>   		addr += ats_entries * 8;
>>   	}
>>   
>> -	if (entries)
>> +	if (entries) {
>> +		uint64_t value = 0;
>> +
>> +		if (level == AMDGPU_VM_PTB && adev->asic_type >= CHIP_VEGA10)
>> +			value = AMDGPU_PTE_EXECUTABLE;
>> +
>>   		amdgpu_vm_set_pte_pde(adev, &job->ibs[0], addr, 0,
>> -				      entries, 0, 0);
>> +				      entries, 0, value);
>> +	}
>>   
>>   	amdgpu_ring_pad_ib(ring, &job->ibs[0]);
>>   

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-03  8:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-02 13:35 [PATCH 1/2] drm/amdgpu: improve GMC v9 page fault message Christian König
     [not found] ` <20190102133506.110324-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-01-02 13:35   ` [PATCH 2/2] drm/amdgpu: set the executable flag on unused Vega10 PTEs Christian König
     [not found]     ` <20190102133506.110324-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-01-02 15:45       ` Deucher, Alexander
2019-01-02 20:26       ` Kuehling, Felix
     [not found]         ` <28ccb2db-f54f-110a-dd7e-89c38a8bed81-5C7GfCeVMHo@public.gmane.org>
2019-01-03  8:19           ` Christian König

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.