You need to sign in or sign up before continuing.
  • Srinivasan Shanmugam's avatar
    drm/amdgpu: Add sysfs interface for running cleaner shader · d361ad5d
    Srinivasan Shanmugam authored
    
    
    This patch adds a new sysfs interface for running the cleaner shader on
    AMD GPUs. The cleaner shader is used to clear GPU memory before it's
    reused, which can help prevent data leakage between different processes.
    
    The new sysfs file is write-only and is named `run_cleaner_shader`.
    Write the number of the partition to this file to trigger the cleaner shader
    on that partition. There is only one partition on GPUs which do not
    support partitioning.
    
    Changes made in this patch:
    
    - Added `amdgpu_set_run_cleaner_shader` function to handle writes to the
      `run_cleaner_shader` sysfs file.
    - Added `run_cleaner_shader` to the list of device attributes in
      `amdgpu_device_attrs`.
    - Updated `default_attr_update` to handle `run_cleaner_shader`.
    - Added `AMDGPU_DEVICE_ATTR_WO` macro to create write-only device
      attributes.
    
    v2: fix error handling (Alex)
    
    Cc: Christian König <christian.koenig@amd.com>
    Cc: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    Signed-off-by: default avatarSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
    d361ad5d
amdgpu_gfx.c 44.9 KB