drm/amdgpu: Use virtual alloc during coredump
authorLijo Lazar <lijo.lazar@amd.com>
Wed, 29 Jul 2026 07:30:21 +0000 (13:00 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 6 Aug 2026 13:48:34 +0000 (09:48 -0400)
commit74d48bd6b7e12eba65de0507475b059966685ad1
tree520a4c03d3649eee695f136b4bf418fd7fde5aba
parent7f7d7ea1fa515157162d0d21245925551ed103a1
drm/amdgpu: Use virtual alloc during coredump

The number of rings with outstanding fences can be large, requiring a
bigger allocation. Such allocations don't need to be physically
contiguous, so use kvzalloc/kvcalloc which fall back to vmalloc when
contiguous memory isn't available. This also matches the existing
kvfree used to free these allocations.

Also guard the allocation with ring_count to avoid passing 0 size to
allocation routines.

Fixes: eea85914d15b ("drm/amdgpu: save ring content before resetting the device")
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c