[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher <alexander.deuc...@amd.com> ________________________________ From: amd-gfx <amd-gfx-boun...@lists.freedesktop.org> on behalf of Christian König <ckoenig.leichtzumer...@gmail.com> Sent: Wednesday, September 2, 2020 10:05 AM To: Pan, Xinhui <xinhui....@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org> Subject: [PATCH] drm/amdgpu: fix max_entries calculation v2
Calculate the correct value for max_entries or we might run after the page_address array. v2: Xinhui pointed out we don't need the shift Signed-off-by: Christian König <christian.koe...@amd.com> Fixes: 1e691e244487 drm/amdgpu: stop allocating dummy GTT nodes --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 8bc2253939be..be886bdca5c6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1697,7 +1697,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, AMDGPU_GPU_PAGES_IN_CPU_PAGE; } else { addr = 0; - max_entries = S64_MAX; + max_entries = mapping->last - mapping->start + 1; } if (pages_addr) { -- 2.17.1 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Ce5239f6d94a9480e27e008d84f4939b5%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637346523216694548&sdata=OF7UX%2FLbWPJXkymt1QsdVVrQCZxI2Avj%2BBv1HYWPzxo%3D&reserved=0
_______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx