Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3627362imu; Mon, 28 Jan 2019 08:05:01 -0800 (PST) X-Google-Smtp-Source: ALg8bN6X88ob7qzzr5H3xyjOOahNi9C4+hyGKI4YBQTjxHK6P5h2IThLKiwCEhAuZvgWj+6RNx2j X-Received: by 2002:a62:26c7:: with SMTP id m190mr22818941pfm.79.1548691501224; Mon, 28 Jan 2019 08:05:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691501; cv=none; d=google.com; s=arc-20160816; b=F5BYYeiXPMATxYXcaoCrbiSDukggrAlGVH9kW6b4ZrAx5llxLq9JmWalag0tXqRdgS kUrV3Ig5ulbNGSHh8LrsBg5nngaDaSXEb9zfC9JoAmQw2Jdh7CqU43xvXyAQS2PfgH5h ZRo+jZIOTumsLXEwC+apBowAE+a0V+HJLhZXZMDLEogYyJhC1FVm6ZYo7aniVUDjx5wx xujLuT3/+/smDA3EkeuHSV/kkcOsn5B2cbJfGbh89E94gY/QrVktuW7hnF0Fy+QwErZv AQCV4ucFRY7ggNX4w2I/uwije55z8A9lDyP1kskLg+9u1uAhKxiIRdsvH5bePb3a9Nn3 N5ng== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SkMk506sKwcIDelW21onBjYZGDC0a8CrvcuhFawW5Ew=; b=QZAnJN0GpUbugQOKUXrOl1bTwMLBkaNBJLRtPRKjNVfIcN/E0ppRMCVWIlkspsUiwq wRrY6BoHejTTVMRAqIJCB5/S8ytRckotwhXp0H5Mu/yKWeqxQjlH3Zb1z0jWo26xcNph xEtMAdMJHVnuf8usqWL7mHzpoxwsLqqY0f1SbuN3ZIVox0WeN/HOPqAneRb8TZDhdJYX 5wmBq4XAYf+qzkXyPy5LSp/blKFvRCOvKC5Tm/1oklHi92N10x08rG9/ZBiSPEe/dK3C McvpQ/ot7261oDAwjKE9tQe9Si2DZ9O6Hg09jiO5rEpa38iX1JCHeeoqPfkHd6AnAQhP 3lEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="JFn/vXn2"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9si32830164pfk.35.2019.01.28.08.04.45; Mon, 28 Jan 2019 08:05:01 -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="JFn/vXn2"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730784AbfA1QDu (ORCPT + 99 others); Mon, 28 Jan 2019 11:03:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:49142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731445AbfA1QDs (ORCPT ); Mon, 28 Jan 2019 11:03:48 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BEB442175B; Mon, 28 Jan 2019 16:03:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691427; bh=IyuBYT+o5n1tQPKvkmp596grXsQxcG0h3diz7rENV9M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JFn/vXn2CDE3MI1nHUW2spYUmYgMjy0+lOIPjtJv0mwLfUN+tbHG0HG3+JUZBMXEW BcHwffJgehCcwX+pl+O+uSWr4YZkQDTd9M9ovFNgP33VqoHAQw/gSn6CL684wSS/Sg N9j07OdZ1OyCMLa+4kuJewlg/zL7IT1cy3hEX3so= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mark Rutland , AKASHI Takahiro , Ard Biesheuvel , Catalin Marinas , Torsten Duwe , Will Deacon , Sasha Levin Subject: [PATCH AUTOSEL 4.19 091/258] arm64: ftrace: don't adjust the LR value Date: Mon, 28 Jan 2019 10:56:37 -0500 Message-Id: <20190128155924.51521-91-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Rutland [ 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 1175f5827ae1..295951f3172e 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