• Felix Kuehling's avatar
    drm/amdgpu: Implement VRAM wipe on release · ab2f7a5c
    Felix Kuehling authored
    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: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
    Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    ab2f7a5c
amdgpu_object.c 35.4 KB