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

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

This commit applies isolation enforcement to the GFX and Compute rings
in the gfx_v12_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
d594ddc6 f83fc3ab

+4
+4
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
··· 5336 5336 .emit_mem_sync = gfx_v12_0_emit_mem_sync, 5337 5337 .reset = gfx_v12_0_reset_kgq, 5338 5338 .emit_cleaner_shader = gfx_v12_0_ring_emit_cleaner_shader, 5339 + .begin_use = amdgpu_gfx_enforce_isolation_ring_begin_use, 5340 + .end_use = amdgpu_gfx_enforce_isolation_ring_end_use, 5339 5341 }; 5340 5342 5341 5343 static const struct amdgpu_ring_funcs gfx_v12_0_ring_funcs_compute = { ··· 5375 5373 .emit_mem_sync = gfx_v12_0_emit_mem_sync, 5376 5374 .reset = gfx_v12_0_reset_kcq, 5377 5375 .emit_cleaner_shader = gfx_v12_0_ring_emit_cleaner_shader, 5376 + .begin_use = amdgpu_gfx_enforce_isolation_ring_begin_use, 5377 + .end_use = amdgpu_gfx_enforce_isolation_ring_end_use, 5378 5378 }; 5379 5379 5380 5380 static const struct amdgpu_ring_funcs gfx_v12_0_ring_funcs_kiq = {