From patchwork Thu Jan 3 10:12:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kpark3469@gmail.com X-Patchwork-Id: 1926851 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id B59633FC33 for ; Thu, 3 Jan 2013 10:15:54 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TqhnC-0000ZC-GC; Thu, 03 Jan 2013 10:12:54 +0000 Received: from mail-bk0-f54.google.com ([209.85.214.54]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tqhn8-0000YL-5K for linux-arm-kernel@lists.infradead.org; Thu, 03 Jan 2013 10:12:51 +0000 Received: by mail-bk0-f54.google.com with SMTP id je9so6560469bkc.13 for ; Thu, 03 Jan 2013 02:12:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=kppLxdX83LYHyFQEfyGnv1SggF8SYuiYfJIiAK1BlO4=; b=igjm+rWawjoBTHBqjPk9XaRtyU7xGOdnDnMCNDDszVzH9R+HA1viNbC1gbAzuJU0Yn iLV9FFdpH7+6qqERpZAjN/Z4dybst1P6zfZdyxFr4d6p62a6iYi6uO3diiQd72XK1iPi wj0jlSbYy/zMuhiBBTB4AsHwT5eUTKMw4UnpBk8LHvB14ZNBCMB2r8uKjvL5+lUR0Ecf mNlpBPwPiM8Yzwm4ECETtlceMSD0EJgm1QG00IllC8KNGbdFYAYCOrdIx/idLV4ercji 79KRmLkfTTt+Nau5OzAbBGqyAUusXa1M4fk4kRnSwv/sPmM0sykyAL545/rYAscvDqZw 5i3w== X-Received: by 10.204.130.140 with SMTP id t12mr24018734bks.39.1357207966817; Thu, 03 Jan 2013 02:12:46 -0800 (PST) Received: from localhost.localdomain ([61.107.31.52]) by mx.google.com with ESMTPS id c10sm33205601bkw.1.2013.01.03.02.12.40 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Jan 2013 02:12:46 -0800 (PST) From: kpark3469@gmail.com To: rostedt@goodmis.org Subject: [PATCH 1/2] arm: fix returning wrong CALLER_ADDRx Date: Thu, 3 Jan 2013 19:12:28 +0900 Message-Id: <1357207949-3349-1-git-send-email-kpark3469@gmail.com> X-Mailer: git-send-email 1.7.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130103_051250_389012_CE239B44 X-CRM114-Status: GOOD ( 11.70 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (kpark3469[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.54 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (kpark3469[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: sahara , linux@arm.linux.org.uk, fweisbec@gmail.com, linux-kernel@vger.kernel.org, mingo@redhat.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: sahara This makes return_address return correct value for ftrace feature. unwind_frame does not update frame->lr but frame->pc for backtrace. And, the initialization for data.addr was missing so that wrong value returned when unwind_frame failed. Signed-off-by: sahara --- arch/arm/kernel/return_address.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c index 8085417..fafedd8 100644 --- a/arch/arm/kernel/return_address.c +++ b/arch/arm/kernel/return_address.c @@ -26,7 +26,7 @@ static int save_return_addr(struct stackframe *frame, void *d) struct return_address_data *data = d; if (!data->level) { - data->addr = (void *)frame->lr; + data->addr = (void *)frame->pc; return 1; } else { @@ -41,7 +41,8 @@ void *return_address(unsigned int level) struct stackframe frame; register unsigned long current_sp asm ("sp"); - data.level = level + 1; + data.level = level + 2; + data.addr = NULL; frame.fp = (unsigned long)__builtin_frame_address(0); frame.sp = current_sp;