drm/amdgpu: Update invalid PTE flag setting
Subsystems (2)
PATCH 1/1 drm/amdgpu: Update invalid PTE flag setting
Update the invalid PTE flag setting to ensure, in addition to transitioning the retry fault to a no-retry fault, it also causes the wavefront to enter the trap handler. With the current setting, it only transitions to a no-retry fault.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
@@ -2488,7 +2488,7 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, u32 pasid,/* Intentionally setting invalid PTE flag * combination to force a no-retry-fault */ - flags =AMDGPU_PTE_SNOOPED |AMDGPU_PTE_PRT ; + flags =AMDGPU_PTE_VALID |AMDGPU_PTE_SYSTEM |AMDGPU_PTE_PRT ; value =0 ; }else if (amdgpu_vm_fault_stop ==AMDGPU_VM_FAULT_STOP_NEVER ) {/* Redirect the access to the dummy page */
Signature · 1 line
2.35.1
Quoted 6 lines · Mukul Joshi
Update the invalid PTE flag setting to ensure, in addition to transitioning the retry fault to a no-retry fault, it also causes the wavefront to enter the trap handler. With the current setting, it only transitions to a no-retry fault.
Signed-off-by Mukul Joshi <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-1@@ -2488,7 +2488,7 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, u32 pasid,/* Intentionally setting invalid PTE flag * combination to force a no-retry-fault */ - flags =AMDGPU_PTE_SNOOPED |AMDGPU_PTE_PRT ; + flags =AMDGPU_PTE_VALID |AMDGPU_PTE_SYSTEM |AMDGPU_PTE_PRT ; value =0 ; }else if (amdgpu_vm_fault_stop ==AMDGPU_VM_FAULT_STOP_NEVER ) {/* Redirect the access to the dummy page */
Christian König
maintainerAm 04.04.23 um 23:59 schrieb Mukul Joshi:
Quoted 4 lines
Update the invalid PTE flag setting to ensure, in addition to transitioning the retry fault to a no-retry fault, it also causes the wavefront to enter the trap handler. With the current setting, it only transitions to a no-retry fault.
Well that was actually the intended result. Why should it enter the trap handler here?
Quoted 11 lines
Signed-off-by Mukul Joshi <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, u32 pasid, · line 2491
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-1@@ -2488,7 +2488,7 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, u32 pasid,/* Intentionally setting invalid PTE flag * combination to force a no-retry-fault */ - flags =AMDGPU_PTE_SNOOPED |AMDGPU_PTE_PRT ; + flags =AMDGPU_PTE_VALID |AMDGPU_PTE_SYSTEM |AMDGPU_PTE_PRT ;
As far as I can see this is actually a valid combination and would not have the desired result.
Regards,
Christian.
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0value =0 ; }else if (amdgpu_vm_fault_stop ==AMDGPU_VM_FAULT_STOP_NEVER ) {/* Redirect the access to the dummy page */
Am 2023-04-06 um 10:36 schrieb Christian König:
Quoted 7 lines
Am 04.04.23 um 23:59 schrieb Mukul Joshi:
Quoted 4 lines
Update the invalid PTE flag setting to ensure, in addition to transitioning the retry fault to a no-retry fault, it also causes the wavefront to enter the trap handler. With the current setting, it only transitions to a no-retry fault.
Well that was actually the intended result. Why should it enter the trap handler here?
We need the trap handler for reporting the fault to the debugger. The VM fault interrupt itself doesn't provide sufficient information to find the wave and the program counter that triggered the fault. It also doesn't work well when several waves are faulting on the same address.
Regards,
Felix
Quoted 28 lines
Quoted 12 lines
Signed-off-by Mukul Joshi <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c bool amdgpu_vm_handle_fault(struct · line 2492
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-1@@ -2488,7 +2488,7 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, u32 pasid, /* Intentionally setting invalid PTE flag * combination to force a no-retry-fault */ - flags = AMDGPU_PTE_SNOOPED | AMDGPU_PTE_PRT; + flags = AMDGPU_PTE_VALID | AMDGPU_PTE_SYSTEM | AMDGPU_PTE_PRT;As far as I can see this is actually a valid combination and would not have the desired result.
Regards,
Christian.Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0value = 0; } else if (amdgpu_vm_fault_stop == AMDGPU_VM_FAULT_STOP_NEVER) {/* Redirect the access to the dummy page */
Christian König
maintainerAm 06.04.23 um 17:01 schrieb Felix Kuehling:
Quoted 10 lines
Am 2023-04-06 um 10:36 schrieb Christian König:
Quoted 7 lines
Am 04.04.23 um 23:59 schrieb Mukul Joshi:
Quoted 4 lines
Update the invalid PTE flag setting to ensure, in addition to transitioning the retry fault to a no-retry fault, it also causes the wavefront to enter the trap handler. With the current setting, it only transitions to a no-retry fault.
Well that was actually the intended result. Why should it enter the trap handler here?
We need the trap handler for reporting the fault to the debugger. The VM fault interrupt itself doesn't provide sufficient information to find the wave and the program counter that triggered the fault. It also doesn't work well when several waves are faulting on the same address.
Interesting. But then we still have the problem that VSP set is actually a valid combination when this is applied to a non PTB.
So that really doesn't look like a good idea to me.
Regards,
Christian.
Quoted 33 lines
Regards,
FelixQuoted 28 lines
Quoted 12 lines
Signed-off-by Mukul Joshi <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c bool amdgpu_vm_handle_fault(struct · line 2492
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-1@@ -2488,7 +2488,7 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, u32 pasid, /* Intentionally setting invalid PTE flag * combination to force a no-retry-fault */ - flags = AMDGPU_PTE_SNOOPED | AMDGPU_PTE_PRT; + flags = AMDGPU_PTE_VALID | AMDGPU_PTE_SYSTEM | AMDGPU_PTE_PRT;As far as I can see this is actually a valid combination and would not have the desired result.
Regards,
Christian.Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0value = 0; } else if (amdgpu_vm_fault_stop == AMDGPU_VM_FAULT_STOP_NEVER) {/* Redirect the access to the dummy page */