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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdkfd: Ensure consistent barrier state saved in gfx12 trap handler

It is possible for some waves in a workgroup to finish their save
sequence before the group leader has had time to capture the workgroup
barrier state. When this happens, having those waves exit do impact the
barrier state. As a consequence, the state captured by the group leader
is invalid, and is eventually incorrectly restored.

This patch proposes to have all waves in a workgroup wait for each other
at the end of their save sequence (just before calling s_endpgm_saved).

Signed-off-by: Lancelot SIX <lancelot.six@amd.com>
Reviewed-by: Jay Cornwall <jay.cornwall@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.12.x

authored by

Lancelot SIX and committed by
Alex Deucher
d584198a a0a455b4

+6 -1
+2 -1
drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h
··· 4121 4121 0x0000ffff, 0x8bfe7e7e, 4122 4122 0x8bea6a6a, 0xb97af804, 4123 4123 0xbe804ec2, 0xbf94fffe, 4124 - 0xbe804a6c, 0xbfb10000, 4124 + 0xbe804a6c, 0xbe804ec2, 4125 + 0xbf94fffe, 0xbfb10000, 4125 4126 0xbf9f0000, 0xbf9f0000, 4126 4127 0xbf9f0000, 0xbf9f0000, 4127 4128 0xbf9f0000, 0x00000000,
+4
drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx12.asm
··· 1049 1049 s_rfe_b64 s_restore_pc_lo //Return to the main shader program and resume execution 1050 1050 1051 1051 L_END_PGM: 1052 + // Make sure that no wave of the workgroup can exit the trap handler 1053 + // before the workgroup barrier state is saved. 1054 + s_barrier_signal -2 1055 + s_barrier_wait -2 1052 1056 s_endpgm_saved 1053 1057 end 1054 1058