From patchwork Fri Feb 21 05:13:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Kilari X-Patchwork-Id: 3693741 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 29E919F38E for ; Fri, 21 Feb 2014 05:22:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A3BE200E5 for ; Fri, 21 Feb 2014 05:22:16 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2AB6820149 for ; Fri, 21 Feb 2014 05:22:15 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WGiYo-0005tW-8J; Fri, 21 Feb 2014 05:22:06 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WGiTw-0006DA-Fd; Fri, 21 Feb 2014 05:17:04 +0000 Received: from mail-pd0-x22c.google.com ([2607:f8b0:400e:c02::22c]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WGiTs-0006C4-UF for linux-arm-kernel@lists.infradead.org; Fri, 21 Feb 2014 05:17:02 +0000 Received: by mail-pd0-f172.google.com with SMTP id p10so2781329pdj.31 for ; Thu, 20 Feb 2014 21:16:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=MmcL72eQa0psilJMpm3fKfvAcijjkpk/I7alSV7q84g=; b=oWjwUD1WGfpfrIddwX9yxP7x/egxS2yTcF1ZNKcqXaDWn+SRlCDpN8B7ieuJFOW41d ZjQg2jo7K+rWsl/Hv3AZXci/Ly5Q462N0OxQxs72FgViKiVqMiUMXNx2okA9sWdhdtM6 pHkrIzw1sZH5tK6Qq/9IggJvD/L1BKZWC1N5YYneWCgs+DkNx3Z2ll7vUD/bqcx5rdFy iP9c5gQIadPQZq9Tx4yrJMSQrk7nv/qfjtN8gweLZwXX3xvPjaCDj+8LcPoL/VGl+v7D B/HpyVzNxk+j/h6inhlSbkk0hMFhcPtJGxTgrKW69vPjokHQnyqqlUgkpjyXA741G3yU jt9Q== X-Received: by 10.66.150.69 with SMTP id ug5mr6737839pab.55.1392959797133; Thu, 20 Feb 2014 21:16:37 -0800 (PST) Received: from ubuntu.caveonetworks.com ([115.119.134.194]) by mx.google.com with ESMTPSA id vx10sm40842252pac.17.2014.02.20.21.16.32 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 21:16:36 -0800 (PST) From: vijay.kilari@gmail.com To: will.deacon@arm.com, sandeepa.prabhu@linaro.org, jason.wessel@windriver.com, takahiro.akashi@linaro.org, Catalin.Marinas@arm.com Subject: [PATCH 1/1] arm64: enable processor debug state for secondary cpus Date: Fri, 21 Feb 2014 10:43:49 +0530 Message-Id: <1392959630-31314-1-git-send-email-vijay.kilari@gmail.com> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140221_001701_098530_2031C382 X-CRM114-Status: GOOD ( 10.87 ) X-Spam-Score: -2.0 (--) Cc: Prasun.Kapoor@caviumnetworks.com, Vijaya Kumar K , linaro-kernel@lists.linaro.org, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vijaya Kumar K 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 --- arch/arm64/kernel/debug-monitors.c | 7 +++---- arch/arm64/kernel/smp.c | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c index 1a8127d..13f87de 100644 --- a/arch/arm64/kernel/debug-monitors.c +++ b/arch/arm64/kernel/debug-monitors.c @@ -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); diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 7cfb92a..5070dc3 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -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();