aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2013-05-08 12:01:12 -0400
committerCatalin Marinas <catalin.marinas@arm.com>2013-05-13 06:44:56 -0400
commit9c413e25d95fd3c0abe23eadad66191b22baa549 (patch)
tree3e262570e5ca8e739c33057b9e80bfa6d2077d22 /arch
parent182a6f73ec6bc83ce9b72eec20fa1c6901338c16 (diff)
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
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/kernel/debug-monitors.c2
-rw-r--r--arch/arm64/mm/proc.S3
2 files changed, 1 insertions, 4 deletions
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index 0c3ba9f51376..f4726dc054b3 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -136,8 +136,6 @@ void disable_debug_monitors(enum debug_el el)
136 */ 136 */
137static void clear_os_lock(void *unused) 137static void clear_os_lock(void *unused)
138{ 138{
139 asm volatile("msr mdscr_el1, %0" : : "r" (0));
140 isb();
141 asm volatile("msr oslar_el1, %0" : : "r" (0)); 139 asm volatile("msr oslar_el1, %0" : : "r" (0));
142 isb(); 140 isb();
143} 141}
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
index f1d8b9bbfdad..a82ae8868077 100644
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -119,8 +119,7 @@ ENTRY(__cpu_setup)
119 119
120 mov x0, #3 << 20 120 mov x0, #3 << 20
121 msr cpacr_el1, x0 // Enable FP/ASIMD 121 msr cpacr_el1, x0 // Enable FP/ASIMD
122 mov x0, #1 122 msr mdscr_el1, xzr // Reset mdscr_el1
123 msr oslar_el1, x0 // Set the debug OS lock
124 tlbi vmalle1is // invalidate I + D TLBs 123 tlbi vmalle1is // invalidate I + D TLBs
125 /* 124 /*
126 * Memory region attributes for LPAE: 125 * Memory region attributes for LPAE: