Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2721148imj; Mon, 11 Feb 2019 07:29:59 -0800 (PST) X-Google-Smtp-Source: AHgI3IY/mKfOtj6zrejQzVZoYWzwsTRHZsUTcedn6qjUWaEp812+c1yYBbxNWtSutQ/B7QKVEY4a X-Received: by 2002:a17:902:8607:: with SMTP id f7mr37258937plo.123.1549898999225; Mon, 11 Feb 2019 07:29:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549898999; cv=none; d=google.com; s=arc-20160816; b=ysrrwgf6I0Nc7IF/vGsOTsJhAeH4JkTMRT1RjAkXe2lGdWVI1GEk1PzqOZ/KebYz8z TQlnZtWlACVpQ3DP6VAy32EHmR+OxIOQOLGm8rL8bH7LqFxSZkfbdTRSMv8MQW6Pb+FX jRSjRo3m17SiYvTQK8XF27BgktejrkntKr5nf3NzzNMObnGIRjsp6ce0ZfeUFofRqete bOc4Xy4Dpo8nmOPt+4bd7nFtlJxKbLGjQAaYlmoH9SvMmgkgo+94pmHIOti9uFUZcYYZ Y09xLrW5uX6FbRv4lrSHFyvcesFp0Z8vCxnU9ZAjy33k8h7mDzPnp0c0O0S442PYr/A9 x/zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SwwHO6KhUbCfqPYRXJ/bRdFsZeB77Y8T9tFZbRClsko=; b=ysTzkElDFEkKxNS+EJ/n1k6qCiaxo/unR3GZ8nHvVewCrGm/QrlvNTd3x0hHEHz+Ig Pep6UHnw6Pmnvg5dn4ZcjnH3FUN77aH6SAhzzAh2GYSI6qmbH9HqIc+ykJwkCyCu0dcZ /XuFRyszYaxCjF9zl369xx4OYc+oxdEoZf3sSR5uneZrZuAlMrqvenF4abOXDaOjFBfT XZwCsLfmDkksFdX5+A0vRcCq2CrhsQdbxYrixLaUW9uzH8NOmcLHqDhU32ZhTqZ6POv4 y2PAHB7Dwd/dVF2nN88mDoBVCa9G/dOLSf6qlEyTP6/Pt6AZV2lfpR2QwmdfMyzPnDfm lKQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RalG1KT5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p66si10667476pfp.144.2019.02.11.07.29.43; Mon, 11 Feb 2019 07:29:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RalG1KT5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389491AbfBKO6K (ORCPT + 99 others); Mon, 11 Feb 2019 09:58:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:45700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389478AbfBKO6I (ORCPT ); Mon, 11 Feb 2019 09:58:08 -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 E5E9020700; Mon, 11 Feb 2019 14:58:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897087; bh=IRoFmFFnk+XzrWAkQ5W5xQv907Qq1K/SUskDM+au3Ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RalG1KT5wxSBiAoDQZj+H1Rr0uHA+XO2Lz4DB/ai+7ZYpeEz2l77kgTcW4G352hgt YVUsgqopjtLIZyr7W/s21rml/aGUdEqORDU2SbWMQ7B4SEod23wEJ9rkGsrwzpFUoc xYgZ9tJovIHX2QzRt1wHaXlqGz1xYfcjdKkxFzrE= 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.14 056/205] arm64: ftrace: dont adjust the LR value Date: Mon, 11 Feb 2019 15:17:34 +0100 Message-Id: <20190211141832.472147729@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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 4.14-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 e1be42e11ff5..5a10e3a3e843 100644 --- a/arch/arm64/kernel/entry-ftrace.S +++ b/arch/arm64/kernel/entry-ftrace.S @@ -79,7 +79,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