On Thu, Jun 12, 2025 at 11:31 AM Srinivasan Shanmugam
<srinivasan.shanmu...@amd.com> wrote:
>
> Enable the cleaner shader for other GFX9.x series of GPUs to provide
> data isolation between GPU workloads. The cleaner shader is responsible
> for clearing the Local Data Store (LDS), Vector General Purpose
> Registers (VGPRs), and Scalar General Purpose Registers (SGPRs), which
> helps prevent data leakage and ensures accurate computation results.
>
> This update extends cleaner shader support to GFX9.x GPUs, previously
> available for GFX9.4.2. It enhances security by clearing GPU memory
> between processes and maintains a consistent GPU state across KGD and
> KFD workloads.
>
> Cc: Manu Rastogi <manu.rast...@amd.com>
> Cc: Christian König <christian.koe...@amd.com>
> Cc: Alex Deucher <alexander.deuc...@amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmu...@amd.com>

Acked-by: Alex Deucher <alexander.deuc...@amd.com>

> ---
> v2: Updated comments
>
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> index d50e125fd3e0..866e39f6fab3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> @@ -2235,6 +2235,25 @@ static int gfx_v9_0_sw_init(struct amdgpu_ip_block 
> *ip_block)
>         }
>
>         switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
> +       case IP_VERSION(9, 0, 1):
> +       case IP_VERSION(9, 2, 1):
> +       case IP_VERSION(9, 4, 0):
> +       case IP_VERSION(9, 2, 2):
> +       case IP_VERSION(9, 1, 0):
> +       case IP_VERSION(9, 3, 0):
> +               adev->gfx.cleaner_shader_ptr = gfx_9_4_2_cleaner_shader_hex;
> +               adev->gfx.cleaner_shader_size = 
> sizeof(gfx_9_4_2_cleaner_shader_hex);
> +               if (adev->gfx.me_fw_version  >= 167 &&
> +                   adev->gfx.pfp_fw_version >= 196 &&
> +                   adev->gfx.mec_fw_version >= 474) {
> +                       adev->gfx.enable_cleaner_shader = true;
> +                       r = amdgpu_gfx_cleaner_shader_sw_init(adev, 
> adev->gfx.cleaner_shader_size);
> +                       if (r) {
> +                               adev->gfx.enable_cleaner_shader = false;
> +                               dev_err(adev->dev, "Failed to initialize 
> cleaner shader\n");
> +                       }
> +               }
> +               break;
>         case IP_VERSION(9, 4, 2):
>                 adev->gfx.cleaner_shader_ptr = gfx_9_4_2_cleaner_shader_hex;
>                 adev->gfx.cleaner_shader_size = 
> sizeof(gfx_9_4_2_cleaner_shader_hex);
> --
> 2.34.1
>

Reply via email to