]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: debug: don't re-enable debug exceptions on return from el1_dbg
authorWill Deacon <will.deacon@arm.com>
Mon, 22 Sep 2014 10:19:04 +0000 (11:19 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 23 Sep 2014 14:49:34 +0000 (15:49 +0100)
commitb851a75683dd63fd6bb8e1ef8632f07755109de7
treec68d66498a9118a75a185a18bae0e635fa9abbbb
parent0a7ec0cca52dffdbf704835b0f5a059cde135440
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: b1606bd0b90d (arm64: debug: avoid accessing mdscr_el1 on fault paths where possible)
Cc: <stable@vger.kernel.org> #3.16+
Reported-by: David Long <dave.long@linaro.org>
Reported-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/entry.S