diff options
author | Mark Rutland <mark.rutland@arm.com> | 2017-07-26 16:05:20 +0100 |
---|---|---|
committer | Mark Rutland <mark.rutland@arm.com> | 2017-08-08 16:28:25 +0100 |
commit | ed84b4e9582bdfeffc617589fe17dddfc5fe6672 (patch) | |
tree | 8f07696d46b70f43c284b300cfcb121a409a31ac /arch/arm64/include | |
parent | 2d0e751a4789fc5ab4a5c9de5d6407b41fdfbbf0 (diff) | |
download | linux-stable-ed84b4e9582bdfeffc617589fe17dddfc5fe6672.tar.gz linux-stable-ed84b4e9582bdfeffc617589fe17dddfc5fe6672.tar.bz2 linux-stable-ed84b4e9582bdfeffc617589fe17dddfc5fe6672.zip |
arm64: move non-entry code out of .entry.text
Currently, cpu_switch_to and ret_from_fork both live in .entry.text,
though neither form the critical path for an exception entry.
In subsequent patches, we will require that code in .entry.text is part
of the critical path for exception entry, for which we can assume
certain properties (e.g. the presence of exception regs on the stack).
Neither cpu_switch_to nor ret_from_fork will meet these requirements, so
we must move them out of .entry.text. To ensure that neither are kprobed
after being moved out of .entry.text, we must explicitly blacklist them,
requiring a new NOKPROBE() asm helper.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r-- | arch/arm64/include/asm/assembler.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index 1b67c3782d00..610a42018241 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -403,6 +403,17 @@ alternative_endif .size __pi_##x, . - x; \ ENDPROC(x) +/* + * Annotate a function as being unsuitable for kprobes. + */ +#ifdef CONFIG_KPROBES +#define NOKPROBE(x) \ + .pushsection "_kprobe_blacklist", "aw"; \ + .quad x; \ + .popsection; +#else +#define NOKPROBE(x) +#endif /* * Emit a 64-bit absolute little endian symbol reference in a way that * ensures that it will be resolved at build time, even when building a |