diff options
author | 2020-03-20 11:20:18 +0100 | |
---|---|---|
committer | 2020-04-03 00:10:00 +1100 | |
commit | 7c0eda1a04340a1de09bdf6521853e3bc0637c3b (patch) | |
tree | 4b408bed20097a5f904cdb9caa4fcafbb28f7a57 /arch/powerpc/perf/callchain.h | |
parent | powerpc/64: Make COMPAT user-selectable disabled on littleendian by default. (diff) | |
download | linux-7c0eda1a04340a1de09bdf6521853e3bc0637c3b.tar.gz linux-7c0eda1a04340a1de09bdf6521853e3bc0637c3b.tar.bz2 linux-7c0eda1a04340a1de09bdf6521853e3bc0637c3b.zip |
powerpc/perf: split callchain.c by bitness
Building callchain.c with !COMPAT proved quite ugly with all the
defines. Splitting out the 32bit and 64bit parts looks better.
No code change intended.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/a20027bf1074935a7934ee2a6757c99ea047e70d.1584699455.git.msuchanek@suse.de
Diffstat (limited to 'arch/powerpc/perf/callchain.h')
-rw-r--r-- | arch/powerpc/perf/callchain.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/powerpc/perf/callchain.h b/arch/powerpc/perf/callchain.h new file mode 100644 index 000000000000..7a2cb9e1181a --- /dev/null +++ b/arch/powerpc/perf/callchain.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#ifndef _POWERPC_PERF_CALLCHAIN_H +#define _POWERPC_PERF_CALLCHAIN_H + +int read_user_stack_slow(void __user *ptr, void *buf, int nb); +void perf_callchain_user_64(struct perf_callchain_entry_ctx *entry, + struct pt_regs *regs); +void perf_callchain_user_32(struct perf_callchain_entry_ctx *entry, + struct pt_regs *regs); + +static inline bool invalid_user_sp(unsigned long sp) +{ + unsigned long mask = is_32bit_task() ? 3 : 7; + unsigned long top = STACK_TOP - (is_32bit_task() ? 16 : 32); + + return (!sp || (sp & mask) || (sp > top)); +} + +#endif /* _POWERPC_PERF_CALLCHAIN_H */ |