]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amdgpu/gfx10: Add cleaner shader for GFX10.3.0
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Wed, 6 Nov 2024 02:19:00 +0000 (07:49 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 6 Jan 2025 19:44:28 +0000 (14:44 -0500)
commit8b248b90450776c2b59c4a372cb9520e25ff010b
tree17a627fd02d7f8dfb3ea9a3f3349239d033ccb2a
parent03cc84b102d1a832e8dfc59344346dedcebcdf42
drm/amdgpu/gfx10: Add cleaner shader for GFX10.3.0

This commit adds the cleaner shader microcode for GFX10.3.0 GPUs. The
cleaner shader is a piece of GPU code that is used to clear or
initialize certain GPU resources, such as Local Data Share (LDS), Vector
General Purpose Registers (VGPRs), and Scalar General Purpose Registers
(SGPRs).

Clearing these resources is important for ensuring data isolation
between different workloads running on the GPU. Without the cleaner
shader, residual data from a previous workload could potentially be
accessed by a subsequent workload, leading to data leaks and incorrect
computation results.

The cleaner shader microcode is represented as an array of 32-bit words
(`gfx_10_3_0_cleaner_shader_hex`). This array is the binary
representation of the cleaner shader code, which is written in a
low-level GPU instruction set.

When the cleaner shader feature is enabled, the AMDGPU driver loads this
array into a specific location in the GPU memory. The GPU then reads
this memory location to fetch and execute the cleaner shader
instructions.

The cleaner shader is executed automatically by the GPU at the end of
each workload, before the next workload starts. This ensures that all
GPU resources are in a clean state before the start of each workload.

This addition is part of the cleaner shader feature implementation. The
cleaner shader feature helps resource utilization by cleaning up GPU
resources after they are used. It also enhances security and reliability
by preventing data leaks between workloads.

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v10_0_cleaner_shader.h [new file with mode: 0644]
drivers/gpu/drm/amd/amdgpu/gfx_v10_3_0_cleaner_shader.asm [new file with mode: 0644]