]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amdkfd: Trap handler support for expert scheduling mode
authorJay Cornwall <jay.cornwall@amd.com>
Fri, 14 Nov 2025 20:32:42 +0000 (14:32 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:17:18 +0000 (10:17 +0100)
commiteb1494204d717eede1f0316c349a047dc61b5669
treee94d8db07131183da412cf060fdfaaa4b663a543
parent7f26af7bf9b76c2c2a1a761aab5803e52be21eea
drm/amdkfd: Trap handler support for expert scheduling mode

commit b7851f8c66191cd23a0a08bd484465ad74bbbb7d upstream.

The trap may be entered with dependency checking disabled.
Wait for dependency counters and save/restore scheduling mode.

v2:

Use ttmp1 instead of ttmp11. ttmp11 is not zero-initialized.
While the trap handler does zero this field before use, a user-mode
second-level trap handler could not rely on this being zero when
using an older kernel mode driver.

v3:

Use ttmp11 primarily but copy to ttmp1 before jumping to the
second level trap handler. ttmp1 is inspectable by a debugger.
Unexpected bits in the unused space may regress existing software.

Signed-off-by: Jay Cornwall <jay.cornwall@amd.com>
Reviewed-by: Lancelot Six <lancelot.six@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 423888879412e94725ca2bdccd89414887d98e31)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h
drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx12.asm