From 9ae972cf1e72a67f1da62a47cffe68479df6fe67 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Thu, 9 Nov 2023 10:14:05 +0000 Subject: [PATCH] trap_handler: Fix handling of debugtrap for gfx11 For gfx11, the trap_handler fails to recognize a trap id 3 and report the exception to the debugger if the debugger is attached. This is because the 2nd level trap handler looks for the DEBUG_ENABLED bit in ttmp13 instead of ttmp11. This bit is set by the 1st level trap handler and is part of the 1st/2nd level trap handler ABI. Change-Id: Ib36361f53d9bcbbed52320d8c3a9ab2c0b28c7cd [ROCm/ROCR-Runtime commit: 6916ce358acddfb868b61ca1e302cca5fa286596] --- .../hsa-runtime/core/runtime/trap_handler/trap_handler.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/trap_handler/trap_handler.s b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/trap_handler/trap_handler.s index 1803f4fa10..0936786c5e 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/trap_handler/trap_handler.s +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/trap_handler/trap_handler.s @@ -125,7 +125,7 @@ trap_entry: // If llvm.debugtrap and debugger is not attached. s_cmp_eq_u32 ttmp2, TRAP_ID_DEBUGTRAP s_cbranch_scc0 .no_skip_debugtrap -.if (.amdgcn.gfx_generation_number == 9 && .amdgcn.gfx_generation_minor < 4) || .amdgcn.gfx_generation_number == 10 +.if (.amdgcn.gfx_generation_number == 9 && .amdgcn.gfx_generation_minor < 4) || .amdgcn.gfx_generation_number >= 10 s_bitcmp0_b32 ttmp11, TTMP_DEBUG_ENABLED_SHIFT .else s_bitcmp0_b32 ttmp13, TTMP_DEBUG_ENABLED_SHIFT