]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amdgpu/gfx9: Add cleaner shader for GFX9.4.3
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Mon, 29 Jul 2024 16:44:41 +0000 (22:14 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Aug 2024 02:07:16 +0000 (22:07 -0400)
commit335288315af18c0def7f47a37fe7eaa782c98f6d
tree2631b5f1171a882db6dcddff8976a47bacacc236
parentd4c38154951b2bff6bfa4d5eb56df0bd08703cf9
drm/amdgpu/gfx9: Add cleaner shader for GFX9.4.3

This commit adds the cleaner shader microcode for GFX9.4.3 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_9_4_3_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 improve GPU performance and resource
utilization by cleaning up GPU resources after they are used. It also
enhances security and reliability by preventing data leaks between
workloads.

v2: fix copyright date (Alex)

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