Skip to content

Commit 6c16000

Browse files
donettom-1alexdeucher
authored andcommitted
drm/amdkfd: Fix GART PTE for non-4K pagesize in svm_migrate_gart_map()
In svm_migrate_gart_map(), while migrating GART mapping, the number of bytes copied for the GART table only accounts for CPU pages. On non-4K systems, each CPU page can contain multiple GPU pages, and the GART requires one 8-byte PTE per GPU page. As a result, an incorrect size was passed to the DMA, causing only a partial update of the GART table. Fix this function to work correctly on non-4K page-size systems by accounting for the number of GPU pages per CPU page when calculating the number of bytes to be copied. Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Philip Yang <Philip.Yang@amd.com> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Donet Tom <donettom@linux.ibm.com> Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent fb361a5 commit 6c16000

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/amd/amdkfd/kfd_migrate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ svm_migrate_gart_map(struct amdgpu_ring *ring,
6363
*gart_addr = adev->gmc.gart_start;
6464

6565
num_dw = ALIGN(adev->mman.buffer_funcs->copy_num_dw, 8);
66-
num_bytes = npages * 8;
66+
num_bytes = npages * 8 * AMDGPU_GPU_PAGES_IN_CPU_PAGE;
6767

6868
r = amdgpu_job_alloc_with_ib(adev, &entity->base,
6969
AMDGPU_FENCE_OWNER_UNDEFINED,

0 commit comments

Comments
 (0)