Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu/gfx11: Apply Isolation Enforcement to GFX & Compute rings

This commit applies isolation enforcement to the GFX and Compute rings
in the gfx_v11_0 module.

The commit sets `amdgpu_gfx_enforce_isolation_ring_begin_use` and
`amdgpu_gfx_enforce_isolation_ring_end_use` as the functions to be
called when a ring begins and ends its use, respectively.

`amdgpu_gfx_enforce_isolation_ring_begin_use` is called when a ring
begins its use. This function cancels any scheduled
`enforce_isolation_work` and, if necessary, signals the Kernel Fusion
Driver (KFD) to stop the runqueue.

`amdgpu_gfx_enforce_isolation_ring_end_use` is called when a ring ends
its use. This function schedules `enforce_isolation_work` to be run
after a delay.

These functions are part of the Enforce Isolation Handler, which
enforces shader isolation on AMD GPUs to prevent data leakage between
different processes.

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>

authored by

Srinivasan Shanmugam and committed by
Alex Deucher
fbca1969 e7cee545

+4
+4
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
··· 6875 6875 .emit_mem_sync = gfx_v11_0_emit_mem_sync, 6876 6876 .reset = gfx_v11_0_reset_kgq, 6877 6877 .emit_cleaner_shader = gfx_v11_0_ring_emit_cleaner_shader, 6878 + .begin_use = amdgpu_gfx_enforce_isolation_ring_begin_use, 6879 + .end_use = amdgpu_gfx_enforce_isolation_ring_end_use, 6878 6880 }; 6879 6881 6880 6882 static const struct amdgpu_ring_funcs gfx_v11_0_ring_funcs_compute = { ··· 6917 6915 .emit_mem_sync = gfx_v11_0_emit_mem_sync, 6918 6916 .reset = gfx_v11_0_reset_kcq, 6919 6917 .emit_cleaner_shader = gfx_v11_0_ring_emit_cleaner_shader, 6918 + .begin_use = amdgpu_gfx_enforce_isolation_ring_begin_use, 6919 + .end_use = amdgpu_gfx_enforce_isolation_ring_end_use, 6920 6920 }; 6921 6921 6922 6922 static const struct amdgpu_ring_funcs gfx_v11_0_ring_funcs_kiq = {