arm64: ftrace: don't adjust the LR value
authorMark Rutland <mark.rutland@arm.com>
Thu, 15 Nov 2018 22:42:01 +0000 (22:42 +0000)
committerWill Deacon <will.deacon@arm.com>
Fri, 30 Nov 2018 13:29:05 +0000 (13:29 +0000)
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>
arch/arm64/kernel/entry-ftrace.S

index bb549f71948d8d7304a1adb55435721e93b70c33..bc1ccd253007bebe669dc44063cfa842e0e3c9f8 100644 (file)
@@ -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