From patchwork Tue Jan 28 11:20:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Kilari X-Patchwork-Id: 3546321 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 0D3079F381 for ; Tue, 28 Jan 2014 11:26:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C85B32015B for ; Tue, 28 Jan 2014 11:25:59 +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 6314620138 for ; Tue, 28 Jan 2014 11:25:58 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W86mN-0002Uf-Pp; Tue, 28 Jan 2014 11:24:33 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W86lx-0002dO-QN; Tue, 28 Jan 2014 11:24:05 +0000 Received: from mail-pd0-x235.google.com ([2607:f8b0:400e:c02::235]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W86lN-0002Ve-Uw for linux-arm-kernel@lists.infradead.org; Tue, 28 Jan 2014 11:23:32 +0000 Received: by mail-pd0-f181.google.com with SMTP id y10so238187pdj.12 for ; Tue, 28 Jan 2014 03:23:08 -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:in-reply-to:references; bh=lVzyQHIi6FGK0928hFH4R/p8fmde+V5cmGDwv1NZbX8=; b=SdHY/3qz7qtcN9P82SRvWcV1+tq91ND8rKBj1zwq6nShYxMlbgbl9JPY/+KmRKm4qN 8QrveRQxJma1c2jHdHn8a/b0qxIuis2WrRz9FY+E1KGjSNyEfexBdGhm8eMqmkO5QsBE fAwuD8+UFEoaNB2vuDOKTXkRqKw7tp0bEZ/apaI9a0u9iplFHemKtjnGlmnTOF68NckX vr7m42/ZQy/Pf7wGGsHQTbzZ86GFqTEQK6+QSXdJnY14cuPE+dFcq/zsObK8EtbrZ264 kZ7gEICQkOqPoCIiyX0xF7PQwHYxFM41w7NUNvzicFdM+xt+SEBXIfnPJTW2L1nyJhhy 1D5w== X-Received: by 10.66.253.33 with SMTP id zx1mr1026709pac.28.1390908187791; Tue, 28 Jan 2014 03:23:07 -0800 (PST) Received: from ubuntu.caveonetworks.com ([115.119.134.194]) by mx.google.com with ESMTPSA id bz4sm41563650pbb.12.2014.01.28.03.23.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Jan 2014 03:23:07 -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 v9 4/6] KGDB: make kgdb_breakpoint() as noinline Date: Tue, 28 Jan 2014 16:50:20 +0530 Message-Id: <1390908022-10287-5-git-send-email-vijay.kilari@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1390908022-10287-1-git-send-email-vijay.kilari@gmail.com> References: <1390908022-10287-1-git-send-email-vijay.kilari@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140128_062330_142137_BC101B7A X-CRM114-Status: GOOD ( 11.02 ) 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=-4.6 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 The function kgdb_breakpoint() sets up break point at compile time by calling arch_kgdb_breakpoint(); Though this call is surrounded by wmb() barrier, the compile can still re-order the break point, because this scheduling barrier is not a code motion barrier in gcc. Making kgdb_breakpoint() as noinline solves this problem of code reording around break point instruction and also avoids problem of being called as inline function from other places More details about discussion on this can be found here http://comments.gmane.org/gmane.linux.ports.arm.kernel/269732 Signed-off-by: Vijaya Kumar K Acked-by: Will Deacon Acked-by: Jason Wessel --- kernel/debug/debug_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index 7d2f35e..cf04798 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c @@ -1034,7 +1034,7 @@ int dbg_io_get_char(void) * otherwise as a quick means to stop program execution and "break" into * the debugger. */ -void kgdb_breakpoint(void) +noinline void kgdb_breakpoint(void) { atomic_inc(&kgdb_setting_breakpoint); wmb(); /* Sync point before breakpoint */