]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 May 2013 18:35:46 +0000 (11:35 -0700)
commit71b86dfc5ed5a27c6d02eff2957587b8a00ae3dd
tree2bb7451603645544fdc6554ed442fcafbb87a54d
parent4bb08696fab71294c8f1c134a21be9159f82ba08
arm64: debug: clear mdscr_el1 instead of taking the OS lock

commit 9c413e25d95fd3c0abe23eadad66191b22baa549 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/debug-monitors.c
arch/arm64/mm/proc.S