gpu: vgpu: gp10b: Add map failure debugging

The vGPU mapping code in gp10b gives very little debugging info when
there's a failure. This change adds much more detail to the error printing
so that thee failures can more easily be debugged without needing to
run the virtual guest locally.

Change-Id: Ibb4412fd4ab322b366f0e08eaa399b7b90ea22c7
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1544506
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Alex Waterman
2017-08-23 17:25:27 -07:00
committed by mobile promotions
parent 8f2f979428
commit 6365040db3

View File

@@ -63,7 +63,7 @@ static u64 vgpu_gp10b_locked_gmmu_map(struct vm_gk20a *vm,
u32 page_size = vm->gmmu_page_sizes[pgsz_idx];
u64 space_to_skip = buffer_offset;
u64 buffer_size = 0;
u32 mem_desc_count = 0;
u32 mem_desc_count = 0, i;
struct scatterlist *sgl;
void *handle = NULL;
size_t oob_size;
@@ -79,6 +79,8 @@ static u64 vgpu_gp10b_locked_gmmu_map(struct vm_gk20a *vm,
if (space_to_skip & (page_size - 1))
return 0;
memset(&msg, 0, sizeof(msg));
/* Allocate (or validate when map_offset != 0) the virtual address. */
if (!map_offset) {
map_offset = __nvgpu_vm_alloc_va(vm, size, pgsz_idx);
@@ -172,7 +174,19 @@ static u64 vgpu_gp10b_locked_gmmu_map(struct vm_gk20a *vm,
fail:
if (handle)
tegra_gr_comm_oob_put_ptr(handle);
nvgpu_err(g, "%s: failed with err=%d", __func__, err);
nvgpu_err(g, "Failed: err=%d, msg.ret=%d", err, msg.ret);
nvgpu_err(g,
" Map: %-5s GPU virt %#-12llx +%#-9llx "
"phys offset: %#-4llx; pgsz: %3dkb perm=%-2s | "
"kind=%#02x APT=%-6s",
vm->name, map_offset, buffer_size, buffer_offset,
vm->gmmu_page_sizes[pgsz_idx] >> 10,
nvgpu_gmmu_perm_str(rw_flag),
kind_v, "SYSMEM");
for (i = 0; i < mem_desc_count; i++)
nvgpu_err(g, " > 0x%010llx + 0x%llx",
mem_desc[i].addr, mem_desc[i].length);
return 0;
}