]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: Implement VRAM wipe on release
authorFelix Kuehling <Felix.Kuehling@amd.com>
Tue, 9 Jul 2019 23:12:44 +0000 (19:12 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 2 Aug 2019 15:18:32 +0000 (10:18 -0500)
commit64dc7a1f43bd37c05c3f21c625b1a19c8f78f005
tree78335d2cae1fe364bab737400bf4aa410f323435
parent4c4095349539a7bf51b8098a4366460dd8114391
drm/amdgpu: Implement VRAM wipe on release

Wipe VRAM memory containing sensitive data when moving or releasing
BOs. Clearing the memory is pipelined to minimize any impact on
subsequent memory allocation latency. Use of a poison value should
help debug future use-after-free bugs.

When moving BOs, the existing ttm_bo_pipelined_move ensures that the
memory won't be reused before being wiped.

When releasing BOs, the BO is fenced with the memory fill operation,
which results in queuing the BO for a delayed delete.

v2: Move amdgpu_amdkfd_unreserve_memory_limit into
amdgpu_bo_release_notify so that KFD can use memory that's still
being cleared in the background

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h