]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdkfd: Fix SVM map/unmap address conversion for non-4k page sizes
authorDonet Tom <donettom@linux.ibm.com>
Mon, 12 Jan 2026 14:06:55 +0000 (19:36 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 14 Jan 2026 19:28:48 +0000 (14:28 -0500)
commitfb361a520a5861368c6c36717ff1900a35dde093
tree6eb0ecbef8ecafe546980c05584e9a592cfc3424
parent42ea9cf2f16b7131cb7302acb3dac510968f8bdc
drm/amdkfd: Fix SVM map/unmap address conversion for non-4k page sizes

SVM range size is tracked using the system page size. The range start and
end are aligned to system page-sized PFNs, so the total SVM range size
equals the total number of pages in the SVM range multiplied by the system
page size.

The SVM range map/unmap functions pass these system page-sized PFN numbers
to amdgpu_vm_update_range(), which expects PFNs based on the GPU page size
(4K). On non-4K page systems, this mismatch causes only part of the SVM
range to be mapped in the GPU page table, while the rest remains unmapped.
If the GPU accesses an unmapped address within the same range, it results
in a GPU page fault.

To fix this, the required conversion has been added in both
svm_range_map_to_gpu() and svm_range_unmap_from_gpu(), ensuring that all
pages in the SVM range are correctly mapped on non-4K systems.

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>
drivers/gpu/drm/amd/amdkfd/kfd_svm.c