arm64: enable processor debug state for secondary cpus
authorVijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
Fri, 21 Feb 2014 05:13:49 +0000 (05:13 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 26 Feb 2014 11:16:27 +0000 (11:16 +0000)
processor debug state PSTATE.D is unmasked in smp call
clear_os_lock for secondary cpus. So debug state is still
masked in normal kernel context.  With this patch, unmask
debug state on secondary boot for the cpus in normal kernel
context. Now kgdb tests passed with multicore.

Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/debug-monitors.c
arch/arm64/kernel/smp.c

index 1a8127da625b4c2d9c46bc140d22ebc272e55ac6..13f87def8ea154b592ee01366f95da69373e93c8 100644 (file)
@@ -137,8 +137,6 @@ void disable_debug_monitors(enum debug_el el)
 static void clear_os_lock(void *unused)
 {
        asm volatile("msr oslar_el1, %0" : : "r" (0));
-       isb();
-       local_dbg_enable();
 }
 
 static int os_lock_notify(struct notifier_block *self,
@@ -157,8 +155,9 @@ static struct notifier_block os_lock_nb = {
 static int debug_monitors_init(void)
 {
        /* Clear the OS lock. */
-       smp_call_function(clear_os_lock, NULL, 1);
-       clear_os_lock(NULL);
+       on_each_cpu(clear_os_lock, NULL, 1);
+       isb();
+       local_dbg_enable();
 
        /* Register hotplug handler. */
        register_cpu_notifier(&os_lock_nb);
index 7cfb92a4ab66523212ec91392b6ee269fa0d97a9..5070dc3b65d2e8a87cb47ca9b52f6987930d0245 100644 (file)
@@ -160,6 +160,7 @@ asmlinkage void secondary_start_kernel(void)
        set_cpu_online(cpu, true);
        complete(&cpu_running);
 
+       local_dbg_enable();
        local_irq_enable();
        local_async_enable();