amd/amdgpu: force to trigger a no-retry-fault after a retry-fault
Subsystems (2)
PATCH 1/1 amd/amdgpu: force to trigger a no-retry-fault after a retry-fault
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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +7 -8
@@ -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;
@@ -3196,17 +3197,15 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, unsigned int pasid, goto error_unlock; addr /=AMDGPU_GPU_PAGE_SIZE ; - 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 {/* Let the hw retry silently on the PTE */ - 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,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
Christian König
NAKAm 15.11.19 um 23:38 schrieb Alex Sierra:
Quoted 3 lines
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.
NAK, you can't do this unconditionally since that behavior is not wanted for graphics.
Christian.
Quoted 34 lines
Change-Id I177102891f715068f15605957ff23b0cab862603Signed-off-by Alex Sierra <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +3
-7@@ -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;@@ -3196,17 +3197,15 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, unsigned int pasid, goto error_unlock; addr /=AMDGPU_GPU_PAGE_SIZE ; - 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 */
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, unsigned int pasid, · line 3211
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +4
-1+ flags =AMDGPU_PTE_EXECUTABLE |AMDGPU_PDE_PTE | +AMDGPU_PTE_TF ; }else {/* Let the hw retry silently on the PTE */ - 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx