drm/amdgpu: Add more page fault info printing for GFX10
authorYong Zhao <Yong.Zhao@amd.com>
Wed, 7 Aug 2019 20:21:09 +0000 (16:21 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Aug 2019 15:58:08 +0000 (10:58 -0500)
The printing we did for GFX9 was not propogated to GFX10 somehow, so fix
it now.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c

index aafb16064338d13e9f869a18ff638a8e49b9e7e4..8e8d712f5a6efc19bfcd22c2e671d7d42c03c7a0 100644 (file)
@@ -141,17 +141,40 @@ static int gmc_v10_0_process_interrupt(struct amdgpu_device *adev,
        }
 
        if (printk_ratelimit()) {
+               struct amdgpu_task_info task_info;
+
+               memset(&task_info, 0, sizeof(struct amdgpu_task_info));
+               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)\n",
+                       "[%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",
                        entry->src_id, entry->ring_id, entry->vmid,
-                       entry->pasid);
-               dev_err(adev->dev, "  at page 0x%016llx from %d\n",
+                       entry->pasid, task_info.process_name, task_info.tgid,
+                       task_info.task_name, task_info.pid);
+               dev_err(adev->dev, "  in page starting at address 0x%016llx from client %d\n",
                        addr, entry->client_id);
-               if (!amdgpu_sriov_vf(adev))
+               if (!amdgpu_sriov_vf(adev)) {
                        dev_err(adev->dev,
-                               "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
+                               "GCVM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
                                status);
+                       dev_err(adev->dev, "\t MORE_FAULTS: 0x%lx\n",
+                               REG_GET_FIELD(status,
+                               GCVM_L2_PROTECTION_FAULT_STATUS, MORE_FAULTS));
+                       dev_err(adev->dev, "\t WALKER_ERROR: 0x%lx\n",
+                               REG_GET_FIELD(status,
+                               GCVM_L2_PROTECTION_FAULT_STATUS, WALKER_ERROR));
+                       dev_err(adev->dev, "\t PERMISSION_FAULTS: 0x%lx\n",
+                               REG_GET_FIELD(status,
+                               GCVM_L2_PROTECTION_FAULT_STATUS, PERMISSION_FAULTS));
+                       dev_err(adev->dev, "\t MAPPING_ERROR: 0x%lx\n",
+                               REG_GET_FIELD(status,
+                               GCVM_L2_PROTECTION_FAULT_STATUS, MAPPING_ERROR));
+                       dev_err(adev->dev, "\t RW: 0x%lx\n",
+                               REG_GET_FIELD(status,
+                               GCVM_L2_PROTECTION_FAULT_STATUS, RW));
+               }
        }
 
        return 0;