drm/amdgpu: align frag_end to covered address space
authorAlex Sierra <alex.sierra@amd.com>
Sat, 3 Oct 2020 18:31:21 +0000 (13:31 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 5 Oct 2020 19:13:28 +0000 (15:13 -0400)
align frag_end to the next pd when there are no
page table entries on the current pde.
This fixes invalidation of larger address space areas
where some page tables are allocated and other aren't.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index a4efc90..2b65e83 100644 (file)
@@ -1502,6 +1502,8 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
 
                        pt = cursor.entry->base.bo;
                        shift = parent_shift;
+                       frag_end = max(frag_end, ALIGN(frag_start + 1,
+                                  1ULL << shift));
                }
 
                /* Looks good so far, calculate parameters for the update */