]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: debug: clear mdscr_el1 instead of taking the OS lock
authorWill Deacon <will.deacon@arm.com>
Wed, 8 May 2013 16:01:12 +0000 (17:01 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 13 May 2013 10:44:56 +0000 (11:44 +0100)
commit2845ae5da6603e7b00156775a85c2745c6fda601
tree3e262570e5ca8e739c33057b9e80bfa6d2077d22
parent9b72c172168871fc8e7e70da3b261e4d53f91979
arm64: debug: clear mdscr_el1 instead of taking the OS lock

During boot, we take the debug OS lock before interrupts are enabled.
This is required to prevent clearing of PSTATE.D on the interrupt entry
path, which could result in spurious debug exceptions before we've got
round to resetting things like the hardware breakpoints registers to a
sane state.

A problem with this approach is that taking the OS lock prevents an
external JTAG debugger from debugging the system, which is especially
irritating during boot, where JTAG debugging can be most useful.

This patch clears mdscr_el1 rather than taking the lock, clearing the
MDE and KDE bits and preventing self-hosted hardware debug exceptions
from occurring.

Tested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: stable@vger.kernel.org
arch/arm64/kernel/debug-monitors.c
arch/arm64/mm/proc.S