From patchwork Fri Oct 18 11:07:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Kilari X-Patchwork-Id: 3065851 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 822F79F288 for ; Fri, 18 Oct 2013 11:24:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7AF5F2038C for ; Fri, 18 Oct 2013 11:24:12 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 753562038B for ; Fri, 18 Oct 2013 11:24:11 +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 1VX7wl-0005Hy-QV; Fri, 18 Oct 2013 11:10:25 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VX7wE-0007iN-6i; Fri, 18 Oct 2013 11:09:50 +0000 Received: from mail-pb0-x234.google.com ([2607:f8b0:400e:c01::234]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VX7vl-0007dg-Gk for linux-arm-kernel@lists.infradead.org; Fri, 18 Oct 2013 11:09:24 +0000 Received: by mail-pb0-f52.google.com with SMTP id wy17so731503pbc.25 for ; Fri, 18 Oct 2013 04:08:59 -0700 (PDT) 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=Wjkx+RuXVPh3CIfy0XFzHPfJia2PiJm0443cAE8qBM8=; b=ddfVD/5Kd1PfBcwua438y4Mzy2M1F2UnMr0ZRAUiHmHsDptiM2je7Kzg3Rgqn6OAlh nwSlCCuI40Lbew2CHQnEhfBBK62z8SHoYmD+XybWXc90N5N3sUutEGRNxKECq0c59QU8 jXN9A9+f5gyuJ8CQp/7iGj34u0QLjV+LUGD9Zt1hgt3cjeQx6r6YXMQdEw2V4QDDzku9 xebaiyxWKYyZ6C6udgIyTKu+curhQ3y/oQK9MXPBN0JO0QsLrbQ5dLu1yn/272UkK47B ayQB0V+TQ4xzXM9WEEVVvBJa8SEceLHG+7VnJUNPBonFSorjSWtu0Tr5FQ5SdwjCrBaS DJng== X-Received: by 10.68.196.227 with SMTP id ip3mr2394874pbc.163.1382094539066; Fri, 18 Oct 2013 04:08:59 -0700 (PDT) Received: from ubuntu.caveonetworks.com ([115.119.134.194]) by mx.google.com with ESMTPSA id xs1sm3587419pac.7.2013.10.18.04.08.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 04:08:58 -0700 (PDT) From: vijay.kilari@gmail.com To: will.deacon@arm.com, sandeepa.prabhu@linaro.org, jason.wessel@windriver.com Subject: [PATCH v3 4/4] KGDB: make kgdb_breakpoint() as noinline Date: Fri, 18 Oct 2013 16:37:49 +0530 Message-Id: <1382094469-7971-5-git-send-email-vijay.kilari@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1382094469-7971-1-git-send-email-vijay.kilari@gmail.com> References: <1382094469-7971-1-git-send-email-vijay.kilari@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131018_070921_718961_81877A9D X-CRM114-Status: GOOD ( 11.42 ) X-Spam-Score: -2.0 (--) Cc: linaro-kernel@lists.linaro.org, linux@arm.linux.org.uk, Prasun.Kapoor@caviumnetworks.com, Vijaya Kumar K , takahiro.akashi@linaro.org, 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.5 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 --- 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 0506d44..359ce6a 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c @@ -1006,7 +1006,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 */