Skip to content

Commit 1059c6b

Browse files
wildea01ctmarinas
authored andcommitted
arm64: debug: don't re-enable debug exceptions on return from el1_dbg
When returning from a debug exception taken from EL1, we unmask debug exceptions after handling the exception. This is crucial for debug exceptions taken from EL0, so that any kernel work on the ret_to_user path can be debugged by kgdb. However, when returning back to EL1 the only thing left to do is to restore the original register state before the exception return. If single-step has been enabled by the debug exception handler, we will get stuck in an infinite debug exception loop, since we will take the step exception as soon as we unmask debug exceptions. This patch avoids unmasking debug exceptions on the debug exception return path when the exception was taken from EL1. Fixes: 2a28307 (arm64: debug: avoid accessing mdscr_el1 on fault paths where possible) Cc: <[email protected]> #3.16+ Reported-by: David Long <[email protected]> Reported-by: AKASHI Takahiro <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
1 parent 6f325ea commit 1059c6b

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

arch/arm64/kernel/entry.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ el1_dbg:
324324
mrs x0, far_el1
325325
mov x2, sp // struct pt_regs
326326
bl do_debug_exception
327-
enable_dbg
328327
kernel_exit 1
329328
el1_inv:
330329
// TODO: add support for undefined instructions in kernel mode

0 commit comments

Comments
 (0)