From: Vijaya Kumar K Date: Fri, 21 Feb 2014 05:13:49 +0000 (+0000) Subject: arm64: enable processor debug state for secondary cpus X-Git-Tag: firefly_0821_release~3680^2~35^2~1^2~45 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=dabf5d44b1a7fca13cef1b4ee4ec2c02e394899e;p=firefly-linux-kernel-4.4.55.git arm64: enable processor debug state for secondary cpus 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 Acked-by: Will Deacon Signed-off-by: Catalin Marinas (cherry picked from commit d8ed442a009ecfe155b57d58f231db3d6084633d) Signed-off-by: Mark Brown Conflicts: arch/arm64/kernel/smp.c --- diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c index f092fdbf5479..90777ba7b661 100644 --- a/arch/arm64/kernel/debug-monitors.c +++ b/arch/arm64/kernel/debug-monitors.c @@ -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); diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 08030da7f3c2..6555060f9e97 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -159,6 +159,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void) */ notify_cpu_starting(cpu); + local_dbg_enable(); local_irq_enable(); local_fiq_enable();