drm/amdgpu: Correctly use bo_va->ref_count in compute VMs
authorXiaogang Chen <xiaogang.chen@amd.com>
Thu, 12 Oct 2023 20:48:06 +0000 (15:48 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 13 Oct 2023 15:33:08 +0000 (11:33 -0400)
commitffa88b0019c20d0bacda7cd1463af86ec744d52e
tree68c0a4cd2f540c7d06ff164e3065659c98a657db
parentf20f3b0d6caf12cd9845e6552bf7da49060f515a
drm/amdgpu: Correctly use bo_va->ref_count in compute VMs

This is needed to correctly handle BOs imported into compute VM from gfx.
Both kfd and gfx should use same bo_va and set bo_va->ref_count correctly
when map the Bos into same VM, otherwise we may trigger kernel general
protection when iterate mappings over bo_va's valids or invalids list.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ramesh Errabolu <Ramesh.Errabolu@amd.com>
Tested-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c