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.0 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=unavailable 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 0963BC169C4 for ; Mon, 11 Feb 2019 15:17:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA2BD222A7 for ; Mon, 11 Feb 2019 15:17:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549898264; bh=b24+RHqgNX9D6mt3NqCkWGHw4u6k+4CqGZjs7b7VpqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=IE7IGbsglniXjeO0VZcC5BA/Mrv0m1B6tEkImw97oRGeNf4wsHkOWUvgCHfbkQDUP rgnHNC2CpruYlPfMa3JeLmY6DPIIdGTqPvf8Dq5kvMAYtx8aH6xv7ua+Jc0YctV3mt zD3r0qqsi8Dn6p2FVrbUlGP1z0z4rXg9eSCtB5BY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391062AbfBKPFr (ORCPT ); Mon, 11 Feb 2019 10:05:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:55094 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389823AbfBKPFm (ORCPT ); Mon, 11 Feb 2019 10:05:42 -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 1A682222A7; Mon, 11 Feb 2019 15:05:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897541; bh=b24+RHqgNX9D6mt3NqCkWGHw4u6k+4CqGZjs7b7VpqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B3C1FXj4FeaO1Tr5h8swL8Ks6ZDZJZ9TFnS6MFOnd2J7IdFF3ADTsGGSltzqaJ+64 YElUNCvVyG+/SBbhnbAIbktrnbempVSul/XLmhWHrG50ce3NriuIGGSCLCDN+woawG vRLDZaOh/9TQB1jN2IDJMBYSvyObXfCfIOPoy0NY= 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 4.9 032/137] arm64: ftrace: dont adjust the LR value Date: Mon, 11 Feb 2019 15:18:33 +0100 Message-Id: <20190211141814.938920990@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141811.964925535@linuxfoundation.org> References: <20190211141811.964925535@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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 4.9-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 aef02d2af3b5..7a87d32e98f4 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