aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4554-amd-amdgpu-force-to-trigger-a-no-retry-fault-after-a.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4554-amd-amdgpu-force-to-trigger-a-no-retry-fault-after-a.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4554-amd-amdgpu-force-to-trigger-a-no-retry-fault-after-a.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4554-amd-amdgpu-force-to-trigger-a-no-retry-fault-after-a.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4554-amd-amdgpu-force-to-trigger-a-no-retry-fault-after-a.patch
new file mode 100644
index 00000000..9fce78ec
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4554-amd-amdgpu-force-to-trigger-a-no-retry-fault-after-a.patch
@@ -0,0 +1,60 @@
+From 871a45729603c20acb9a0927eb549b667c9b68ba Mon Sep 17 00:00:00 2001
+From: Alex Sierra <alex.sierra@amd.com>
+Date: Mon, 18 Nov 2019 15:33:07 -0600
+Subject: [PATCH 4554/4736] amd/amdgpu: force to trigger a no-retry-fault after
+ a retry-fault
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Only for the debugger use case.
+
+[why]
+Avoid endless translation retries, after an invalid address access has
+been issued to the GPU. Instead, the trap handler is forced to enter by
+generating a no-retry-fault.
+A s_trap instruction is inserted in the debugger case to let the wave to
+enter trap handler to save context.
+
+[how]
+Intentionally using an invalid flag combination (F and P set at the same
+time) to trigger a no-retry-fault, after a retry-fault happens. This is
+only valid under compute context.
+
+Change-Id: I4180c30e2631dc0401cbd6171f8a6776e4733c9a
+Signed-off-by: Alex Sierra <alex.sierra@amd.com>
+Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+index c3e87ca13c53..90ac5390ecdf 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+@@ -3204,11 +3204,20 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, unsigned int pasid,
+ flags = AMDGPU_PTE_VALID | AMDGPU_PTE_SNOOPED |
+ AMDGPU_PTE_SYSTEM;
+
+- if (amdgpu_vm_fault_stop == AMDGPU_VM_FAULT_STOP_NEVER) {
++ if (vm->is_compute_context) {
++ /* Intentionally setting invalid PTE flag
++ * combination to force a no-retry-fault
++ */
++ flags = AMDGPU_PTE_EXECUTABLE | AMDGPU_PDE_PTE |
++ AMDGPU_PTE_TF;
++ value = 0;
++
++ } else 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;
++
+ } else {
+ /* Let the hw retry silently on the PTE */
+ value = 0;
+--
+2.17.1
+