From patchwork Sat Sep 6 00:06:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 36925 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 13898206A0 for ; Sat, 6 Sep 2014 00:08:44 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f10sf401598yha.11 for ; Fri, 05 Sep 2014 17:08:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:mime-version:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=VkaQDd53/qpOR6lMAtXiCBQHyeiNJypIRKuXP7gqUZ8=; b=UOyvhUoaJiGPyNJODoRB/BozJ+IpuGnLUNm87rObHnM0SQcYiuBtTEtZ1IP/D3AM6i dp4ap/WghnxHiAp6/4WDgCIV2nPoRcONdpC8gbDXEKxqRhWW5oTDtM9bvZgFfrOO9mHX 8B+cvj89yTZL7xNiakAs+nBoKQRy/W6LZQAlNeNnDtiRY7mVf/8isjNJUMHnt6GO31W3 ahb6NfVfKJA6e1QnIZfy0f0vX5okvIYYUtI4YtLxObazfPra8ugoHZpL4GVOT2l0Yo6v YLy4yNeatCYjXo3wu30Uk6VwhItBCEV1H377BADO2BBp4nDk/v2wG+Xh7Tth0+q74KEF ysSg== X-Gm-Message-State: ALoCoQm4CsiCG5Eo59yehgONizFD6F2tRY4bEL5mxn4I3UjCx/8IusG6eRoQHrVlx3sLVvlEOJ3S X-Received: by 10.236.100.134 with SMTP id z6mr8897882yhf.8.1409962123869; Fri, 05 Sep 2014 17:08:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.180 with SMTP id x49ls927531qgx.97.gmail; Fri, 05 Sep 2014 17:08:43 -0700 (PDT) X-Received: by 10.52.228.67 with SMTP id sg3mr11049740vdc.6.1409962123799; Fri, 05 Sep 2014 17:08:43 -0700 (PDT) Received: from mail-vc0-x229.google.com (mail-vc0-x229.google.com [2607:f8b0:400c:c03::229]) by mx.google.com with ESMTPS id o4si1571205vcy.87.2014.09.05.17.08.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Sep 2014 17:08:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::229 as permitted sender) client-ip=2607:f8b0:400c:c03::229; Received: by mail-vc0-f169.google.com with SMTP id hq11so13394627vcb.28 for ; Fri, 05 Sep 2014 17:08:43 -0700 (PDT) X-Received: by 10.52.33.1 with SMTP id n1mr4179313vdi.28.1409962123692; Fri, 05 Sep 2014 17:08:43 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp153656vcb; Fri, 5 Sep 2014 17:08:43 -0700 (PDT) X-Received: by 10.70.96.74 with SMTP id dq10mr27155857pdb.112.1409962122048; Fri, 05 Sep 2014 17:08:42 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id i2si6276697pdj.207.2014.09.05.17.08.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Sep 2014 17:08:42 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XQ3XU-0008C0-RG; Sat, 06 Sep 2014 00:07:36 +0000 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XQ3X8-0007rt-IU for linux-arm-kernel@lists.infradead.org; Sat, 06 Sep 2014 00:07:15 +0000 Received: by mail-pa0-f53.google.com with SMTP id fa1so23274498pad.40 for ; Fri, 05 Sep 2014 17:06:53 -0700 (PDT) X-Received: by 10.66.161.232 with SMTP id xv8mr25992007pab.81.1409962013747; Fri, 05 Sep 2014 17:06:53 -0700 (PDT) Received: from galdor.websterwood.com (S0106dc9fdb80cffd.gv.shawcable.net. [96.50.97.138]) by mx.google.com with ESMTPSA id yx1sm2867621pab.5.2014.09.05.17.06.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Sep 2014 17:06:52 -0700 (PDT) From: behanw@converseincode.com To: a.ryabinin@samsung.com, anurag19aggarwal@gmail.com, charlebm@gmail.com, cl@linux-foundation.org, dave.long@linaro.org, k.khlebnikov@samsung.com, linux@arm.linux.org.uk, linyongting@gmail.com, Nikolay.Borisov@arm.com, tglx@linutronix.de, tj@kernel.org, u.kleine-koenig@pengutronix.de Subject: [PATCH v2 4/7] arm: LLVMLinux: Use current_stack_pointer in save_stack_trace_tsk Date: Fri, 5 Sep 2014 17:06:14 -0700 Message-Id: <1409961977-11762-5-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409961977-11762-1-git-send-email-behanw@converseincode.com> References: <1409961977-11762-1-git-send-email-behanw@converseincode.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140905_170714_647132_A03769C8 X-CRM114-Status: GOOD ( 10.23 ) X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c03:0:0:0:235 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: rric@kernel.org, will.deacon@arm.com, linux-kernel@vger.kernel.org, rostedt@goodmis.org, rabin@rab.in, Dave.Martin@arm.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Original-Sender: behanw@converseincode.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::229 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@ Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Behan Webster Use the global current_stack_pointer to get the value of the stack pointer. This change supports being able to compile the kernel with both gcc and clang. Signed-off-by: Behan Webster Signed-off-by: Mark Charlebois Reviewed-by: Jan-Simon Möller --- arch/arm/kernel/stacktrace.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c index f065eb0..92b7237 100644 --- a/arch/arm/kernel/stacktrace.c +++ b/arch/arm/kernel/stacktrace.c @@ -134,12 +134,10 @@ static noinline void __save_stack_trace(struct task_struct *tsk, frame.pc = thread_saved_pc(tsk); #endif } else { - register unsigned long current_sp asm ("sp"); - /* We don't want this function nor the caller */ data.skip += 2; frame.fp = (unsigned long)__builtin_frame_address(0); - frame.sp = current_sp; + frame.sp = current_stack_pointer; frame.lr = (unsigned long)__builtin_return_address(0); frame.pc = (unsigned long)__save_stack_trace; }