From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80101C43381 for ; Mon, 18 Feb 2019 14:08:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 555DD204FD for ; Mon, 18 Feb 2019 14:08:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498917; bh=RKeHUYHQouzeKheTu3/hQpKcOMM6QMbhuxJngNurYTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=tn2nceK0eSjhjnk4tkRcmi35K06ecj13tv7w4U15ZcRty7GzAG5sHk85E2jbdMNYC 4RVVZApU0Vyzk6gy5m76eqttoBcgcuLiI69QyEcSOLUMgfmtdctAGb6iJcmjn0tXHP QJWUBwXNS0v/rinB4dQ2B8+yXXSL2C+7FvUY2BaE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390950AbfBROIf (ORCPT ); Mon, 18 Feb 2019 09:08:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:51766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390905AbfBROI1 (ORCPT ); Mon, 18 Feb 2019 09:08:27 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F321F21901; Mon, 18 Feb 2019 14:08:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498906; bh=RKeHUYHQouzeKheTu3/hQpKcOMM6QMbhuxJngNurYTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mgdQ82T0vDuXaypdk3wiA6MH/I0qSnl8NeFv0h+9DLv3bJZJQEbKQrhPs7Iya5rVZ O1n3YHwY81c7N6pp2QSqR0j8HWMeRmka0wjCEGFWtHnMYyRuuIHx18F8iBe5PsgYdP jmdRjwbW7yA2p4Ymd4lLGifi+EAvyQupFwXMl30s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Rutland , AKASHI Takahiro , Ard Biesheuvel , Catalin Marinas , Torsten Duwe , Will Deacon , Sasha Levin Subject: [PATCH 3.18 015/108] arm64: ftrace: dont adjust the LR value Date: Mon, 18 Feb 2019 14:43:11 +0100 Message-Id: <20190218133520.214997948@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133519.525507231@linuxfoundation.org> References: <20190218133519.525507231@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 6e803e2e6e367db9a0d6ecae1bd24bb5752011bd ] The core ftrace code requires that when it is handed the PC of an instrumented function, this PC is the address of the instrumented instruction. This is necessary so that the core ftrace code can identify the specific instrumentation site. Since the instrumented function will be a BL, the address of the instrumented function is LR - 4 at entry to the ftrace code. This fixup is applied in the mcount_get_pc and mcount_get_pc0 helpers, which acquire the PC of the instrumented function. The mcount_get_lr helper is used to acquire the LR of the instrumented function, whose value does not require this adjustment, and cannot be adjusted to anything meaningful. No adjustment of this value is made on other architectures, including arm. However, arm64 adjusts this value by 4. This patch brings arm64 in line with other architectures and removes the adjustment of the LR value. Signed-off-by: Mark Rutland Cc: AKASHI Takahiro Cc: Ard Biesheuvel Cc: Catalin Marinas Cc: Torsten Duwe Cc: Will Deacon Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/kernel/entry-ftrace.S | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm64/kernel/entry-ftrace.S b/arch/arm64/kernel/entry-ftrace.S index c85a02b6cca0..b3fdbba80d4b 100644 --- a/arch/arm64/kernel/entry-ftrace.S +++ b/arch/arm64/kernel/entry-ftrace.S @@ -78,7 +78,6 @@ .macro mcount_get_lr reg ldr \reg, [x29] ldr \reg, [\reg, #8] - mcount_adjust_addr \reg, \reg .endm .macro mcount_get_lr_addr reg -- 2.19.1