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)
committerMark Brown <broonie@linaro.org>
Wed, 21 May 2014 17:40:31 +0000 (18:40 +0100)
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>
(cherry picked from commit d8ed442a009ecfe155b57d58f231db3d6084633d)
Signed-off-by: Mark Brown <broonie@linaro.org>
Conflicts:
arch/arm64/kernel/smp.c

arch/arm64/kernel/debug-monitors.c
arch/arm64/kernel/smp.c

index f092fdbf5479560b092906d8b546a9af7bf916ce..90777ba7b661048169f72b91cdd44936dc754144 100644 (file)
@@ -138,8 +138,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 __cpuinit os_lock_notify(struct notifier_block *self,
@@ -158,8 +156,9 @@ static struct notifier_block __cpuinitdata os_lock_nb = {
 static int __cpuinit 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 08030da7f3c27b9fb69345a101e66c7dcf998e08..6555060f9e9796949b5015680e6d381749d2b01d 100644 (file)
@@ -159,6 +159,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
         */
        notify_cpu_starting(cpu);
 
+       local_dbg_enable();
        local_irq_enable();
        local_fiq_enable();