summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2018-11-15 22:42:01 +0000
committerSeung-Woo Kim <sw0312.kim@samsung.com>2019-11-19 16:26:17 +0900
commit6980d8e5797b10049cdea415bf5c46b09a883832 (patch)
tree7ffafb86fbed97f80e510631394a22654488762e
parent0ca0b513b52d45dfc9b52af9523840e15b3743d0 (diff)
downloadlinux-4.9-exynos9110-6980d8e5797b10049cdea415bf5c46b09a883832.tar.gz
linux-4.9-exynos9110-6980d8e5797b10049cdea415bf5c46b09a883832.tar.bz2
linux-4.9-exynos9110-6980d8e5797b10049cdea415bf5c46b09a883832.zip
arm64: ftrace: don't adjust the LR value
[ 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 <mark.rutland@arm.com> Cc: AKASHI Takahiro <takahiro.akashi@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Torsten Duwe <duwe@suse.de> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Sasha Levin <sashal@kernel.org> [sw0312.kim: cherry-pick linux-4.9.y stable commit bfadca610fcf to fix ftrace issue] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Change-Id: Ib9a2bd4728efeb0b1fa28e60135ba596bac55ace
-rw-r--r--arch/arm64/kernel/entry-ftrace.S1
1 files changed, 0 insertions, 1 deletions
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