]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: ftrace: Ensure module ftrace trampoline is coherent with I-side
authorWill Deacon <will@kernel.org>
Fri, 16 Aug 2019 13:57:43 +0000 (14:57 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 16 Aug 2019 16:40:03 +0000 (17:40 +0100)
commit0ffb1f7621b04a3bb421e82575f894ff50261d34
treef2e7abeb246bc656dd7f1213b5b0e423fa0c4854
parent7ab4d1c8018c07f037237ff85007b94f2868cc7d
arm64: ftrace: Ensure module ftrace trampoline is coherent with I-side

The initial support for dynamic ftrace trampolines in modules made use
of an indirect branch which loaded its target from the beginning of
a special section (3b5ecc7bd9fdc ("arm64: ftrace: add support for far
branches to dynamic ftrace")). Since no instructions were being patched,
no cache maintenance was needed. However, later in faedf1dd25e7 ("arm64:
ftrace: emit ftrace-mod.o contents through code") this code was reworked
to output the trampoline instructions directly into the PLT entry but,
unfortunately, the necessary cache maintenance was overlooked.

Add a call to __flush_icache_range() after writing the new trampoline
instructions but before patching in the branch to the trampoline.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: James Morse <james.morse@arm.com>
Cc: <stable@vger.kernel.org>
Fixes: faedf1dd25e7 ("arm64: ftrace: emit ftrace-mod.o contents through code")
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/ftrace.c